2007-11-25 19:42:40 +00:00
|
|
|
/* copyright (c) 2007 magnus auvinen, see licence.txt for more info */
|
2007-12-15 10:24:49 +00:00
|
|
|
#include "e_system.h"
|
2007-08-22 07:52:33 +00:00
|
|
|
|
2007-11-04 00:19:41 +00:00
|
|
|
/*
|
|
|
|
Connection diagram - How the initilization works.
|
|
|
|
|
|
|
|
Client -> INFO -> Server
|
|
|
|
Contains version info, name, and some other info.
|
|
|
|
|
|
|
|
Client <- MAP <- Server
|
|
|
|
Contains current map.
|
|
|
|
|
|
|
|
Client -> READY -> Server
|
|
|
|
The client has loaded the map and is ready to go,
|
|
|
|
but the mod needs to send it's information aswell.
|
|
|
|
modc_connected is called on the client and
|
|
|
|
mods_connected is called on the server.
|
|
|
|
The client should call client_entergame when the
|
|
|
|
mod has done it's initilization.
|
|
|
|
|
|
|
|
Client -> ENTERGAME -> Server
|
|
|
|
Tells the server to start sending snapshots.
|
|
|
|
client_entergame and server_client_enter is called.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2007-08-22 07:52:33 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
NETMSG_NULL=0,
|
|
|
|
|
|
|
|
/* the first thing sent by the client
|
|
|
|
contains the version info for the client */
|
|
|
|
NETMSG_INFO=1,
|
|
|
|
|
|
|
|
/* sent by server */
|
2008-03-01 14:36:36 +00:00
|
|
|
NETMSG_MAP_CHANGE, /* sent when client should switch map */
|
|
|
|
NETMSG_MAP_DATA, /* map transfer, contains a chunk of the map file */
|
|
|
|
NETMSG_SNAP, /* normal snapshot, multiple parts */
|
|
|
|
NETMSG_SNAPEMPTY, /* empty snapshot */
|
|
|
|
NETMSG_SNAPSINGLE, /* ? */
|
|
|
|
NETMSG_SNAPSMALL, /* */
|
|
|
|
NETMSG_RCON_AUTH_STATUS,/* result of the authentication */
|
|
|
|
NETMSG_RCON_LINE, /* line that should be printed to the remote console */
|
2007-08-22 07:52:33 +00:00
|
|
|
|
|
|
|
/* sent by client */
|
2008-03-01 14:36:36 +00:00
|
|
|
NETMSG_READY, /* */
|
2007-08-22 07:52:33 +00:00
|
|
|
NETMSG_ENTERGAME,
|
2008-03-01 14:36:36 +00:00
|
|
|
NETMSG_INPUT, /* contains the inputdata from the client */
|
|
|
|
NETMSG_RCON_CMD, /* */
|
|
|
|
NETMSG_RCON_AUTH, /* */
|
|
|
|
NETMSG_REQUEST_MAP_DATA,/* */
|
2007-08-22 07:52:33 +00:00
|
|
|
|
|
|
|
/* sent by both */
|
2008-02-10 15:32:30 +00:00
|
|
|
NETMSG_PING,
|
|
|
|
NETMSG_PING_REPLY,
|
2007-10-06 17:01:06 +00:00
|
|
|
NETMSG_ERROR
|
2007-08-22 07:52:33 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/* this should be revised */
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
MAX_NAME_LENGTH=32,
|
|
|
|
MAX_CLANNAME_LENGTH=32,
|
|
|
|
MAX_INPUT_SIZE=128,
|
2007-10-28 11:30:25 +00:00
|
|
|
MAX_SNAPSHOT_PACKSIZE=900
|
2007-08-22 07:52:33 +00:00
|
|
|
};
|