From 918f3ec6ae953ab2c17c14399a4bf84849edc08c Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sun, 18 Mar 2012 18:24:51 +0100 Subject: [PATCH] Separate max_idle_visitor from max_idle 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 | 2 ++ info/version.t | 5 +++-- src/lib/commands/vers.c | 9 +++++++-- src/lib/global/constants.c | 1 + src/lib/player/accept.c | 3 ++- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/include/econfig-spec.h b/include/econfig-spec.h index f69838cd5..dd06a4fd5 100644 --- a/include/econfig-spec.h +++ b/include/econfig-spec.h @@ -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, diff --git a/info/version.t b/info/version.t index 8380175f2..0742773f3 100644 --- a/info/version.t +++ b/info/version.t @@ -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, diff --git a/src/lib/commands/vers.c b/src/lib/commands/vers.c index 31116dbc9..66e2cfb7d 100644 --- a/src/lib/commands/vers.c +++ b/src/lib/commands/vers.c @@ -33,7 +33,7 @@ * Ken Stevens * Steve McClure * Ron Koenderink, 2005-2006 - * Markus Armbruster, 2005-2011 + * Markus Armbruster, 2005-2012 */ #include @@ -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"); diff --git a/src/lib/global/constants.c b/src/lib/global/constants.c index e051fd780..442c604de 100644 --- a/src/lib/global/constants.c +++ b/src/lib/global/constants.c @@ -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 */ diff --git a/src/lib/player/accept.c b/src/lib/player/accept.c index f32548e0c..92b5456e5 100644 --- a/src/lib/player/accept.c +++ b/src/lib/player/accept.c @@ -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*/ -- 2.43.0