2003 November 13
|
This document describes how to install and set up the ShipWars Server, plus familiarize you with all of its features so that you can take advantage by maximizing its capabilities. |
If you were reffered to this HOWTO from a previous installation guide that already instructed you to download the `source for XShipWars', then skip to the Compiling section.
Download the ShipWars Server source from the official ftp site
for WolfPack,
http://wolfpack.twu.net/users/wolfpack.
Choose the file named xsw#.#.tgz, replace the
#.# with the latest (greatest) version number you find
available.
Once download is complete, run the
command tar -zxvf xsw#.#.tgz (replace #.#
with the version number that you downloaded). This will extract
the source files for the ShipWars Server, you will find them
in xsw#.#/server (do not erase the other subdirectories,
they are needed for compiliing).
Change directory to xsw#.#/server (replace #.#
with the version number that you downloaded). Then type
ls Makefile* to see a list of available Makefiles, next type
make -f Makefile.YOUROS
replace YOUROS with the extension name of the Makefile
that best corresponds to your operating system. For instance, if you are
using RedHat 5 Linux you should choose Makefile.Linux.RH-5.
The compiling process will begin, if you recieved any errors during this time please notify the developers about it. See the contacts page for a list of addresses.
There are two ways to install:
make install, which will install into
/home/swserv (but you will miss valuable experiance,
so this option is not recommended).
If you choosed step 2, then you will need to understand the following rules and take appropriate action based on them.
First create the home directory for ShipWars Server (aka
swserv), it can be /home/swserv,
/usr/games/swserv, or /usr/swserv.
Whichever directory you choosed, for the length of this section we
will reffer to that directory as $SWSERVHOME.
(Use the command mkdir -p <newdir> to create a new
directory.)
Once you have created $SWSERVHOME, you need to create
the following subdirectories within $SWSERVHOME:
bin
db
etc
logs
public_html
tmp
Now go back to the directory containing the ShipWars Server source
(that's /whereever/you/downloaded/it/xsw#.#/server,
where #.# is the version number) and copy the following files
(use the command cp <source_file> <destination>):
restart goes in $SWSERVHOME
swserv goes in $SWSERVHOME/bin
default.ocs goes in $SWSERVHOME/db
default.opm goes in $SWSERVHOME/db
generic_in.unv goes in $SWSERVHOME/db
default.conf goes in $SWSERVHOME/etc
Minimal installation is now complete.
If you have compiled the monitor program, you will want to put
that in $SWSERVHOME/bin.
For and explaination of what all these files do, see the next section Explaination of Required Files.
It is important to understand what each file does and how to reffer to
them in a single configuration file so that multiple universes can be easilly
runned by just reffering to them in the command swserv
<configuration_file>.
In $SWSERVHOME:
This is the ShipWars Server toplevel directory, it contains
only the subdirectories and one or more restart scripts.
In $SWSERVHOME/bin:
ShipWars Server and related programs are placed here.
If you plan on setting up for multiple universes maintained by
other users, make sure that the programs here have their permission set
to 555. Do not SETUID swserv, you do not have to do
that.
In $SWSERVHOME/db:
Universe (in, out, and old) files plus .ocs and
.opm
files are placed here. The .ocs and .opm
can be shared by multiple universes, just make sure that their permissions
are set to 644. The Universe files (.unv files) have
a set of three, their name formats are NAMEOFUNIVERSE_in.unv,
NAMEOFUNIVERSE_out.unv, and
NAMEOFUNIVERSE_old.unv. DO NOT WORRY if you only have
NAMEOFUNIVERSE_in.unv, the other two will be generated
automatically the next time you run the restart script to start the
server. If you are running multiple universes maintained by other users,
make sure that you set the permission for the universe 600 and that
it is chowned properly to the maintainining user.
In $SWSERVHOME/etc:
Configuration files for each universe are placed here.
Their name format is usually (but not always... it's up to you)
NAMEOFUNIVERSE.conf.
In $SWSERVHOME/logs:
Log files of each universe are placed here, they are named
in the format NAMEOFUNIVERSE.log.
In $SWSERVHOME/public_html:
Statistic files of general public interest in raw format are
exported to this directory, intended for CGI scripts to parse
and display them via WWW viewing.
In $SWSERVHOME/tmp:
Tempory files created by the server are placed here.
Important rules to remember:
gantry_in.unv and your configuration file would be
named gantry.conf.
To start your understanding of how to configure the ShipWars Server,
take a look at the sample configuration files in the
$SWSERVHOME/etc directory using a text editor.
Each parameter is explained by well documented comments, there is no need
to duplicate their explainations in this HOWTO.
Now you are ready to set up your first universe!
You can start by creating your own universe, download a premade universe, or use the default sample universe that came with the package. Whichever you choose, remember that your first goal is to understand how to set it up.
First start by ensuring that all the required files for a universe are in your posession (see section Explaination of Required Files). Check each subdirectory to make sure they are placed where you want them.
Next edit your configuration file for the new universe that you want to set up. You can use the sample configuration file that came with the package as a template.
Once your configuration file has been properly edited, you will
need to create a restart script. See the sample restart
script in $SWSERVHOME for example. Note the first two
mv commands and how they backup the universe file
and move the (if exists) previous output universe file to be the input.
Then runs $SWSERVHOME/bin/swserv and instructs it to
use the appropriate configuration file. Make any modifications to your
restart script as needed.
You may run several universes at once on one computer provided that they use different port numbers.
To run the ShipWars Server and have it load a universe
is very simple,
just run the appropriate restart script in
$SWSERVHOME. The restart script
will
`rotate' the universe in, out, and old files and then run
the ShipWars Server. It will instruct the ShipWars Server
to use the appropriate configuration
file.
Once the server is running, you can run the XShipWars client
and connect to it. You can also monitor the server by
running the monitor program (note that the
monitor program will already be running if you defined it to
be in the configuration file. You should only run the monitor program
automatically if your GUI is running on the same computer as
the server. If you are running the server remotly, then you
will want to run the monitor program in your local computer
and have the monitor program connect to the remote computer
that the server is running on. Remember to connect to the monitor
to the AUXStatsListeningPort, not the
ListeningPort.
You can shutdown the server in any of the following ways (they're all the same):
shutdown.
SIGINT, SIGKILL or
SIGTERM signal to the server from the shell, example
`kill -s SIGTERM <pid_of_server>'.
The following are a list of routine and periodic activities that you will have to perform as an administrator to keep the ShipWars Servers running properly.
$SWSERVHOME/etc and $SWSERVHOME/db.
$SWSERVHOME/logs and $SWSERVHOME/public_html.
monitor program. If you
are maintaining a universe remotly, then run the
monitor program locally and connect to the remote server's
AUXStatsListeningPort port (defined in the configuration
file).