Skip to content

Network Messages

EntranceJew edited this page Oct 9, 2014 · 4 revisions

Notes

Attempting to normalize all instances of playerid (position in server_peerlist) and clientid (ID used by LUBE).

General Structure

{
  cmd="examplecommand",
  --string name of the command, directly corresponds to the callback method name.
  pl={--table payload of all the values to be used in the callback method
    item="hotdog",
    x=3,
    y=4,
  },
  fromclient=networkclientnumber,
  --int reference to the sender's index in server_peerlist
}
  • cmd string is the the command type that directly corresponds to the callback method used.
  • pl table is the payload of data to be used by the callback method.
  • fromclient int is the clientid of the person sending the message, which references their position in the server_peerlist. A clientid of 0 means that the client has not connected previously.

Server -> Client Messages

  • connected is an acknowledgement to the c-s message connect that provides the info necessary for a client to find its place relative to the server.
    • clientid int is the id the client in server_peerlist.
    • mappacks table the names of all the mappacks the server has.
    • inflives bool is whether or not lives will be limited.
    • sharingportals bool is whether or not all players will share portals.
    • infinitetime bool is whether or not time will be limited.
    • checkboxes table is a table of the server's checkbox values, consisting of key->value pairs.
  • rejected is an acknowledgement to the c-s message connect that provides the info necessary for a client to find its place relative to the server.
    • clientid int is the id the client in server_peerlist.

Client -> Server Messages

  • connect is the message sent when a client is attempting to connect to the server.
    • nick string the name that a particular client has chosen for themselves.
    • mappacks table the names of the maps the client has.
  • controlsupdate called whenever a player presses a button that is bound, the payload is their internal instance of TLbind.

Clone this wiki locally