Packages

object MiddlewareActor

MiddlewareActor sits between the raw UDP socket and the "main" actors (either LoginActor or SessionActor) and handles crypto and control packets. The former side is called the outbound network (the clients); the former is called the inbound local (server). This service sets up cryptography, it decodes incoming packets, it encodes, bundles, or splits outgoing packets, and it handles things like requesting/resending lost packets. Accurate operation of the service is mostly a product of the network being agreeable and allowing packets to arrive correctly. Various subroutines are used to keep track of the predicted offending packets.

The cryptographic aspect of the service resolves itself first, exchanging keys and passcodes and challenges between local and the network. Most of this process occurs without any prior cryptographic setup, relying on the validation of its own exchange to operate. Afterwards its completion, all raw data arriving from the network or leaving to the network will require a cipher based on the previously exchanged data.
As packets arrive from local with the intention of being sent out towards the network terminus, they will be pooled into a buffer. Periodically, the buffer contents will be evaluated, and packet data of enough quantity and combined length will be assembled into a singular packet bundle. This bundle will be queued and dispatched towards the network. If the outbound packets do not arrive at the network terminus correctly, the network has a method of dispatching requests for identified missing packets. This side of the communication will keep track of its previously dispatched packets for a "reasonable" amount of time and will respond to those requests if possible by searching its catalog.

If the inbound packets do not arrive correctly the first time, after a while, requests for identified missing packets from the network source will occur. Virtually all important packets have a sequence number that bestows on each packet an absolute delivery order. Bundled packets have a subslot number that indicates the total number of subslot packets dispatched to this client as well as the order in which the packets should have been received. If a packet is out of sequence - a future packet, compared to what is being expected - it is buffered. Should the expected packets show up out of order before the buffered is cleared, everything sorts itself out. Unresolved missing sequence entries will often lead to requests for missing packets with anticipated subslots. If these requests do not resolve, there is unfortunately not much that can be done except grin and bear with it.

Source
MiddlewareActor.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. MiddlewareActor
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. final case class Close() extends Command with Product with Serializable

    Close connection

  2. sealed trait Command extends AnyRef
  3. final case class Raw(msg: BitVector, exclusive: Boolean) extends Command with Product with Serializable

    Send outgoing packet as its hexadecimal directly

  4. final case class Receive(msg: ByteVector) extends Command with Product with Serializable

    Receive incoming packet

  5. final case class Send(msg: PlanetSidePacket) extends Command with Product with Serializable

    Send outgoing packet

  6. final case class Teardown() extends Command with Product with Serializable

    Teardown connection

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. final val MTU: Int

    Maximum packet size in bytes

  5. def apply(socket: ActorRef[akka.io.Udp.Command], sender: InetSocketAddress, next: (ActorRef[Command], InetSocketAddress, String) => Behavior[PlanetSidePacket], connectionId: String): Behavior[Command]
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  11. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  12. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  13. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  14. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  16. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  17. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  18. def toString(): String
    Definition Classes
    AnyRef → Any
  19. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  20. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  21. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  22. object Raw extends Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped