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
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 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
connect
that provides the info necessary for a client to find its place relative to the server.- clientid
int
is the id the client inserver_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.
- clientid
- 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.- reason
string
is the reason the client was denied the ability to join.
- reason
- startgame is to tell everyone to load the level.
- numplayers
int
is the total number of active players.
- numplayers
- synccoords tells a client to apply the listed properties to their local instance of a client.
- target
int
the 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
int
the server pid of the client to update, translated to a local pid. - control
string
the control name to update. - direction
string
the state of the control. Valid:press
orrelease
.
- target
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.
- nick
- coordsupdate broadcasts messages of synccoords 1:1 to clients.
- controlupdate broadcasts messages of synccontrol 1:1 to clients.