DDraceNetwork Documentation
Loading...
Searching...
No Matches
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
7
8#include <bitset>
9
10/*
11 Connection diagram - How the initialization works.
12
13 Client -> INFO -> Server
14 Contains version info, name, and some other info.
15
16 Client <- MAP <- Server
17 Contains current map.
18
19 Client -> READY -> Server
20 The client has loaded the map and is ready to go,
21 but the mod needs to send it's information as well.
22 modc_connected is called on the client and
23 mods_connected is called on the server.
24 The client should call client_entergame when the
25 mod has done it's initialization.
26
27 Client -> ENTERGAME -> Server
28 Tells the server to start sending snapshots.
29 client_entergame and server_client_enter is called.
30*/
31
32enum
33{
35
36 // the first thing sent by the client
37 // contains the version info for the client
39
40 // sent by server
41 NETMSG_MAP_CHANGE, // sent when client should switch map
42 NETMSG_MAP_DATA, // map transfer, contains a chunk of the map file
43 NETMSG_CON_READY, // connection is ready, client should send start info
44 NETMSG_SNAP, // normal snapshot, multiple parts
45 NETMSG_SNAPEMPTY, // empty snapshot
48 NETMSG_INPUTTIMING, // reports how off the input was
49 NETMSG_RCON_AUTH_STATUS, // result of the authentication
50 NETMSG_RCON_LINE, // line that should be printed to the remote console
51
54
55 // sent by client
58 NETMSG_INPUT, // contains the inputdata from the client
62
65
66 // sent by both
70
71 // sent by server (todo: move it up)
74
76};
77
78// this should be revised
79enum
80{
86
94 MAX_TICK = 0x6FFFFFFF,
95
98
102
103 // message packing
124};
125
126enum
127{
151};
152
153namespace TuneZone
154{
155 inline constexpr int OVERRIDE_NONE = -1;
156 inline constexpr int NUM = 256;
157};
158
159namespace FinishTime
160{
161 inline constexpr int NOT_FINISHED_TIMESCORE = -9999;
162 inline constexpr int NOT_FINISHED_MILLIS = -1;
163 inline constexpr int UNSET = -2;
164}
165
166typedef std::bitset<MAX_CLIENTS> CClientMask;
167
168#endif
std::bitset< MAX_CLIENTS > CClientMask
Definition protocol.h:166
@ NETMSG_ENTERGAME
Definition protocol.h:57
@ NETMSG_PING
Definition protocol.h:67
@ NETMSG_RCON_CMD
Definition protocol.h:59
@ NETMSG_CON_READY
Definition protocol.h:43
@ NETMSG_RCON_CMD_ADD
Definition protocol.h:72
@ NETMSG_MAP_CHANGE
Definition protocol.h:41
@ NETMSG_UNUSED5
Definition protocol.h:69
@ NETMSG_REQUEST_MAP_DATA
Definition protocol.h:61
@ NETMSG_RCON_AUTH_STATUS
Definition protocol.h:49
@ NETMSG_RCON_CMD_REM
Definition protocol.h:73
@ NETMSG_INFO
Definition protocol.h:38
@ NETMSG_SNAPSMALL
Definition protocol.h:47
@ NETMSG_EX
Definition protocol.h:34
@ NETMSG_READY
Definition protocol.h:56
@ NETMSG_UNUSED4
Definition protocol.h:64
@ NETMSG_SNAPSINGLE
Definition protocol.h:46
@ NETMSG_SNAPEMPTY
Definition protocol.h:45
@ NETMSG_RCON_AUTH
Definition protocol.h:60
@ NETMSG_RCON_LINE
Definition protocol.h:50
@ NETMSG_UNUSED1
Definition protocol.h:52
@ NETMSG_SNAP
Definition protocol.h:44
@ NETMSG_MAP_DATA
Definition protocol.h:42
@ NUM_NETMSGS
Definition protocol.h:75
@ NETMSG_UNUSED2
Definition protocol.h:53
@ NETMSG_INPUTTIMING
Definition protocol.h:48
@ NETMSG_PING_REPLY
Definition protocol.h:68
@ NETMSG_INPUT
Definition protocol.h:58
@ NETMSG_UNUSED3
Definition protocol.h:63
@ MAX_SERVER_ADDRESSES
Definition protocol.h:87
@ MAX_TICK
Definition protocol.h:94
@ SERVERINFO_LEVEL_MIN
Definition protocol.h:84
@ SERVER_FLAG_TIMESCORE
Definition protocol.h:83
@ SERVER_TICK_SPEED
Definition protocol.h:81
@ MIN_TICK
Definition protocol.h:93
@ SERVERINFO_LEVEL_MAX
Definition protocol.h:85
@ MAX_CLAN_LENGTH
Definition protocol.h:100
@ MSGFLAG_FLUSH
Definition protocol.h:111
@ MAX_CHECKPOINTS
Definition protocol.h:92
@ MSGFLAG_NORECORD
Definition protocol.h:115
@ MAX_INPUT_SIZE
Definition protocol.h:96
@ SERVER_MAX_CLIENTS
Definition protocol.h:91
@ SERVERINFO_MAX_CLIENTS
Definition protocol.h:88
@ MAX_CLIENTS
Definition protocol.h:89
@ SERVER_FLAG_PASSWORD
Definition protocol.h:82
@ MAX_SNAPSHOT_PACKSIZE
Definition protocol.h:97
@ VANILLA_MAX_CLIENTS
Definition protocol.h:90
@ MSGFLAG_RECORD
Definition protocol.h:119
@ MSGFLAG_NOSEND
Definition protocol.h:123
@ MAX_SKIN_LENGTH
Definition protocol.h:101
@ MAX_NAME_LENGTH
Definition protocol.h:99
@ MSGFLAG_VITAL
Definition protocol.h:107
@ VERSION_DDRACE
Definition protocol.h:130
@ VERSION_DDNET_GAMETICK
Definition protocol.h:135
@ VERSION_DDNET_WEAPON_SHIELDS
Definition protocol.h:139
@ VERSION_DDNET_MAP_BESTTIME
Definition protocol.h:150
@ VERSION_DDNET_128_PLAYERS
Definition protocol.h:146
@ VERSION_DDNET_UPDATER_FIXED
Definition protocol.h:134
@ VERSION_NONE
Definition protocol.h:128
@ VERSION_VANILLA
Definition protocol.h:129
@ VERSION_DDNET_INDEPENDENT_SPECTATORS_TEAM
Definition protocol.h:138
@ VERSION_DDNET_REDIRECT
Definition protocol.h:143
@ VERSION_DDNET_IMPORTANT_ALERT
Definition protocol.h:149
@ VERSION_DDNET_WHISPER
Definition protocol.h:132
@ VERSION_DDNET_ENTITY_NETOBJS
Definition protocol.h:142
@ VERSION_DDNET_MULTI_LASER
Definition protocol.h:141
@ VERSION_DDNET_PREINPUT
Definition protocol.h:147
@ VERSION_DDNET_SAVE_CODE
Definition protocol.h:148
@ VERSION_DDNET_PLAYERFLAG_SPEC_CAM
Definition protocol.h:144
@ VERSION_DDNET_ANTIPING_PROJECTILE
Definition protocol.h:133
@ VERSION_DDNET_EARLY_VERSION
Definition protocol.h:136
@ VERSION_DDNET_MSG_LEGACY
Definition protocol.h:137
@ VERSION_DDNET_NEW_HUD
Definition protocol.h:140
@ VERSION_DDNET_OLD
Definition protocol.h:131
@ VERSION_DDNET_RECONNECT
Definition protocol.h:145
Definition protocol.h:160
constexpr int UNSET
Definition protocol.h:163
constexpr int NOT_FINISHED_MILLIS
Definition protocol.h:162
constexpr int NOT_FINISHED_TIMESCORE
Definition protocol.h:161
Definition protocol.h:154
constexpr int NUM
Definition protocol.h:156
constexpr int OVERRIDE_NONE
Definition protocol.h:155