-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtechinfo.txt
More file actions
226 lines (144 loc) · 8 KB
/
techinfo.txt
File metadata and controls
226 lines (144 loc) · 8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
efmaster, an open master server
-------------------------------
Technical information
---------------------
1) COMPILING EFMASTER
2) PROTOCOL
3) BEHAVIOUR
1) COMPILING EFMASTER:
Dpmaster is known to compile successfully on GCC, MinGW (GCC for Windows), and
Microsoft Visual Studio 8. You can also cross-compile it to Windows using MinGW.
Here are the commands you will have to run, depending on your system.
1) Building on a UNIX system (Linux, BSDs, and Mac OS X):
- For building release binaries:
make release
- For building debug binaries:
make debug
- For cleaning the files produced by a build:
make clean
2) Building on Windows using MinGW:
- Move stvoyhm.icon from your EF install or disc into your efmaster/src directory
- For building release binaries:
mingw32-make mingw-release
- For building debug binaries:
mingw32-make mingw-debug
- For cleaning the files produced by a build:
mingw32-make win-clean
3) Cross-compiling from UNIX to Windows using MinGW:
- Move stvoyhm.icon from EF disc into your efmaster/src directory
Here, you have to specify the compiler name by hand. In these examples,
my MinGW compiler is "i586-mingw32msvc-gcc".
- For building release binaries:
make mingw-release CC=i586-mingw32msvc-gcc
- For building debug binaries:
make mingw-debug CC=i586-mingw32msvc-gcc
- For cleaning the files produced by a build:
make clean
4) Building on Windows using Microsoft Visual Studio:
No command line here. Open the project by double-clicking on
"efmaster.sln". Choose the configuration you want, either "Debug" or
"Release". Then go to the "Build" menu and click on "Build solution".
You'll find the executable file in a newly created subdirectory, called
"Debug" or "Release", depending on the configuration you chose.
2) PROTOCOL:
efmaster uses the EF protocol that is based on Quake III Arena's master
server protocol. The reference document for this protocol can be found on id
Software anonymous FTP site:
ftp://ftp.idsoftware.com/idstuff/quake3/docs/server.txt
efmaster uses 5 types of messages. The 5 basic types are:
"heartbeat", "getinfo", "infoResponse", "getservers" and "getserversResponse".
The first 3 basic types are used by servers to authenticate and register
themselves to a master server. The remaining types are used by clients to
retrieve a list of servers from a master server. All messages start with 4 bytes
set to 0xFF (character 255), then the command type in plain text.
1) heartbeat:
- description:
The heartbeat is sent by a server when it wants to get noticed by a
master. A server should send an heartbeat each time it becomes empty
or full, or stop being empty or full, plus it should make sure the
master gets at least one heartbeat from it every 5 to 15 minutes, so
the master doesn't remove it from its list of active servers.
- sample:
"\xFF\xFF\xFF\\xFFheartbeat\\27960\\gamename\\STEF1"
- syntax:
"\xFF\xFF\xFF\\xFFheartbeat\\<port>\\gamename\\STEF1"
2) getinfo:
- description:
This message is sent by a master to a server, usually in response
to an "hearbeat" by this very server. It is used by the master to
trigger the sending of an "infoResponse" from the server. The
challenge string is necessary to authenticate the server's
corresponding "infoResponse".
- sample:
"\xFF\xFF\xFF\xFFgetinfo A_ch4Lleng3"
- syntax:
The message type is followed by a challenge string. All printable
characters but 5 are allowed in this string (from ASCII code 33 to
126). The 5 exceptions are characters '\', '/', ';', '"' and '%'.
3) infoResponse:
- description:
An "infoResponse" message is the reponse to a "getinfo" request.
It contains an infostring including the most important information
about the current server state.
- sample:
"\xFF\xFF\xFF\xFFinfoResponse "\\sv_maxclients\\8\\clients\\0\\..""
- syntax:
The message type is followed by a line feed character and the
server's infostring. An infostring is a series of keys and values
separated by '\'s. Popular keys include "hostname" (the host name),
and "mapname" (the map currently played on this server).
This infostring must contain the challenge string sent by the
master in the "getinfo" that triggered this response (key name:
"challenge"). "sv_maxclients" (the maximum number of clients
allowed on the server; must not be 0), "protocol" (the protocol
number) and "clients" (the current number of clients on the
server) must also be present.
4) getservers:
- description:
A "getservers" message is sent to a master by a client who wants
to get a list of servers. It triggers a "getserversReponse"
message from the master.
- samples:
"\xFF\xFF\xFF\xFFgetservers 66 empty full"
- syntax:
The message must contain a protocol version, and optionally "empty"
and/or "full" depending on whether or not the client also wants to
get empty or full servers.
5) getserversResponse:
- description:
A "getserversResponse" message contains a list of IPv4 servers
requested by a client.
- sample:
"\xFF\xFF\xFF\xFFgetserversResponse \[...]\EOT\0\0\0"
- syntax:
The list of servers is composed of IPv4 addresses and ports. Each
server is stored on 8 bytes for the IP address and 4 bytes for the
port number, and a '\' to separate it from the next server. All
numbers are big-endian oriented (most significant bytes first). For
instance, a server hosted at address 1.2.3.4 on port 2048 will be
sent as: "010203040800".
If the list is too big to fit into one single network packet,
efmaster will create as many getserversResponses as necessary to
send all the matching servers. The last message contains a fake
server at the end of the list, which is the 6-byte string
"EOT\0\0\0", to tell the client that the master has finished to send
the server list (EOT stands for "End Of Transmission").
3) BEHAVIOUR:
The way efmaster behaves when talking to clients and servers is largely based
on one important idea: authenticated "infoResponse" messages are the only
messages we can reasonably trust.
When efmaster receives an "heartbeat" message from a server, it will reply with
a "getinfo" and register this server for a couple of seconds. If it hasn't sent
back an "infoResponse" containing a valid challenge string by this time,
efmaster forgets it. Further "heartbeat" messages can't prolong this time,
and the server IP address won't be transmitted to any client during that period
of time.
When efmaster receives a valid "infoResponse" from a server, it associates a new
timeout value to it (15 min). Only another valid "infoResponse" from this very
server will be able to refresh this timeout value. Its IP address will be
transmitted to the appropriate clients, until it timeouts. Then, efmaster
forgets it.
You may have noticed that this behaviour doesn't take into account the fact
that some servers send 2 "heartbeat" messages when closing. I deliberately
choose to keep the behaviour as simple and predictable as possible, hopefully
making it free from any major abuse.