A packet map object which can be used to resolve incoming and outgoing packet types.
The socket this packet interface is attached to.
The last packet which was received.
The last packet which was sent.
Attaches this Packet IO to the socket
.
The socket to attach to.
Attempts to create a packet from the data contained in the reader buffer. No packet will be created if there is no event listener for the packet type.
Detaches this Packet IO from its Socket
.
Takes packets from the outgoing queue and writes them to the socket.
Emits an 'error'
event if there are any listeners for it,
or throws the error if there are no listeners.
The error to emit.
Emits a packet from this PacketIO instance. This will only emit the packet to the clients subscribed to this particular PacketIO.
The packet to emit.
Adds the data received from the socket to the reader buffer.
The data received.
Resets the incoming packet buffer so that it is ready to receive the next packet header.
Resets the reader buffer and the RC4 instances.
Sends a packet.
The packet to send.
Generated using TypeDoc
A utility class which implements the RotMG messaging protocol on top of a
Socket
.