tDocumentation updates; fix for server log messages in single-player mode - vaccinewars - be a doctor and try to vaccinate the world
(HTM) git clone git://src.adamsgaard.dk/vaccinewars
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit c21a848e4f164542c81277ee6957df3f6a849791
(DIR) parent 9911e27ee2e84f5bac7aa5707077b3e4497d9f0b
(HTM) Author: Ben Webb <ben@salilab.org>
Date: Sun, 17 Jun 2001 15:38:45 +0000
Documentation updates; fix for server log messages in single-player mode
Diffstat:
M doc/configfile.html | 54 ++++++++++++++++++++-----------
M doc/credits.html | 9 ++++++++-
M doc/i18n.html | 8 ++++----
M doc/index.html | 6 +++---
M doc/installation.html | 26 +++++++++++++-------------
M doc/metaserver.html | 56 +++++++++++++++++++------------
M doc/server.html | 6 +++---
M src/dopewars.c | 2 ++
8 files changed, 103 insertions(+), 64 deletions(-)
---
(DIR) diff --git a/doc/configfile.html b/doc/configfile.html
t@@ -109,26 +109,31 @@ is replaced by <i>0</i> (zero) the server will not report to the metaserver.
This setting, if set to 1, can be overridden by the -S
<a href="commandline.html#privateserver">command line option</a>.
-<dt><b>MetaServer.Name=<i>"bellatrix.pcl.ox.ac.uk"</i></b>
+<dt><b>MetaServer.Name=<i>"dopewars.sourceforge.net"</i></b>
<dd>Tells dopewars that the metaserver is located at
-<i>bellatrix.pcl.ox.ac.uk</i>. See the <a href="metaserver.html">metaserver</a>
-page for information about connecting to the dopewars metaserver via. a
-proxy web server.
-
-<dt><b>MetaServer.HttpPort=<i>80</i></b>
-<dd>Instructs the dopewars client that the metaserver can be found on TCP port
-<i>80</i>. This is the standard HTTP port for Web access, but you may need to
-change this if you are connecting via. a proxy web server.
-
-<dt><b>MetaServer.UdpPort=<i>7802</i></b>
-<dd>Instructs the dopewars server that the metaserver can be found on UDP port
-<i>7802</i>. The server utilises UDP as oppposed to the TCP connection used
-by the client due to its much lower overhead.
-
-<dt><b>MetaServer.Path=<i>"/~ben/cgi-bin/server.pl"</i></b>
-<dd>Tells dopewars that the CGI script on the metaserver, for server
+<i>dopewars.sourceforge.net</i>. See the
+<a href="metaserver.html">metaserver</a> page, and below, for information
+about connecting to the dopewars metaserver via. a proxy web server.
+
+<dt><b>MetaServer.Port=<i>80</i></b>
+<dd>Instructs dopewarsclient that the metaserver can be found on TCP port
+<i>80</i>. This is the standard HTTP port for Web access. (You shouldn't need
+to change this, even if you connect via. a proxy.)
+
+<dt><b>MetaServer.ProxyName=<i>"proxy.com"</i></b>
+<dd>Sends all requests to the metaserver via. the web proxy at <i>proxy.com</i>.
+If this is set to a blank string (the default) then the connection to the
+metaserver is made directly.
+
+<dt><b>MetaServer.ProxyPort=<i>8080</i></b>
+<dd>Connects to the web proxy on port <i>8080</i>. (It then connects to the
+metaserver on the port specified by MetaServer.Port.) This variable is ignored
+if MetaServer.ProxyName is blank.
+
+<dt><b>MetaServer.Path=<i>"/metaserver.php"</i></b>
+<dd>Tells dopewars that the PHP script on the metaserver, for server
registration (server mode) or listing the available servers (client mode) is
-<i>/~ben/cgi-bin/server.pl</i>.
+<i>/metaserver.php</i>.
<dt><a name="MetaServerComment"><b>MetaServer.Comment=<i>"dopewars
server"</i></b></a>
t@@ -340,6 +345,17 @@ against a player.
<h2><a name="advanced">Advanced configuration</a></h2>
<dl>
+<dt><b>LogLevel=<i>2</i></b>
+<dd>Most server log messages are given a priority level, from 0 (most urgent)
+to 5 (most verbose). This setting instructs the server only to log messages
+from level 0 up to <i>2</i>, inclusive.
+
+<dt><b>LogTimestamp=<i>"[%H:%M:%S] "</i></b>
+<dd>Prefixes all log messages with a timestamp of the form (e.g.)
+<i>[16:34:49]</i>. This is a string which is passed as input to the
+<tt>strftime(3)</tt> function. If this is set to a blank string, then no
+timestamp is added to log messages.
+
<dt><b>NumTurns=<i>31</i></b>
<dd>Defines the game to end after <i>31</i> "days" or turns. If this is set
to 0 (zero) the game never ends for a player, unless they quit or are killed.
t@@ -484,6 +500,6 @@ any drugs, and clients will display this information if available.
<ul>
<li><a href="index.html">Main index</a>
</ul>
-<p>Last update: <b>13-05-2001</b></p>
+<p>Last update: <b>17-06-2001</b></p>
</body>
</html>
(DIR) diff --git a/doc/credits.html b/doc/credits.html
t@@ -46,10 +46,17 @@ as well as spotting many of his own and my bugs...</p>
<p><b>Tony Brown</b> for assistance with using dopewars via. enforced web
proxies.</p>
+<p><b>Leon Breedt</b> for writing a manpage, and creating a Debian package.</p>
+
+<p><b>Ocelot Mantis</b> for graphics and ideas for improvements.</p>
+
+<p><b>Tobias Mathes</b>, <b>Slawomir Molenda</b> and <b>Hugo Cisneiros</b>
+for translating dopewars into other languages.</p>
+
<hr>
<ul>
<li><a href="index.html">Main index</a>
</ul>
-<p>Last update: <b>13-05-2001</b></p>
+<p>Last update: <b>17-06-2001</b></p>
</body>
</html>
(DIR) diff --git a/doc/i18n.html b/doc/i18n.html
t@@ -162,20 +162,20 @@ contributed to the main dopewars distribution!</p>
<li>German (<tt>de.po</tt>)
<ul>
<li>Maintained by: <a href="mailto:tobi@radical-linux.de">Tobias Mathes</a>
-<li>Version required: <b>1.5.0beta1</b> or CVS
+<li>Version required: <b>1.5.0</b> or later
</ul>
<li>Polish (<tt>pl.po</tt>)
<ul>
<li>Maintained by: <a href="mailto:jeszua@panda.bg.univ.gda.pl">Slawomir
Molenda</a>
-<li>Version required: <b>1.5.0beta1</b> or CVS
+<li>Version required: <b>1.5.0</b> or later
</ul>
<li>Portuguese (Brazil) (<tt>pt_BR.po</tt>)
<ul>
<li>Maintained by: <a href="mailto:hugo@netdados.com.br">Hugo Cisneiros</a>
-<li>Version required: <b>1.5.0beta1</b> or CVS
+<li>Version required: <b>1.5.0</b> or later
</ul>
</ul>
t@@ -183,7 +183,7 @@ Molenda</a>
<ul>
<li><a href="index.html">Main index</a>
</ul>
-<p>Last update: <b>29-04-2001</b></p>
+<p>Last update: <b>17-06-2001</b></p>
</body>
</html>
(DIR) diff --git a/doc/index.html b/doc/index.html
t@@ -3,11 +3,11 @@
<html>
<head>
-<title>dopewars 1.5.0: Main Index</title>
+<title>dopewars 1.5.1: Main Index</title>
</head>
<body>
-<h1>dopewars 1.5.0: Main Index</h1>
+<h1>dopewars 1.5.1: Main Index</h1>
<table>
t@@ -51,6 +51,6 @@ freely available under the <a href="LICENCE">GNU General Public License</a>.</p>
</table>
<hr>
-<p>Last update: <b>13-05-2001</b></p>
+<p>Last update: <b>17-06-2001</b></p>
</body>
</html>
(DIR) diff --git a/doc/installation.html b/doc/installation.html
t@@ -45,9 +45,9 @@ faults due to library conflicts.</p>
<ol>
<li>Download the
-<a href="http://dopewars.sourceforge.net/dopewars-1.5.0-1.alpha.rpm">
+<a href="http://prdownloads.sourceforge.net/dopewars/dopewars-1.5.1-1.alpha.rpm">
Alpha</a> or
-<a href="http://dopewars.sourceforge.net/dopewars-1.5.0-1.i386.rpm">
+<a href="http://prdownloads.sourceforge.net/dopewars/dopewars-1.5.1-1.i386.rpm">
i386 (Intel)</a> RPM with your web browser. (If your browser is incorrectly set
up, it may try and display the file, in which case tell it explicitly to save
the file - Shift+Mouse button 1 in Netscape.)
t@@ -58,7 +58,7 @@ up).
<li>Change to the directory containing the dopewars rpm, and install it with
the command<br>
-<tt><b>rpm -Uvh dopewars-1.5.0-1.<i>xxx</i>.rpm</b></tt><br>
+<tt><b>rpm -Uvh dopewars-1.5.1-1.<i>xxx</i>.rpm</b></tt><br>
(where <b><i>xxx</i></b> is i386 or alpha). This will replace any
already-installed earlier version.
</ol>
t@@ -71,13 +71,13 @@ building the binaries from it on your system.</p>
<ol>
<li>Download the
-<a href="http://dopewars.sourceforge.net/dopewars-1.5.0-1.src.rpm">source code
-RPM</a>.
+<a href="http://prdownloads.sourceforge.net/dopewars/dopewars-1.5.1-1.src.rpm">
+source code RPM</a>.
<li>Become root and change to the directory containing the new rpm.
<li>Build a binary rpm with the command<br>
-<tt><b>rpm --rebuild dopewars-1.5.0-1.src.rpm</b></tt>
+<tt><b>rpm --rebuild dopewars-1.5.1-1.src.rpm</b></tt>
<li>Change to the directory which the binary rpm has been written to (check
the output of the above - usually /usr/src/redhat/RPMS/<i>xxx</i>, where
t@@ -85,7 +85,7 @@ the output of the above - usually /usr/src/redhat/RPMS/<i>xxx</i>, where
"alpha" on Alphas)
<li>Install the binary rpm with the command<br>
-<tt><b>rpm -Uvh dopewars-1.5.0-1.<i>xxx</i>.rpm</b></tt>
+<tt><b>rpm -Uvh dopewars-1.5.1-1.<i>xxx</i>.rpm</b></tt>
</ol>
<h2><a name="tarball">Tarball installation</a></h2>
t@@ -96,15 +96,15 @@ your Unix box.</p>
<ol>
<li>Download the
-<a href="http://dopewars.sourceforge.net/dopewars-1.5.0.tar.gz">source code
-tarball</a>.
+<a href="http://prdownloads.sourceforge.net/dopewars/dopewars-1.5.1.tar.gz">
+source code tarball</a>.
<li>Change to the directory containing the tarball and extract the contents
with the command <br>
-<tt><b>tar -xvzf dopewars-1.5.0.tar.gz</b></tt><br>
+<tt><b>tar -xvzf dopewars-1.5.1.tar.gz</b></tt><br>
(or similar).
-<li>Change into the dopewars-1.5.0 directory, and read all the important
+<li>Change into the dopewars-1.5.1 directory, and read all the important
documentation in there ;)
<li>Build the binary with the commands<br>
t@@ -118,7 +118,7 @@ should compile cleanly. If you are running the Cygwin tools under Microsoft
Windows, the script should detect this and allow you to build a native
Windows binary; this will then run on any Win32 system, even one without Cygwin
installed. The configure script supports a number of configurable options; for
-more details, read the INSTALL file in the dopewars-1.5.0 directory.<p>
+more details, read the INSTALL file in the dopewars-1.5.1 directory.<p>
If you cannot become root, run the configure script specifying directories for
which you have write access for both the dopewars binary and high score file
t@@ -131,6 +131,6 @@ with a command such as<br>
<ul>
<li><a href="index.html">Main index</a>
</ul>
-<p>Last update: <b>13-05-2001</b></p>
+<p>Last update: <b>17-06-2001</b></p>
</body>
</html>
(DIR) diff --git a/doc/metaserver.html b/doc/metaserver.html
t@@ -18,34 +18,39 @@ pick the game that most suits them. This is the function of the dopewars
<ul>
<li><a href="#location">Metaserver location</a>
+<li><a href="#oldmeta">The "old" metaserver</a>
<li><a href="#client">Using the metaserver from the client</a>
<li><a href="#server">Using the metaserver from the server</a>
<ul>
-<li><a href="#wrongip">But it's displaying the wrong IP address!</a>
+<li><a href="#wrongip">But it's displaying the wrong name!</a>
<li><a href="#dynamicip">But my server has a dynamic IP...</a>
</ul>
</ul>
<h2><a name="location">Metaserver location</a></h2>
-<p>The metaserver has a CGI (web) interface for humans and dopewars clients to
-read from, and a UDP interface for servers to report to. It lives at the
-same place as the <a href="http://bellatrix.pcl.ox.ac.uk/~ben/dopewars/">
-main dopewars page</a>; the CGI interface listens on TCP port 80, and the
-UDP interface on port 7802. These are the default settings which all
-dopewars servers and clients use for metaserver communication.</p>
+<p>The metaserver is a <a href="http://www.php.net/">PHP</a> script which lives
+at <a href="http://sourceforge.net/">SourceForge</a>. It is accessed by both
+dopewars servers and clients via. TCP connection to port 80, by standard
+HTTP.</p>
+
+<h2><a name="oldmeta">The "old" metaserver</a></h2>
+<p>Versions of dopewars prior to 1.5.1 used a different metaserver system,
+which is now deprecated. Although the old system will continue to run for some
+time, it will eventually be discontinued, so it is recommended that dopewars
+servers and clients are upgraded to the latest version.</p>
<h2><a name="client">Using the metaserver from the client</a></h2>
<p>Players who want to use the metaserver to list the currently available
servers should go to
-<a href="http://bellatrix.pcl.ox.ac.uk/~ben/cgi-bin/serverlist.pl">this
-link</a>, or just follow the "Servers" link from the main dopewars web page.
-It cannot be guaranteed that all the listed servers are functional - they
+<a href="http://dopewars.sourceforge.net/metaserver.php?getlist=2">this
+link</a>, or just follow the "Active servers" link from the main dopewars web
+page. It cannot be guaranteed that all the listed servers are functional - they
may, for example, have been registered in error, or a server may have crashed
since being added to the list - but the list is checked daily for service,
and so there is at least a good chance that the servers listed there will
be working.</p>
-<p>The metaserver, being a collection of CGI scripts, should work happily on
+<p>The metaserver, being an ordinary web page, should work happily on
most machines which have web access. A problem occurs, however, if your
connection to the Web is via. an enforced proxy server (i.e. traffic on
port 80 from your machine is blocked by firewall). dopewars can be
t@@ -53,9 +58,8 @@ configured to connect via. a proxy server without too much difficulty; if
your proxy server is at <i>proxy.com</i> on port <i>8080</i> then you should
add the following lines to your dopewars <a href="configfile.html">
configuration file</a>:-<br>
-<b>MetaServer.Name=proxy.com<br>
-MetaServer.Port=8080<br>
-MetaServer.Path=http://bellatrix.pcl.ox.ac.uk/~ben/cgi-bin/server.pl</b></p>
+<b>MetaServer.ProxyName="proxy.com"<br>
+MetaServer.ProxyPort=8080</b></p>
<h2><a name="server">Using the metaserver from the server</a></h2>
<p>People running servers who <b>do not</b> want their details listed by the
t@@ -71,10 +75,20 @@ MetaServer.Comment</a> configuration file setting.</p>
sends this data on startup and shutdown, and when players leave or join the
game. See the <a href="server.html">server page</a> for more details.</p>
-<h3><a name="wrongip">But it's displaying the wrong IP address!</a></h3>
-<p>Once connected to the metaserver, you may find that it incorrectly
-displays the domain name of your server machine. This is usually because the
-metaserver cannot resolve your IP address to a domain name.</p>
+<p>The server, just like the client, may have trouble connecting to the
+metaserver if you are using a web proxy; see the information
+<a href="#client">above</a> for fixing this problem.</p>
+
+<h3><a name="wrongip">But it's displaying the wrong name!</a></h3>
+<p>Once connected to the metaserver, you may find that it displays the IP
+address of your server and not its domain name. This is usually because your
+DNS is not set up to translate your IP into a domain name, and can be
+remedied by <a href="mailto:ben@bellatrix.pcl.ox.ac.uk>mailing</a> the
+metaserver maintainer, who can add a suitable mapping for you.</p>
+
+<p>On other occasions, the metaserver will display a domain name, but it'll
+be incorrect. This is usually because you are connecting via. a proxy, and
+the metaserver cannot determine your true IP address.</p>
<p>In this case, you will need to override the hostname that the metaserver
guesses for your machine with one you choose yourself. This is done by
t@@ -90,8 +104,8 @@ variable in the dopewars configuration file.</p>
<p>For example, if you wish your server to be known as <b>dope-serv.com</b> and
you have emailed the maintainer, receiving the password <b>Dope-Auth</b>, then
add the following to the dopewars configuration file:-<br>
-<b>MetaServer.LocalName=dope-serv.com<br>
-MetaServer.Password=Dope-Auth</b></p>
+<b>MetaServer.LocalName="dope-serv.com"<br>
+MetaServer.Password="Dope-Auth"</b></p>
<p>Restart your dopewars server, or send it a SIGUSR1 signal, for the change to
take effect. Bear in mind that if you make up a non-existent or invalid domain
t@@ -116,6 +130,6 @@ will automatically replace the "old" one.</p>
<ul>
<li><a href="index.html">Main index</a>
</ul>
-<p>Last update: <b>13-05-2001</b></p>
+<p>Last update: <b>17-06-2001</b></p>
</body>
</html>
(DIR) diff --git a/doc/server.html b/doc/server.html
t@@ -63,13 +63,13 @@ Alternatively you can redirect this output to <i>/dev/null</i>.)</p>
shutdown, and whenever players join or leave the game. In addition, you
can force a report (under Unix systems) by sending the dopewars server
process a SIGUSR1 signal. The server will "remind" the metaserver that it
-exists by ensuring that a report is sent at least once every 20 minutes or so,
+exists by ensuring that a report is sent at least once every 3 hours or so,
regardless. A "status report" comprises contact details for the server,
a count of the number of active players, and current high scores.</p>
<p>The metaserver also has a web interface, which is used by dopewars clients to
obtain the list of servers, and can also be viewed with a web browser
-<a href="http://bellatrix.pcl.ox.ac.uk/~ben/cgi-bin/serverlist.pl">here</a>.</p>
+<a href="http://dopewars.sourceforge.net/metaserver.php?getlist=2">here</a>.</p>
<p>Whether your server connects to the metaserver can be configured with the
<a href="configfile.html#MetaServerActive">MetaServer.Active</a> configuration
t@@ -88,6 +88,6 @@ information on getting round these difficulties, see the
<ul>
<li><a href="index.html">Main index</a>
</ul>
-<p>Last update: <b>13-05-2001</b></p>
+<p>Last update: <b>17-06-2001</b></p>
</body>
</html>
(DIR) diff --git a/src/dopewars.c b/src/dopewars.c
t@@ -1072,6 +1072,8 @@ void dopelog(int loglevel,const gchar *format,...) {
/* from 0 to 5 (0=vital, 2=normal, 5=maximum debugging output). This */
/* is essentially just a wrapper around the GLib g_log function. */
va_list args;
+ if (!Network) return; /* Don't print server log messages when
+ running standalone */
va_start (args,format);
g_logv(G_LOG_DOMAIN,1<<(loglevel+G_LOG_LEVEL_USER_SHIFT),format,args);
va_end (args);