WWC snapshot of http://www.msi.umn.edu/paradise/README.server.html taken on Sun May 28 22:59:15 1995

Paradise Server README

The Server half of the Netrek socket protocol, is in the ntserv directory. The binaries from the server will be installed in the bin directory. The server code is divided into three major binaries; ntserv, daemonII, and listen, as well as two robot binaries: robotII and snake.

Server Installation

To install the server onto your system, you need to modify the following:

bin Directory

These are the files that run the server half of the socket protocol. In your bin directory, you must have at least the following files (you can have more): The following is a description of each file's function:
.conquer:
this file records the conquers, and genocides of the galaxy. it is for reading entertainment, and can be deleted.
.global:
this file holds the global stats, taken from the .players file. The two files do work together. If you remove this file, and not the .players file, the player's stats will become VERY funky don't remove it.
.hours:
this is the text file, for your hours. It is in binary form, with 1 meaning you are open, and 0 meaning you are closed.
.motd:
this is your message of the day file, change it as you will.
.planets:
this keeps the current stats of the planets, if you remove this, when the daemon is not running, it will reset the galaxy. If you do not have it around, the galaxy will reset every time the daemon restarts. It is a good idea to keep this around, incase the daemon crashes in the middle of a big game, and all the players want to jump back in, the second it is back up.
.sysdef:
your system defaults file. This is where a lot of the changable defaults are set. See the file README.sysdef.
daemonII:
this is the daemon binary, started when the first player connects. it should be installed when you type `make install'
logfile:
the logfile records all connections, and lost connections. This can be useful, if you are looking for specific problems, but is otherwise useless.
ntserv:
this is the binary, which is started up by the listen binary, for each player that connects. It should also be installed with `make install'.
startup.log:
this file is similar to the logfile, however, it records daemon problems. If the server suddenly stops writing into this file, it is probably because you removed the logfile, while it was being used, you can probably find problems here faster than in the logfile.
.reserved:
the .reserved file is used for RSA verification. The file currently included only has the server end of the demonstration key given with the RSA code.
.rsa-keys:
this file contains the most recent paradise client RSA keys.
.pics:
this file tells the server where to place the pictures. The format is:
                    <picture name/location>
                    <X> <Y> <page>
the picture location is from where the .pics file is located the X and Y are coordinates on the window (it is 500/500), (NOTE: the Y coordinates start at 105 since the top is taken up by the border). The page is which page the picture is placed on (read on for help in the Motd).
godlog:
this is where all text send to 'GOD' or GOD: is logged.

Options

You can get a list of all options on each binary by using the '-u' flag.

Debugging the Server

You can make a connection by hand, by first creating a passive client.
         client% netrek.paradise -s 6666 
This starts a client in passive mode, specifying a random socket number. It is waiting for a connection from an ntserv.

On the server, check to see if the daemon is running. You should be able to see it in the process listing from ps. You can also check the shared memory to see if the segment exists. Netrek uses key 128 (hexadecimal 0x80) for shared memory.

 server% ipcs
IPC status from beach as of Tue Apr 12 09:00:48 1994
T     ID     KEY        MODE       OWNER    GROUP
Message Queues:
Shared Memory:
m   7600 0x00000080 --rw-rw-rw-    thoth     grad
Semaphores:
If the daemon is not running (there's no shared memory or there's no daemon process), you should start one by hand.
	server% setenv NETREKDIR whatever
	server% daemonII
This prevents problems caused by the ntserv forking one while being run under the debugger. (Signals caught by the ntserv can affect the daemon, which is a bad thing).

Now start an ntserv

	server% setenv NETREKDIR whatever  (if you haven't already)
        server% ntserv -s 6666 -d client
Replacing client with the name of the machine running the client.

Using this method you can run the ntserv under a debugger. For example, using gdb:

 server% gdb ntserv
GDB is free software and you are welcome to distribute copies of it
 under certain conditions; type "show copying" to see the conditions.
There is absolutely no warranty for GDB; type "show warranty" for details.
GDB 4.11 (sparc-sun-sunos4.1.3), 
Copyright 1993 Free Software Foundation, Inc...
(gdb) run -s 6666 -d client
One of the most common problems is that the client connects and all team windows are hashed out. Start debugging this problem by setting a breakpoint in the function tournamentMask and tracing to see why it returns 0 (it should return 0xf when there's nobody in the game). If you can tell paradise-workers@reed.edu why you got this error and how you solved it, we can add it to a ``Common Problems'' section.

Known Bugs/Features:

When starting ntserv by hand, if there is an extra argument, it is interpreted as the machine to connect to (-d option).

The ntserv -s option requires -d, (or SEGV).

Message of the Day:

The Message of the Day is the first thing the players see after they log in. In the paradise servers we have moved the team windows (square boxes for each team) to the right window, to give more room for the MOTD. The server also places text in the right window, depending upon how its .sysdef file is configured.

The client will automatically divide the motd into pages in two circumstances. The first is if the page is larger than the window. With the paradise motd this is not a good idea to do, as it will make all of your pictures be off alignment. The second is by searching for the following in the motd: <newline><tab>@@b all this means is that to designate a new page you simply have to start at the beginning of a line, tab once, and type @@b.

NOTE: by typing <tab>@@@ near the end of the motd you can place more text in the left window. However, this text will be placed above the server settings, so make sure it isn't too large, as it may croud out the server settings.

Lastly, you can place pictures in the Message of the day. To get a picture in the motd simply get an xbm of that picture, place it in the pics directory, and put the correct values in .pics. Each entry in the .pics file should look something like this:

			Pics/picture.xbm
			1 100 0
There is no limit on picture size. The server will automatically chop the file into appropriate portions. However remember lag, be kind to your friendly player and don't place too many pictures in the motd.

Source Directory

This includes the source for all files included in the server.
[RG]

[Paradise]

Bob Glamm / <glamm@msi.umn.edu>