Provides functions to decode and encode strings into and from different encodings.
Singleton instance.
Singleton getter, enabling singleton pattern.
a singleton ProtocolParser instance.
Parse SENDALLPLAYER* packet types and generate PlayerInfos
The type of packet (what just happened)
Raw data from server we have to convert
How many players present (eg. how many PlayerInfos to generate)
an array of PlayerInfo instances
Assembles a string from given byte array.
raw byte data from server.
starting index from byte array message.
a fully assembled string.
Assembles an unsigned 8-bit integer array from a number type (float)
number type float to be converted.
a fully assembled unsigned 8-bit integer array.
Parse a chunk of byte stream received from the server. We'll use this in our gameloop to make things happen such as show where other players have moved or who has shot, etc.
Array of bytes sent from server.
a new Packet object containing the opcode and optional parameters.
Convert a packet to a binary array compatible with our protocl
The packet we want to send over to the server
Byte Array of protocol data to be sent to the server
Helper method to convert an unsigned 16-bit value from the byte stream to numbers.
raw byte data from server.
starting index from byte array message.
a converter number type value.
Assembles an BigInt (64 bit) number from a given byte array.
raw byte data from server.
starting index from byte array message.
a fully assembled BigInt (64 bit) number.
Assembles a float64 number from a given byte array.
raw byte data from server.
starting index from byte array message.
a fully assembled float number.
Generated using TypeDoc
Parses messages from the server and compiles messages to the server. This parser shall adhere to the latest definition of our network protocol found here:
Implemented as Singleton Pattern. See https://en.wikipedia.org/wiki/Singleton_pattern
https://github.zhaw.ch/raycasters/docs/wiki/Protocol#byte-stream