Library net

Net message library. Used for sending data from the server to the client and back

Functions

bytesWritten () Gets the amount of bytes written so far
canSend () Checks whether you can currently send a net message
readBit () Reads a bit from the net message
readDouble () Reads a double from the net message
readFloat () Reads a float from the net message
readInt (n) Reads an integer from the net message
readString () Reads a string from the net message
readTable () Reads a table from the net message
readUInt (n) Reads an unsigned integer from the net message
send (target) Send a net message from client->server, or server->client.
start (name) Starts the net message
writeBit (t) Writes a bit to the net message
writeDouble (t) Writes a double to the net message
writeFloat (t) Writes a float to the net message
writeInt (t, n) Writes an integer to the net message
writeString (t) Writes a string to the net message
writeTable (t) Writes a table to the net message
writeUInt (t, n) Writes an unsigned integer to the net message


Functions

net_library.bytesWritten ()
Gets the amount of bytes written so far

Return value:

    The amount of bytes written so far
net_library.canSend ()
Checks whether you can currently send a net message

Return value:

    A boolean that states whether or not you can currently send a net message
net_library.readBit ()
Reads a bit from the net message

Return value:

    The bit that was read. (0 for false, 1 for true)
net_library.readDouble ()
Reads a double from the net message

Return value:

    The double that was read
net_library.readFloat ()
Reads a float from the net message

Return value:

    The float that was read
net_library.readInt (n)
Reads an integer from the net message

Parameters:

  • n: The amount of bits to read

Return value:

    The integer that was read
net_library.readString ()
Reads a string from the net message

Return value:

    The string that was read
net_library.readTable ()
Reads a table from the net message

Return value:

    The table that was read
net_library.readUInt (n)
Reads an unsigned integer from the net message

Parameters:

  • n: The amount of bits to read

Return value:

    The unsigned integer that was read
net_library.send (target)
Send a net message from client->server, or server->client.

Parameters:

  • target: Optional target location to send the net message.
net_library.start (name)
Starts the net message

Parameters:

  • name: The message name
net_library.writeBit (t)
Writes a bit to the net message

Parameters:

  • t: The bit to be written. (boolean)
net_library.writeDouble (t)
Writes a double to the net message

Parameters:

  • t: The double to be written
net_library.writeFloat (t)
Writes a float to the net message

Parameters:

  • t: The float to be written
net_library.writeInt (t, n)
Writes an integer to the net message

Parameters:

  • t: The integer to be written
  • n: The amount of bits the integer consists of
net_library.writeString (t)
Writes a string to the net message

Parameters:

  • t: The string to be written
net_library.writeTable (t)
Writes a table to the net message

Parameters:

  • t: The table to be written. This will be checked for blacklisted types. eg VMatrix.
net_library.writeUInt (t, n)
Writes an unsigned integer to the net message

Parameters:

  • t: The integer to be written
  • n: The amount of bits the integer consists of. Should not be greater than 32

Valid XHTML 1.0!