]> git.pond.sub.org Git - empserver/commitdiff
Separate max_idle_visitor from max_idle
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 18 Mar 2012 17:24:51 +0000 (18:24 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Thu, 26 Apr 2012 17:57:19 +0000 (19:57 +0200)
Cut it to 5 minutes, from max_idle's 15.

Since max_idle now applies only to authenticated players, increasing
it is perfectly safe.

include/econfig-spec.h
info/version.t
src/lib/commands/vers.c
src/lib/global/constants.c
src/lib/player/accept.c

index f69838cd5ee491119c4b3a2bc1bdd3bd9b390da3..dd06a4fd5fe9b7fd92fbb01c6103705b17418374 100644 (file)
@@ -200,6 +200,8 @@ EMPCFBOTH("max_btus", max_btus, int, NSC_INT, 0,
     "Maximum number of BTUs a country can have")
 EMPCFBOTH("max_idle", max_idle, int, NSC_INT, 0,
     "Maximum number of minutes a player can sit idle while logged in")
+EMPCFBOTH("max_idle_visitor", max_idle_visitor, int, NSC_INT, 0,
+    "Maximum number of minutes a visitor can sit idle while logged in")
 EMPCFBOTH("login_grace_time", login_grace_time, int, NSC_INT, 0,
     "Grace time for clients to complete login and logout (seconds)")
 EMPCFBOTH("players_at_00", players_at_00, int, NSC_INT, 0,
index 8380175f2bd19231c3417b9587f36a43b7fb7f10..0742773f3173ea7cc914d3e19c7d8b3d9805311c 100644 (file)
@@ -12,7 +12,7 @@ For example:
 .s1
 .EX version
 .NF
-Wolfpack Empire 4.3.27
+Wolfpack Empire 4.3.30
 
 The following parameters have been set for this game:
 World size is 64 by 32.
@@ -20,7 +20,7 @@ There can be up to 99 countries.
 By default, countries use their own coordinate system.
 
 Use the 'show' command to find out the time of the next update.
-The current time is Wed Apr 13 07:09:54.
+The current time is Sun Mar 18 18:22:49.
 An update consists of 60 empire time units.
 Each country is allowed to be logged in 1440 minutes a day.
 It takes 8.33 civilians to produce a BTU in one time unit.
@@ -73,6 +73,7 @@ Land units     10%      0%    100%     --       0%      0%
 
 You can have at most 640 BTUs.
 You are disconnected after 15 minutes of idle time.
+Visitors are disconnected after 5 minutes of idle time.
 
 Options enabled in this game:
        ALL_BLEED, BLITZ, EASY_BRIDGES, FALLOUT, GODNEWS, INTERDICT_ATT,
index 31116dbc9fbd8ae9a96812ffcce81ba39c885d35..66e2cfb7d0d727b699f1f5ce39893b2d78fe21e8 100644 (file)
@@ -33,7 +33,7 @@
  *     Ken Stevens
  *     Steve McClure
  *     Ron Koenderink, 2005-2006
- *     Markus Armbruster, 2005-2011
+ *     Markus Armbruster, 2005-2012
  */
 
 #include <config.h>
@@ -217,7 +217,12 @@ vers(void)
        collateral_dam * 100.0);
     pr("\n");
     pr("You can have at most %d BTUs.\n", max_btus);
-    pr("You are disconnected after %d minutes of idle time.\n", max_idle);
+    pr("%s are disconnected after %d minute%s of idle time.\n",
+       player->nstat & NONVIS ? "You" : "Players",
+       max_idle, splur(max_idle));
+    pr("%s are disconnected after %d minute%s of idle time.\n",
+       player->nstat & NONVIS ? "Visitors" : "You",
+       max_idle_visitor, splur(max_idle_visitor));
     pr("\nOptions enabled in this game:\n");
     show_opts(1);
     pr("\n\nOptions disabled in this game:\n");
index e051fd78046b94ded2c84a6d9c2e46bf5f02b930..442c604de9e0e58f625f27df7f95348063bbe4a8 100644 (file)
@@ -65,6 +65,7 @@ char *game_days = "";         /* days game is running */
 char *game_hours = "";         /* hours game is running */
 char *pre_update_hook = "";
 int max_idle = 15;             /* session dies after max_idle minutes idle */
+int max_idle_visitor = 5;      /* same for visitors */
 int login_grace_time = 120;    /* Grace time for completing login (sec) */
 
 int sect_mob_max = 127;                /* sector mobility limits */
index f32548e0cfad842ee5bba0bbaf222858b29582f8..92b5456e5f019f2cdf4a44d389332d789c47bd3b 100644 (file)
@@ -159,7 +159,8 @@ player_io_deadline(struct player *pl, int write)
        return 0;
     if (pl->state != PS_PLAYING)
        return pl->curup + login_grace_time;
-    return pl->curup + minutes(max_idle);
+    return pl->curup
+       + minutes(pl->nstat & NONVIS ? max_idle: max_idle_visitor);
 }
 
 /*ARGSUSED*/