DDraceNetwork Docs
protocol.h
Go to the documentation of this file.
1/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
2/* If you are missing that file, acquire a complete release at teeworlds.com. */
3#ifndef ENGINE_SHARED_PROTOCOL_H
4#define ENGINE_SHARED_PROTOCOL_H
5
6#include <bitset>
8
9/*
10 Connection diagram - How the initialization works.
11
12 Client -> INFO -> Server
13 Contains version info, name, and some other info.
14
15 Client <- MAP <- Server
16 Contains current map.
17
18 Client -> READY -> Server
19 The client has loaded the map and is ready to go,
20 but the mod needs to send it's information as well.
21 modc_connected is called on the client and
22 mods_connected is called on the server.
23 The client should call client_entergame when the
24 mod has done it's initialization.
25
26 Client -> ENTERGAME -> Server
27 Tells the server to start sending snapshots.
28 client_entergame and server_client_enter is called.
29*/
30
31enum
32{
34
35 // the first thing sent by the client
36 // contains the version info for the client
38
39 // sent by server
40 NETMSG_MAP_CHANGE, // sent when client should switch map
41 NETMSG_MAP_DATA, // map transfer, contains a chunk of the map file
42 NETMSG_CON_READY, // connection is ready, client should send start info
43 NETMSG_SNAP, // normal snapshot, multiple parts
44 NETMSG_SNAPEMPTY, // empty snapshot
47 NETMSG_INPUTTIMING, // reports how off the input was
48 NETMSG_RCON_AUTH_STATUS, // result of the authentication
49 NETMSG_RCON_LINE, // line that should be printed to the remote console
50
53
54 // sent by client
57 NETMSG_INPUT, // contains the inputdata from the client
61
64
65 // sent by both
69
70 // sent by server (todo: move it up)
73
75};
76
77// this should be revised
78enum
79{
85
92 MAX_TICK = 0x6FFFFFFF,
93
96
100
101 // message packing
106 MSGFLAG_NOSEND = 16
108
109enum
110{
130};
131
132typedef std::bitset<MAX_CLIENTS> CClientMask;
133
134#endif
@ VERSION_DDRACE
Definition: protocol.h:113
@ VERSION_DDNET_GAMETICK
Definition: protocol.h:120
@ VERSION_DDNET_WEAPON_SHIELDS
Definition: protocol.h:125
@ VERSION_DDNET_GOODHOOK
Definition: protocol.h:116
@ VERSION_DDNET_UPDATER_FIXED
Definition: protocol.h:119
@ VERSION_NONE
Definition: protocol.h:111
@ VERSION_VANILLA
Definition: protocol.h:112
@ VERSION_DDNET_INDEPENDENT_SPECTATORS_TEAM
Definition: protocol.h:124
@ VERSION_DDNET_REDIRECT
Definition: protocol.h:129
@ VERSION_DDNET_WHISPER
Definition: protocol.h:115
@ VERSION_DDNET_ENTITY_NETOBJS
Definition: protocol.h:128
@ VERSION_DDNET_MULTI_LASER
Definition: protocol.h:127
@ VERSION_DDNET_ANTIPING_PROJECTILE
Definition: protocol.h:118
@ VERSION_DDNET_EARLY_VERSION
Definition: protocol.h:121
@ VERSION_DDNET_MSG_LEGACY
Definition: protocol.h:122
@ VERSION_DDNET_SWITCH
Definition: protocol.h:123
@ VERSION_DDNET_NEW_HUD
Definition: protocol.h:126
@ VERSION_DDNET_OLD
Definition: protocol.h:114
@ VERSION_DDNET_RCONPROTECT
Definition: protocol.h:117
std::bitset< MAX_CLIENTS > CClientMask
Definition: protocol.h:132
@ MAX_SERVER_ADDRESSES
Definition: protocol.h:86
@ MAX_TICK
Definition: protocol.h:92
@ SERVERINFO_LEVEL_MIN
Definition: protocol.h:83
@ SERVER_FLAG_TIMESCORE
Definition: protocol.h:82
@ SERVER_TICK_SPEED
Definition: protocol.h:80
@ MIN_TICK
Definition: protocol.h:91
@ SERVERINFO_LEVEL_MAX
Definition: protocol.h:84
@ MAX_CLAN_LENGTH
Definition: protocol.h:98
@ MSGFLAG_FLUSH
Definition: protocol.h:103
@ MAX_CHECKPOINTS
Definition: protocol.h:90
@ MSGFLAG_NORECORD
Definition: protocol.h:104
@ MAX_INPUT_SIZE
Definition: protocol.h:94
@ SERVERINFO_MAX_CLIENTS
Definition: protocol.h:87
@ MAX_CLIENTS
Definition: protocol.h:88
@ SERVER_FLAG_PASSWORD
Definition: protocol.h:81
@ MAX_SNAPSHOT_PACKSIZE
Definition: protocol.h:95
@ VANILLA_MAX_CLIENTS
Definition: protocol.h:89
@ MSGFLAG_RECORD
Definition: protocol.h:105
@ MSGFLAG_NOSEND
Definition: protocol.h:106
@ MAX_SKIN_LENGTH
Definition: protocol.h:99
@ MAX_NAME_LENGTH
Definition: protocol.h:97
@ MSGFLAG_VITAL
Definition: protocol.h:102
@ NETMSG_ENTERGAME
Definition: protocol.h:56
@ NETMSG_PING
Definition: protocol.h:66
@ NETMSG_RCON_CMD
Definition: protocol.h:58
@ NETMSG_CON_READY
Definition: protocol.h:42
@ NETMSG_RCON_CMD_ADD
Definition: protocol.h:71
@ NETMSG_MAP_CHANGE
Definition: protocol.h:40
@ NETMSG_UNUSED5
Definition: protocol.h:68
@ NETMSG_REQUEST_MAP_DATA
Definition: protocol.h:60
@ NETMSG_RCON_AUTH_STATUS
Definition: protocol.h:48
@ NETMSG_RCON_CMD_REM
Definition: protocol.h:72
@ NETMSG_INFO
Definition: protocol.h:37
@ NETMSG_SNAPSMALL
Definition: protocol.h:46
@ NETMSG_EX
Definition: protocol.h:33
@ NETMSG_READY
Definition: protocol.h:55
@ NETMSG_UNUSED4
Definition: protocol.h:63
@ NETMSG_SNAPSINGLE
Definition: protocol.h:45
@ NETMSG_SNAPEMPTY
Definition: protocol.h:44
@ NETMSG_RCON_AUTH
Definition: protocol.h:59
@ NETMSG_RCON_LINE
Definition: protocol.h:49
@ NETMSG_UNUSED1
Definition: protocol.h:51
@ NETMSG_SNAP
Definition: protocol.h:43
@ NETMSG_MAP_DATA
Definition: protocol.h:41
@ NUM_NETMSGS
Definition: protocol.h:74
@ NETMSG_UNUSED2
Definition: protocol.h:52
@ NETMSG_INPUTTIMING
Definition: protocol.h:47
@ NETMSG_PING_REPLY
Definition: protocol.h:67
@ NETMSG_INPUT
Definition: protocol.h:57
@ NETMSG_UNUSED3
Definition: protocol.h:62