]> granicus.if.org Git - nethack/commitdiff
Allow unlimited number of players
authorPasi Kallinen <paxed@alt.org>
Wed, 9 Dec 2015 20:27:22 +0000 (22:27 +0200)
committerPasi Kallinen <paxed@alt.org>
Wed, 9 Dec 2015 20:27:26 +0000 (22:27 +0200)
This is important for public servers.  Setting the MAXPLAYERS
sysconf value to 0 (or commenting it out) constructs the lock
files with the player UID and player name, so each player may
have one game at a time.

src/files.c
sys/unix/sysconf

index 1b74a56b4dd2e4c7904bd06a8603f325433f82cf..7699ee1cc43fd39ece1be89dc96c451a50176b8e 100644 (file)
@@ -2279,7 +2279,7 @@ int src;
     } else if (src == SET_IN_SYS && match_varname(buf, "MAXPLAYERS", 10)) {
         n = atoi(bufp);
         /* XXX to get more than 25, need to rewrite all lock code */
-        if (n < 1 || n > 25) {
+        if (n < 0 || n > 25) {
             raw_printf("Illegal value in MAXPLAYERS (maximum is 25).");
             return 0;
         }
index 83d33d4668b412b16193d7d73bce8aada1a3899b..1bed4487f5ee97359d9240497692bf6ea22c61e4 100644 (file)
@@ -31,6 +31,12 @@ EXPLORERS=*
 #SHELLERS=
 
 # Limit the number of simultaneous games (see also nethack.sh).
+# Valid values are 0-25.
+# Commenting this out or setting the value to 0 constructs lock files
+# with UID and username, so each user may have one game at a time, but
+# number of different players is not limited.
+# Setting this to any other value constructs the lock files with
+# letter and "lock" (eg. alock, block, ...)
 MAXPLAYERS=10
 
 # If not null, added to string "To get local support, " in the support