Network Messages - GoonHouse/Marin0SE GitHub Wiki
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,
},
}
- cmd
stringis the the command type that directly corresponds to the callback method used. - pl
tableis the payload of data to be used by the callback method. - fromclient
intis the clientid of the person sending the message, which references their position in theserver_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
connectthat provides the info necessary for a client to find its place relative to the server.- clientid
intis the id the client inserver_peerlist. - mappacks
tablethe names of all the mappacks the server has. - inflives
boolis whether or not lives will be limited. - sharingportals
boolis whether or not all players will share portals. - infinitetime
boolis whether or not time will be limited. - checkboxes
tableis a table of the server's checkbox values, consisting of key->value pairs.
- clientid
- rejected is an acknowledgement to the c-s message
connectthat provides the info necessary for a client to find its place relative to the server.- reason
stringis the reason the client was denied the ability to join.
- reason
- startgame is to tell everyone to load the level.
- numplayers
intis the total number of active players.
- numplayers
- synccoords tells a client to apply the listed properties to their local instance of a client.
- target
intthe server pid of the client to update, translated to a local pid.
- target
- synccontrol tells a client to apply the control to their local instance of a client.
- target
intthe server pid of the client to update, translated to a local pid. - control
stringthe control name to update. - direction
stringthe state of the control. Valid:pressorrelease.
- target
Client -> Server Messages
- connect is the message sent when a client is attempting to connect to the server.
- nick
stringthe name that a particular client has chosen for themselves. - mappacks
tablethe names of the maps the client has.
- nick
- coordsupdate broadcasts messages of synccoords 1:1 to clients.
- controlupdate broadcasts messages of synccontrol 1:1 to clients.