class PacketCodingActor extends Actor with MDCContextAware

In between the network side and the higher functioning side of the simulation: accept packets and transform them into a sequence of data (encoding), and accept a sequence of data and transform it into s packet (decoding).

Following the standardization of the SessionRouter pipeline, the throughput of this Actor has directionality. The "network," where the encoded data comes and goes, is assumed to be leftRef. The "simulation", where the decoded packets come and go, is assumed to be rightRef. rightRef can accept a sequence that looks like encoded data but it will merely pass out the same sequence. Likewise, leftRef accepts decoded packets but merely ejects the same packets without doing any work on them. The former functionality is anticipated. The latter functionality is deprecated.

Encoded data leaving the Actor (leftRef) is limited by an upper bound capacity. Sequences can not be larger than that bound or else they will be dropped. This maximum transmission unit (MTU) is used to divide the encoded sequence into chunks of encoded data, re-packaged into nested ControlPacket units, and each unit encoded. The outer packaging is numerically consistent with a subslot that starts counting once the simulation starts. The client is very specific about the subslot number and will reject out-of-order packets. It resets to 0 each time this Actor starts up and the client reflects this functionality.

Source
PacketCodingActor.scala
Linear Supertypes
MDCContextAware, ActorLogging, Actor, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. PacketCodingActor
  2. MDCContextAware
  3. ActorLogging
  4. Actor
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new PacketCodingActor()

Type Members

  1. type Receive = PartialFunction[Any, Unit]
    Definition Classes
    Actor

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def AddSlottedPacketToLog(subslot: Int, packet: ByteVector): Unit
  5. def Established: Receive
  6. def Initializing: Receive
  7. def Subslot: Int

    Retrieve the current subslot number.

    Retrieve the current subslot number. Increment the subslot for the next time it is needed.

    returns

    a 16u number starting at 0

  8. def UnmarshalInnerPacket(data: ByteVector, description: String): Unit

    Transform data into a container packet and re-submit that container to the process that handles the packet.

    Transform data into a container packet and re-submit that container to the process that handles the packet.

    data

    the packet data

    description

    an explanation of the input data

  9. def aroundPostRestart(reason: Throwable): Unit
    Attributes
    protected[akka]
    Definition Classes
    Actor
    Annotations
    @InternalApi()
  10. def aroundPostStop(): Unit
    Attributes
    protected[akka]
    Definition Classes
    Actor
    Annotations
    @InternalApi()
  11. def aroundPreRestart(reason: Throwable, message: Option[Any]): Unit
    Attributes
    protected[akka]
    Definition Classes
    Actor
    Annotations
    @InternalApi()
  12. def aroundPreStart(): Unit
    Attributes
    protected[akka]
    Definition Classes
    Actor
    Annotations
    @InternalApi()
  13. def aroundReceive(receive: akka.actor.Actor.Receive, msg: Any): Unit
    Attributes
    protected[akka]
    Definition Classes
    MDCContextAware → Actor
  14. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  15. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  16. implicit val context: ActorContext
    Definition Classes
    Actor
  17. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  19. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  20. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  21. def handleBundlePacket(data: ByteVector): Unit

    Accept ByteVector data and package it into a SlottedMetaPacket.

    Accept ByteVector data and package it into a SlottedMetaPacket. Send it (towards the network) upon successful encoding.

    data

    an encoded packet

  22. def handleBundlePacket(vec: Vector[ByteVector]): Unit

    Accept a Vector of encoded packets and re-package them.

    Accept a Vector of encoded packets and re-package them. The normal order is to package the elements of the vector into a MultiPacketEx. If the vector only has one element, it will get packaged by itself in a SlottedMetaPacket. If that one element risks being too big for the MTU, however, it will be handled off to be split. Splitting should preserve Subslot ordering with the rest of the bundling.

    vec

    a specific number of byte streams

  23. def handleBundlePacket(bundle: List[PlanetSidePacket]): Unit

    Accept a List of packets and sequentially re-package the elements from the list into multiple container packets.

    The original packets are encoded then paired with their encoding lengths plus extra space to prefix the length.

    Accept a List of packets and sequentially re-package the elements from the list into multiple container packets.

    The original packets are encoded then paired with their encoding lengths plus extra space to prefix the length. Encodings from these pairs are drawn from the list until into buckets that fit a maximum byte stream length. The size limitation on any bucket is the MTU limit. less by the base sizes of MultiPacketEx (2) and of SlottedMetaPacket (4).

    bundle

    the packets to be bundled

  24. def handleControlPacket(container: PlanetSidePacketContainer, packet: PlanetSideControlPacket): Unit

    Process a control packet or determine that it does not need to be processed at this level.

    Process a control packet or determine that it does not need to be processed at this level. Primarily, if the packet is of a type that contains another packet that needs be be unmarshalled, that/those packet must be unwound.

    The subslot information is used to identify these nested packets after arriving at their destination, to establish order for sequential packets and relation between divided packets.

    container

    the original container packet

    packet

    the packet that was extracted from the container

  25. def handlePacketContainer(container: PlanetSidePacketContainer): Unit

    Sort and redirect a container packet bound for the server by type of contents.

    Sort and redirect a container packet bound for the server by type of contents. GamePacket objects can just onwards without issue. ControlPacket objects may need to be dequeued. All other container types are invalid.

    container

    the container packet

  26. def handleSplitPacket(data: ByteVector): Unit

    Accept ByteVector data, representing a ControlPacket, and split it into chunks.

    Accept ByteVector data, representing a ControlPacket, and split it into chunks. The chunks should not be blocked by the MTU. Send each chunk (towards the network) as it is converted.

    data

    ByteVector data to be split

  27. def handleSplitPacket(cont: ControlPacket): Unit

    Transform a ControlPacket into ByteVector data for splitting.

    Transform a ControlPacket into ByteVector data for splitting.

    cont

    the original ControlPacket

  28. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  29. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  30. def log: LoggingAdapter
    Definition Classes
    ActorLogging
  31. def mtuLimit(msg: ByteVector): Unit

    Check that an outbound packet is not too big to get stuck by the MTU.

    Check that an outbound packet is not too big to get stuck by the MTU. If it is larger than the MTU, divide it up and re-package the sections. Otherwise, send the data out like normal.

    msg

    the encoded packet data

  32. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  33. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  34. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  35. def postRestart(reason: Throwable): Unit
    Definition Classes
    Actor
    Annotations
    @throws(classOf[java.lang.Exception])
  36. def postStop(): Unit
    Definition Classes
    PacketCodingActor → Actor
  37. def preRestart(reason: Throwable, message: Option[Any]): Unit
    Definition Classes
    Actor
    Annotations
    @throws(classOf[java.lang.Exception])
  38. def preStart(): Unit
    Definition Classes
    Actor
    Annotations
    @throws(classOf[java.lang.Exception])
  39. def receive: Receive
    Definition Classes
    PacketCodingActor → Actor
  40. implicit final val self: ActorRef
    Definition Classes
    Actor
  41. def sendResponseLeft(cont: ByteVector): Unit

    Encoded sequence of data going towards the network.

    Encoded sequence of data going towards the network.

    cont

    the data

  42. def sendResponseRight(cont: PlanetSidePacketContainer): Unit

    Decoded packet going towards the simulation.

    Decoded packet going towards the simulation.

    cont

    the packet

  43. final def sender(): ActorRef
    Definition Classes
    Actor
  44. def supervisorStrategy: SupervisorStrategy
    Definition Classes
    Actor
  45. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  46. def toString(): String
    Definition Classes
    AnyRef → Any
  47. def unhandled(message: Any): Unit
    Definition Classes
    Actor
  48. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  49. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  50. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from MDCContextAware

Inherited from ActorLogging

Inherited from Actor

Inherited from AnyRef

Inherited from Any

Ungrouped