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
- Alphabetic
- By Inheritance
- PacketCodingActor
- MDCContextAware
- ActorLogging
- Actor
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new PacketCodingActor()
Type Members
- type Receive = PartialFunction[Any, Unit]
- Definition Classes
- Actor
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def AddSlottedPacketToLog(subslot: Int, packet: ByteVector): Unit
- def Established: Receive
- def Initializing: Receive
- def Subslot: Int
Retrieve the current subslot number.
Retrieve the current subslot number. Increment the
subslotfor the next time it is needed.- returns
a
16unumber starting at 0
- 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
- def aroundPostRestart(reason: Throwable): Unit
- Attributes
- protected[akka]
- Definition Classes
- Actor
- Annotations
- @InternalApi()
- def aroundPostStop(): Unit
- Attributes
- protected[akka]
- Definition Classes
- Actor
- Annotations
- @InternalApi()
- def aroundPreRestart(reason: Throwable, message: Option[Any]): Unit
- Attributes
- protected[akka]
- Definition Classes
- Actor
- Annotations
- @InternalApi()
- def aroundPreStart(): Unit
- Attributes
- protected[akka]
- Definition Classes
- Actor
- Annotations
- @InternalApi()
- def aroundReceive(receive: akka.actor.Actor.Receive, msg: Any): Unit
- Attributes
- protected[akka]
- Definition Classes
- MDCContextAware → Actor
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- implicit val context: ActorContext
- Definition Classes
- Actor
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def handleBundlePacket(data: ByteVector): Unit
Accept
ByteVectordata and package it into aSlottedMetaPacket.Accept
ByteVectordata and package it into aSlottedMetaPacket. Send it (towards the network) upon successful encoding.- data
an encoded packet
- def handleBundlePacket(vec: Vector[ByteVector]): Unit
Accept a
Vectorof encoded packets and re-package them.Accept a
Vectorof encoded packets and re-package them. The normal order is to package the elements of the vector into aMultiPacketEx. If the vector only has one element, it will get packaged by itself in aSlottedMetaPacket. If that one element risks being too big for the MTU, however, it will be handled off to be split. Splitting should preserveSubslotordering with the rest of the bundling.- vec
a specific number of byte streams
- def handleBundlePacket(bundle: List[PlanetSidePacket]): Unit
Accept a
Listof 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
Listof 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 ofMultiPacketEx(2) and ofSlottedMetaPacket(4).- bundle
the packets to be bundled
- 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
- 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.
GamePacketobjects can just onwards without issue.ControlPacketobjects may need to be dequeued. All other container types are invalid.- container
the container packet
- def handleSplitPacket(data: ByteVector): Unit
Accept
ByteVectordata, representing aControlPacket, and split it into chunks.Accept
ByteVectordata, representing aControlPacket, 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
ByteVectordata to be split
- def handleSplitPacket(cont: ControlPacket): Unit
Transform a
ControlPacketintoByteVectordata for splitting.Transform a
ControlPacketintoByteVectordata for splitting.- cont
the original
ControlPacket
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def log: LoggingAdapter
- Definition Classes
- ActorLogging
- 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
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def postRestart(reason: Throwable): Unit
- Definition Classes
- Actor
- Annotations
- @throws(classOf[java.lang.Exception])
- def postStop(): Unit
- Definition Classes
- PacketCodingActor → Actor
- def preRestart(reason: Throwable, message: Option[Any]): Unit
- Definition Classes
- Actor
- Annotations
- @throws(classOf[java.lang.Exception])
- def preStart(): Unit
- Definition Classes
- Actor
- Annotations
- @throws(classOf[java.lang.Exception])
- def receive: Receive
- Definition Classes
- PacketCodingActor → Actor
- implicit final val self: ActorRef
- Definition Classes
- Actor
- def sendResponseLeft(cont: ByteVector): Unit
Encoded sequence of data going towards the network.
Encoded sequence of data going towards the network.
- cont
the data
- def sendResponseRight(cont: PlanetSidePacketContainer): Unit
Decoded packet going towards the simulation.
Decoded packet going towards the simulation.
- cont
the packet
- final def sender(): ActorRef
- Definition Classes
- Actor
- def supervisorStrategy: SupervisorStrategy
- Definition Classes
- Actor
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def unhandled(message: Any): Unit
- Definition Classes
- Actor
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()