Log out player when time per day is exceeded

Commit 3da4030 already changed player_main() to log out the player
when m_m_p_d was exceeded in command().  This crept in accidentally.
Complete the job by changing status() to log out the player instead of
downgrading him to visitor status.

Also, change player_main(), command() and status() to apply the time
limit to countries in sanctuary in addition to active countries.
Leave visitors alone, because those are shared logins.  Make the
disconnect message to a player consistent for all situations.

Note that commit 875a80d1 already changed player_main() to apply the
time limit only to active countries instead of all, just like status()
does, but neglected to document that.
This commit is contained in:
Ron Koenderink 2008-11-16 08:42:42 -06:00 committed by Markus Armbruster
parent 9fe6f7a406
commit 344e91bbb9
2 changed files with 12 additions and 12 deletions

View file

@ -780,7 +780,7 @@ index 3106849..726b5fc 100644
return lp;
}
diff --git a/src/lib/player/player.c b/src/lib/player/player.c
index 9912ba1..9dd8c5b 100644
index 811e1d4..d08ac40 100644
--- a/src/lib/player/player.c
+++ b/src/lib/player/player.c
@@ -40,6 +40,7 @@
@ -817,7 +817,7 @@ index 9912ba1..9dd8c5b 100644
+ now = empire_time(NULL);
update_timeused(now);
natp = getnatp(player->cnum);
if (natp->nat_stat == STAT_ACTIVE &&
if ((natp->nat_stat == STAT_ACTIVE || natp->nat_stat == STAT_SANCT)
@@ -186,7 +187,7 @@ status(void)
if (!(old_nstat & MONEY) && (player->nstat & MONEY))
pr("You are no longer broke!\n");
@ -825,8 +825,8 @@ index 9912ba1..9dd8c5b 100644
- time(&player->curup);
+ empire_time(&player->curup);
update_timeused(player->curup);
if (natp->nat_stat == STAT_ACTIVE &&
natp->nat_timeused > m_m_p_d * 60) {
if ((natp->nat_stat == STAT_ACTIVE || natp->nat_stat == STAT_SANCT)
&& natp->nat_timeused > m_m_p_d * 60) {
diff --git a/src/lib/player/recvclient.c b/src/lib/player/recvclient.c
index ab4ef69..8934189 100644
--- a/src/lib/player/recvclient.c