| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
|
| 3 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" |
| 4 |
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
| 5 |
|
| 6 |
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> |
| 7 |
|
| 8 |
<head> |
| 9 |
<title>Setting up and running a dopewars server</title> |
| 10 |
<meta charset="utf-8"/> |
| 11 |
</head> |
| 12 |
|
| 13 |
<body> |
| 14 |
<h1>Setting up and running a dopewars server</h1> |
| 15 |
|
| 16 |
<p>Multiplayer games of dopewars require a running dopewars server; this |
| 17 |
mediates the interactions between each player (each player runs a |
| 18 |
<a href="clientplay.html">client</a> 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).</p> |
| 24 |
|
| 25 |
<p>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.</p> |
| 27 |
|
| 28 |
<p>The dopewars server can be heavily customised by means of the |
| 29 |
<a href="configfile.html">configuration files</a>. 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.</p> |
| 33 |
|
| 34 |
<ul> |
| 35 |
<li><a href="#server">Running a server</a></li> |
| 36 |
<li><a href="#interact">Interacting with the text-mode server</a></li> |
| 37 |
<li><a href="#ntservice">Running as an NT service</a></li> |
| 38 |
<li><a href="#metaserver">Private and public: the dopewars metaserver</a></li> |
| 39 |
</ul> |
| 40 |
|
| 41 |
<h2><a id="server">Running a server</a></h2> |
| 42 |
|
| 43 |
<p>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 <b>-s</b> or |
| 45 |
<b>-S</b> <a href="commandline.html">command line option</a>. 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 <a href="servercommands.html">server commands</a> is used |
| 49 |
(an "interactive" server) while on Unix systems a text-mode server that |
| 50 |
accepts no input ("noninteractive") is used.</p> |
| 51 |
|
| 52 |
<h2><a id="interact">Interacting with the text-mode server</a></h2> |
| 53 |
|
| 54 |
<p>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 <b>-A</b> |
| 57 |
<a href="commandline.html">command line option</a>. (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 <b>-l</b> |
| 62 |
option.</p> |
| 63 |
|
| 64 |
<h2><a id="ntservice">Running as a Windows service</a></h2> |
| 65 |
|
| 66 |
<p>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 |
<a href="windows.html">supports being run</a> 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.</p> |
| 73 |
|
| 74 |
<h2><a id="metaserver">Private and public: the dopewars metaserver</a></h2> |
| 75 |
|
| 76 |
<p>By default, a server reports its status to the dopewars |
| 77 |
<a href="metaserver.html">metaserver</a>. 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.</p> |
| 84 |
|
| 85 |
<p>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 |
<a href="https://dopewars.sourceforge.io/metaserver.php?getlist=2">here</a>.</p> |
| 88 |
|
| 89 |
<p>Whether your server connects to the metaserver can be configured with the |
| 90 |
<a href="configfile.html#MetaServerActive">MetaServer.Active</a> configuration |
| 91 |
file setting, or the <b>-s</b> and <b>-S</b> <a href="commandline.html"> |
| 92 |
command line options</a>.</p> |
| 93 |
|
| 94 |
<p>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 |
<a href="metaserver.html">metaserver</a> page.</p> |
| 101 |
|
| 102 |
<hr /> |
| 103 |
<ul> |
| 104 |
<li><a href="index.html">Main index</a></li> |
| 105 |
</ul> |
| 106 |
<p> |
| 107 |
Last update: <b>05-12-2020</b><br /> |
| 108 |
Valid <a href="http://validator.w3.org/check/referer">XHTML 1.1</a> |
| 109 |
</p> |
| 110 |
</body> |
| 111 |
</html> |