2
How to set up an XPilot NG ranking server
3
-----------------------------------------
5
Written by kps at users.sourceforge.net.
7
The XPilot NG server contains a modified version of Marcus Sundberg's
9
[ Look for the original at http://www.stacken.kth.se/~mackan/xpilot/ ]
16
Start server, using options rankFileName and rankWebpageFileName, e.g.
18
xpilot-ng-server -rankFileName rank.txt -rankWebpageFileName rank.html
20
In this example ranking info will be stored in rank.txt and the webpage
21
in rank.html. You might want to put the webpage in some public html
22
directory so that players can have a look.
27
To set up a ranking server you should do the following, I assume you have
28
some Unix-like OS. Example commands are given in a way that should work in a
29
bash-compatible shell, the example commands start with a '$', or '#' if you
30
need to be the root user to execute the command. You may need to edit some
31
text files, I have used emacs in this tutorial, feel free to use some other
34
1. Install / make sure you have expat and zlib on your system.
35
Expat is needed to read the new XML map files (file extension xp2)
36
and the rank file. If you install binary packages of your favorite
37
OS distro, and want to compile XPilot NG yourself, make sure you
38
install both the libraries and the development headers,
40
For example on Debian:
41
# apt-get install libexpat1 libexpat1-dev zlib1g zlib1g-dev
43
Source code for expat can be found here:
44
http://expat.sourceforge.net/
47
http://www.gzip.org/zlib/
49
2. Install XPilot NG. There are several ways to do this, either
50
download source code from xpilot.sourceforge.net, compile and install
51
or download binaries from xpilot.sourceforge.net and install
52
or install XPilot NG if that exists as software available for your
53
platform, e.g. Debian package or FreeBSD port.
54
How to install from source code is described in files INSTALL or
57
3. Select a directory where you will have server data (e.g. ranking data
58
and password file) for example you can select "$HOME/xpilot-ng/".
59
Create the directory and specify an environment variable for the
62
$ mkdir "$HOME/xpilot-ng"
63
$ export SERVERDIR="$HOME/xpilot-ng/"
65
4. Specify a password file and password for the server.
67
Edit a password file and set its mode so only you can read and write it:
69
$ emacs "$SERVERDIR/password.txt"
70
$ chmod 600 "SERVERDIR/password.txt"
72
After you edited it the contents should look like this,
73
however change mypassword to your own top secret password:
75
# set this to a unique word and chmod 600 this file:
76
password: \override: mypassword
78
5. Start the server. The most easy way to do this is to have a script to
81
$ emacs $HOME/bin/rankserver.sh
82
$ $HOME/bin/rankserver.sh
84
Contents of the script should be something like this:
87
export SERVERDIR="$HOME/xpilot-ng/"
88
export RANKFILE="$SERVERDIR/rankfile.txt"
89
# possibly change this to something else
90
export RANKWEBPAGE="$HOME/public_html/rank.html"
91
export LOGFILE="$SERVERDIR/log.txt"
94
chmod 644 "$RANKWEBPAGE"
96
xpilot-ng-server -passwordFileName "$SERVERDIR/password.txt" \
97
-rankFileName "$RANKFILE" -rankWebpage "$RANKWEBPAGE" \
98
-map polybloods.xp2 -FPS 50 -gameSpeed 12 -noQuit $@ >> "$LOGFILE"
100
6. Start an xpilot client and test your server.
101
Check that your password works by writing a password command
102
(press the 'm' key when the client window is active to write a message):
106
The server should reply:
108
You got operator status. [*Server reply*]
110
-----------------------------------------------------------------------------
112
Marcus Sundberg's ChangeLog:
114
2002-07-25 16:56 e94_msu
116
* src/common/version.h (1.5): Updated version status to rank2.
118
2002-07-25 16:52 e94_msu
120
* Local.config (1.5): Updated version status to rank2.
122
2002-07-25 15:38 e94_msu
124
* src/server/player.c (1.9): Although we don't want to terminate
125
the server when everyone left we do want to write out the score
128
2002-07-19 03:51 e94_msu
130
* src/common/version.h (1.4): Changed VERSION_STATUS to rank1.
132
2002-07-19 03:26 e94_msu
134
* Local.config (1.4): Changed VERSION_STATUS to rank1.
136
2002-07-19 02:15 e94_msu
138
* src/server/rank.c (1.7): Made writing score file much safer. Now
139
we first write to a temporary file, and only when everything is
140
written do we rename the temporary file to it's correct name.
142
2002-07-19 01:58 e94_msu
144
* src/server/player.c (1.8): Save the score file after each round.
145
Don't try to always terminate the game when everyone has left.
147
2002-07-19 01:43 e94_msu
149
* src/server/server.c (1.4): Minor formating change.
151
2002-07-19 01:43 e94_msu
153
* src/server/rank.c (1.6): Don't call Rank_score() from
156
2002-07-19 01:13 e94_msu
158
* src/server/: player.c (1.7), rank.c (1.5), rank.h (1.3), server.c
159
(1.3): Renamed Print_saved_scores() to more sane Write_score_file()
161
2002-07-19 01:12 e94_msu
163
* src/server/rank.c (1.4): Minor cleanups.
165
2002-07-19 00:33 e94_msu
167
* Local.config (1.3), src/common/version.h (1.3),
168
src/server/command.c (1.7), src/server/laser.c (1.3),
169
src/server/object.h (1.5), src/server/update.c (1.4): Merged with
172
2002-05-26 23:04 e94_msu
174
* src/server/: collision.c (1.3), command.c (1.6), netserver.c
175
(1.4), player.c (1.6): Merged with 4.5.3.
177
2002-05-26 22:37 e94_msu
179
* src/server/walls.c (1.3): Merged with 4.5.3.
181
2002-05-26 22:20 e94_msu
183
* src/server/netserver.c (1.3): Get saved score earlier so we can
184
add the player's score to the team score. Always call TEAM_SCORE()
185
regardless if teamShareScore is on or not.
187
2002-05-26 22:18 e94_msu
189
* src/server/player.c (1.5): Remove player's score from total team
190
score when he leaves.
192
2002-05-19 19:54 e94_msu
194
* src/server/object.h (1.4): We must increase (pl)->shots in
197
2002-05-19 19:53 e94_msu
199
* Local.config (1.2), src/common/version.h (1.2): Added 'rank'
202
2002-04-26 21:43 e94_msu
204
* Local.config (1.1.1.2), README.txt (1.1.1.2), doc/ChangeLog
205
(1.1.1.2), doc/xpilot.spec (1.1.1.2), src/Makefile.std (1.1.1.2),
206
src/common/version.h (1.1.1.2), src/common/NT/bindist/README.txt
207
(1.1.1.2), src/common/NT/bindist/READMEbin.txt (1.1.1.2),
208
src/common/NT/bindist/ServerMOTD.txt (1.1.1.2),
209
src/server/collision.c (1.1.1.2), src/server/command.c (1.1.1.2),
210
src/server/frame.c (1.1.1.2), src/server/netserver.c (1.1.1.2),
211
src/server/player.c (1.1.1.2), src/server/robot.c (1.1.1.2),
212
src/server/rules.c (1.1.1.2), src/server/walls.c (1.1.1.2):
213
Original xpilot 4.5.3.
215
2002-04-26 21:39 e94_msu
217
* src/server/: rank.c (1.2), rank.h (1.2): Made the ranking file
218
portable. Added possibility to import older scorefiles.
220
2002-04-21 23:04 e94_msu
222
* src/server/: command.c (1.4), event.c (1.3), object.h (1.3),
223
update.c (1.3): Updated for new rank structure layout.
225
2002-04-18 22:54 e94_msu
227
* src/server/player.c (1.4): Don't print message about game being
228
unlocked if it wasn't locked.
230
2002-04-18 22:51 e94_msu
232
* src/server/: map.c (1.2), map.h (1.2): Added support for swapping
235
2002-04-18 22:51 e94_msu
237
* src/server/player.c (1.3): Added support for swapping with full
238
teams, and support for unlocking server when last operator leave.
240
2002-04-18 22:50 e94_msu
242
* src/server/command.c (1.3): Added support for swapping with full
243
teams, and support for /op command.
245
2002-04-17 14:26 e94_msu
247
* README.rank (1.1): Very brief info on ranking.
249
2002-04-17 14:20 e94_msu
251
* src/server/: collision.c (1.2), command.c (1.2), event.c (1.2),
252
laser.c (1.2), netserver.c (1.2), object.h (1.2), play.c (1.2),
253
player.c (1.2), rank.c (1.1), rank.h (1.1), score.c (1.2), server.c
254
(1.2), shot.c (1.2), update.c (1.2), walls.c (1.2): Added Svan
255
ranking - initial port from 4.U.3.
257
2002-04-17 13:59 e94_msu
259
* src/server/contact.c (1.2): Kick players without the
260
PRIV_AUTOKICKLAST flag first.
262
2002-04-17 13:56 e94_msu
264
* src/server/Imakefile (1.2): RANKING: Added LOCALGURU define and
267
2002-04-17 13:53 e94_msu
269
* src/common/config.c (1.2): Change default map name to teamcup.xp