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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
|
=========
DESCRIPTION
This repository contains the source code which was written by Darkelarious to
soften the effects of GameSpy (GameSpy Industries, Inc.) shutting down their
services. Among this service was a so-called "masterserver".
A masterserver is a program that maintains a list of online game servers and
presents this list to clients (gamers, players) who request the list of game
addresses. The 333networks Masterserver is a software framework that allows
gamers/players to browse for online games in the same manner as GameSpy
provided this service.
More information about the masterserver and variations on the protocol by
333networks can be found online at
http://333networks.com/masterserver
http://wiki.333networks.com/index.php/MasterServer
AUTHOR
Darkelarious
http://333networks.com
darkelarious@333networks.com
REQUIREMENTS
- Postgresql, MySQL or SQLite3
- Perl 5.10 or above
- The following CPAN modules:
DBI
DBD::Pg / DBD::SQLite / DBD::mysql
AnyEvent
AnyEvent::Handle::UDP
IP::Country::Fast
- screen (or another terminal multiplexer, optional)
INSTALL
THE MASTER SERVER IS WRITTEN ON LINUX. IF YOU WANT TO RUN THE SOFTWARE IN
MICROSOFT WINDOWS OR APPLE OSX, IT MAY NOT WORK WITHOUT MODIFICATIONS.
This repository consists of Perl modules and is run in terminal. The software
utilizes UDP and TCP connections to receive and send information about game
servers. Carefully read through the code and documentation before you start
randomly querying other game servers and/or masterservers.
The masterserver stores server addresses in the database. This database must
be created manually. SQLite3 users should not forget to chmod the database
file with read/write access. The tables to be created can be found in the
"data/database" folder in the tables-Pg/SQLite/mysql.sql file. Choose your
prefered database driver and created the tables as described below.
CONFIGURATION
The 333networks masterserver comes with options. These options are found in
configuration file "data/masterserver-config.pl". Comments in this file give
a brief description. Below, the configuration is discussed in further detail.
Masterserver HOST information
Fill in your contact details here to be able to synchronize with other
masterservers. Though the synchronization process also works without your
contact details, it is preferred and appreciated if you allow other
masterservers to synchronize with you too. In addition, third parties may
want to retrieve the status of your masterserver. When remote servers query
for your contact information, they can see who hosts this masterserver, which
build you are running and which games you currently support. This is highly
recommended and much appreciated.
Database login information
The masterserver supports different database types. In the module
"lib/MasterServer/Databases" you can see which types are currently supporting
out of the box. To choose a database type, specify the "dblogin" variable:
# Postgresql
dblogin => ['dbi:Pg:dbname=databasename', 'user', 'password'],
# SQLite
dblogin => ["dbi:SQLite:dbname=$ROOT/data/databasename.db",'',''],
# MySQL
dblogin => ["dbi:mysql:database=databasename;host=localhost;port=3306",
'user','password'],
Keep in mind that the database needs to be created manually. That means that
you first have to create your postgres/mysql user and grant permissions as
described in the proprietary manuals that come with your database
installation. After that, you have to insert the tables manually, which are
provided in the "data/database" folder. The masterserver script requires
read-and-write permissions on the SQLite database file.
Logging
All events are logged by default. Every new beacon, database transaction or
serverlist request is recorded in the logfile. For debugging purposes, this is
very useful, but for regular use, the logfile will grow big very fast. With
the "suppress" option, log messages can be suppressed from being logged. This
option takes the message type, separated by spaces. To suppress a message
type, use the identifier between brackets. Example:
[2015-05-19 17:31:47] [load] > Connected to the Postgres database.
In this message, the timestamp of the message is shown first, followed by the
identifier "Success". To suppress this type of message, the following
parameter can be set:
suppress => " load "
suppress => " load beacon secure hostname "
More message types can be suppressed, where the types are separated by spaces
as shown in the second example. If you want to log a lot of events, you could
consider rotating the logs every day, week, month or year. The 'log_rotate'
allows you to store events in different files with specified interval.
Network settings
The masterserver uses UDP and TCP networking. The default port numbers are
27900 for server beacons (UDP) and 28900 for serverlists (TCP). Home-hosters
have to open those firewall ports.
Not all games request data in the same format. Until we established how the
request for a different datatype are made, we also provide the ability to
send data in the alternate (byte) form manually. More games can be added,
separated by spaces.
Supported Games & Secure/Validate
All GameSpy protocol games communicate according to a protocol that requires
servers and clients to authenticate each other. As far as 333networks are
concerned, the authentication ciphers (keys) are confidential and intellectual
property of the individual game companies.
If you have a configuration file with keys, you can simply import this list
at the bottom of the configuration file as shown there. If you do not have the
correct ciphers, you can choose to bypass the secure/validate challenge. This
also allows hackers and opportunists to provide fake data or request the data
without authorization. See option "require_secure_beacons".
If you use the proper authentication ciphers, keep in mind that some games,
like Deus Ex, have more than one cipher, or do not support the challenge at
all. Other games may have been modified to counter the vulnerability against
long queries. Some UT server have been observed to respond with "Orange"
instead of the correct response. Both situations can be in- or excluded in
the "ignore_key" options.
Enable settings
There are three methods to add server addresses to the list: by receiving a
direct beacon, by validating a pending server and by synchronization. Some of
these functions can be disabled from the configuration.
Direct beacons can be processed by adding them to the database directly after
they validated. When validation is not an option (because missing ciphers),
the masterserver can query the addresses individually, to determine whether
they are valid game servers. Change with "beacon_checker_enabled".
Query UCC Applets
In addition, other UCC masterserver applets can be queried for more server
addresses. This should not be done without permission of the UCC applet
hosts, it's impolite to do so without asking. The new servers are added to
the "pending" list, where they wait to be queried individually as described
above. If "beacon_checker_enabled" is disabled, this function will NOT work
properly. Enable/Disable with "master_applet_enabled".
Synchronization settings
Synchronization between masterservers allows you to receive the list from
other masterservers. In return and to make this communication two-way, the
masterserver sends uplinks to all other masterservers that are specified in
your list. Your masterserver is then queried in the same way as if it were an
ordinary game server. This also shares the information that you provided
earlier in the HOST information section. If you do not wish this to happen,
you should disable synchronization entirely.
Newly received servers are added to the "pending" list as described above.
Change with "sync_enabled". Please note that this will not prevent others
from obtaining the server lists. Attempting to disable this is hypocrite and
ambiguous, as "regular" clients do the same to get the serverlist.
RUNNING
After all CPAN modules have been installed and all options have been reviewed
in the configuration file, the masterserver can be started with the following
command from within the root directory of this folder:
screen -dmS "masterserver" ./util/masterserver.pl
You can also choose to run the masterserver with ./util/masterserver without
the use of a terminal multiplexer, for example for debugging purposes or a
dry-run to test if your settings are properly configured.
The masterserver works great in combination with one of the MasterServer
Interface websites. This allows you to keep an eye on your masterserver and
allows others to view directly which games you support, how many servers are
available and more.
The provided configuration is optimized for generic use. Keep in mind that the
masterserver in this form was originally designed for use with other
333networks functions. If you want to set up your own system for any
game other than Unreal Tournament, you may want to look at other repositories
on 333networks HOW this is achieved. See also http://git.333networks.com
333networks is not responsible for your masterserver querying (or spamming)
game servers and/or masterservers. Your configuration is YOUR responsibility!
TOOLS
In the "util/tools" folder, a few handy tools are included. In general, it is
not necessary to use these tools. While debugging and writing new features for
the masterserver, these scripts have been very handy. Therefore, they are
included in the repository. Poor documentation is included in the scripts and
required files themselves.
KNOWN ISSUES
There are a few known issues that will be resolved in future versions. The
following issues are listed and do not need to be reported.
Only Postgresql works. When any other database type is selected, the script
either crashes, generates a lot of errors or does not process any game
servers. This is the result of attempting to unify the database type functions
that failed. Sadly, many of the reference functions and time functions are not
compatible with each other. An update where this is fixed will follow.
Slow database: currently, database requests are blocking. On slow hardware,
these requests may take enough time to miss/deny incoming beacons and list
requests. No solution available in this version. Proposed solution: AnyEvent's
asynchronous database driver(s). The current configuration for 333networks and
affiliated servers do not suffer from this problem.
No servers found after syncing with 333networks or others: the syncing
protocol also requires authentication. We do not want authorized people mass-
spamming our masterservers with sync request to determine whether the server
is online (yes, this actually happens -- use the \about\ query for that!) or
to keep the list unnecessary updated. Sync requests should not be executed
more than 1-2 times per hour!
If you want to sync with us, please email 333networks on info@333networks.com
COPYING
Copyright (c) 2005-2016 Darkelarious & 333networks.com
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
All Unreal Tournament related materials are based on Epic Games' Unreal
Tournament. UNREAL (c)1999 Epic Megagames, Inc. All Rights Reserved.
Distributed by GT Interactive Software, Inc. under license. UNREAL and the
UNREAL logo are registered trademarks of Epic Megagames, Inc.
|