Creates a new CommOut instance
The size of the buffer to create, in bytes. Defaults to 16384, which should be large enough for any single packet
Packs a double precision floating point value into the buffer as a 32-bit integer where 1048576 units equal 1
A number with a fractional part, depending on the desired precision
Packs a floating point value into the buffer as a 16-bit integer where 256 units equal 1
A number with a fractional part, depending on the desired precision
Packs an unsigned 8-bit integer into the buffer
A number from 0 to 255
Packs a signed 24-bit integer into the buffer
A number from -8388608 to 8388607
Packs an unsigned 24-bit integer into the buffer
A number from 0 to 16777215
Packs a signed 8-bit integer into the buffer
A number from -128 to 127
Packs a string into the buffer, prefixed with an unsigned 16-bit integer representing the length of the string in characters (not bytes)
The string to pack. If not a string, it will be converted to an empty string. If longer than 65535 characters, it will be truncated
Packs a radian value into the buffer as a signed 16-bit integer where 8192 units equal 360 degrees
A number from -Math.PI to Math.PI
Packs a radian value into the buffer as a signed 24-bit integer where 2097152 units equal 360 degrees
A number from -Math.PI to Math.PI
Packs a string into the buffer, prefixed with an unsigned 8-bit integer representing the length of the string in characters (not bytes)
The string to pack. If not a string, it will be converted to an empty string. If longer than 255 characters, it will be truncated
Sends the packed data to the server through the given WebSocket or WebSocket-like object with a send method
A WebSocket or any object with a send method that accepts a Uint8Array or ArrayBuffer
Allows you to send data to the game server