tserver.html - vaccinewars - be a doctor and try to vaccinate the world
git clone git://src.adamsgaard.dk/vaccinewars
Log
Files
Refs
README
LICENSE
---
tserver.html (5271B)
---
     1 
     2 
     3 
     5 
     6 
     7 
     8 
     9 Setting up and running a dopewars server
    10 
    11 
    12 
    13 
    14 

Setting up and running a dopewars server

15 16

Multiplayer games of dopewars require a running dopewars server; this 17 mediates the interactions between each player (each player runs a 18 client which connects to this server). The server 19 runs the game, generating drug prices and the like, and instructs the clients 20 accordingly. The server can be run on any machine that can be reached over 21 the network by clients (so you don't have to run it on the same machine that 22 you run your client on, for example, unless your firewall blocks the dopewars 23 port).

24 25

Single player games do not require a server (although you can still connect 26 to one if you like) as a "virtual server" is run by the dopewars client.

27 28

The dopewars server can be heavily customised by means of the 29 configuration files. For example, you can 30 change the names of all the game locations so that the game is set in your 31 home city rather than New York. Any players that then connect to your 32 customised server will play this customised game.

33 34 40 41

Running a server

42 43

All the code for the dopewars server is included in the same binary as the 44 standard client. To run the binary in server mode, specify the -s or 45 -S command line option. The type of 46 server that runs depends on how you configured the binary; by default, on 47 Windows systems a simple graphical window containing the server output and 48 a line for entering server commands is used 49 (an "interactive" server) while on Unix systems a text-mode server that 50 accepts no input ("noninteractive") is used.

51 52

Interacting with the text-mode server

53 54

Once started, the text-mode server does not accept commands directly. This 55 is problematic if you want to adjust settings, eject players, etc. To send 56 commands to a running server, run dopewars with the -A 57 command line option. (This should only work 58 from the machine running the dopewars server, not over the network, and only 59 for the user that started the server, as it uses a Unix-domain socket for the 60 communication.) Also, by default the text-mode server sends its log output to 61 standard output; you may wish to instead log to a file with the -l 62 option.

63 64

Running as a Windows service

65 66

On Windows systems, the graphical server has one major drawback; it can 67 only run while you are logged on. As soon as you log out, the server is 68 killed. To get around this limitation, dopewars 69 supports being run as a "Windows Service". 70 The disadvantage of the server in this configuration is that server commands 71 cannot be issued once the server is running. This limitation should be 72 fixed in a future release of dopewars.

73 74

Private and public: the dopewars metaserver

75 76

By default, a server reports its status to the dopewars 77 metaserver. It does this on startup and 78 shutdown, and whenever players join or leave the game. In addition, you 79 can force a report (under Unix systems) by sending the dopewars server 80 process a SIGUSR1 signal. The server will "remind" the metaserver that it 81 exists by ensuring that a report is sent at least once every 3 hours or so, 82 regardless. A "status report" comprises contact details for the server, 83 a count of the number of active players, and current high scores.

84 85

The metaserver also has a web interface, which is used by dopewars clients to 86 obtain the list of servers, and can also be viewed with a web browser 87 here.

88 89

Whether your server connects to the metaserver can be configured with the 90 MetaServer.Active configuration 91 file setting, or the -s and -S 92 command line options.

93 94

N.B. Your machine may have trouble connecting with 95 the metaserver in some circumstances, most notably if you are using an 96 enforced proxy server or your DNS does not correctly resolve your IP address 97 to your domain name. In such cases, you may be unable to connect to the 98 metaserver, or it may register your server with an incorrect name. For 99 information on getting round these difficulties, see the 100 metaserver page.

101 102
103 106

107 Last update: 05-12-2020
108 Valid XHTML 1.1 109

110 111