I did a bit of work to get a BZFlag 2.4.0 game server running on one of my virtual Debian servers. I’m sure there must be a better/smarter way to do the same thing, but this is what I did.
First of all, I just downloaded the sourcecode for BZFlag 2.4.0 from their homepage. Then it was just a matter of making sure I’d installed what my Debian server needed to compile the code.
$> su -
$> apt-get install build-essential
After unpacking the code, and going into the unpacked directory, it was just a matter of doing…
$> cd ~magvar/bzfs2.4.0
To make sure I could run more than one version of the game server, I placed the 2.4.0 version of the scripts needed in their own directory.
$> su -
$> mkdir -p /usr/games/bzflag
$> cp ~magvar/bzfs2.4.0/misc/bzfs ~magvar/bzfs2.4.0/misc/bzfsd /usr/games/bzflag/
I had to update the bzfs script, the server startup script, a little. The following were the changes I had to make.
# Set this path to the place where you keep the bzfsd script
# Set this to your bzfs options
I also think I had to change the location of the lockfile.
I updated the bzfsd file to contain the following line to do the execution.
nohup /usr/games/bzflag/server/bzfs $* > $BZLOGFILE &
I edited the bzfs.conf file (controlling the configuration of what’s possible to do in the BZFlag game), and put it under /etc/bzfs.conf.
-a 50 38
Note that I made sure to remove the “Blindness” (B) flag. SmartBullets and Lasers are fun, though.
Missing were, among other things, /etc/init.d/functions. Found that, by luck, and just copied the code to a file, i.e /etc/init.d/functions
I got the whole file from this site.
I had to edit a few things out, among other things I hardcoded consoletype to one (1), as it’s a virtual terminal (no user behind the keys). Adding this after the export of PATH did the trick.
Then it was just a matter of copying the binary and setting up the server to start automatically.
$> su -
$> mkdir /usr/games/bzflag/server
$> cp ~magvar/bzfs2.4.0/bzfs/bzfs /usr/games/bzflag/server
$> ln -s /usr/games/bzflag/bzfs /etc/init.d/bzfs.sh
$> cd /etc/init.d
$> update-rc.d bzfs.sh defaults
And hopefully that’s all that’s needed to get it running. Looking at my rebooted server, I’ve got a process running, at least. The init-file I linked to is located here.
root 1067 1 0 19:33 ? 00:00:00 /usr/games/bzflag/server/bzfs -conf /etc/bzfs/bzfs.conf