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

@ -77,9 +77,9 @@ player_main(struct player *p)
if (natp->nat_stat != STAT_GOD)
return;
}
if (natp->nat_stat == STAT_ACTIVE &&
natp->nat_timeused > m_m_p_d * 60) {
pr("Time exceeded today\n");
if ((natp->nat_stat == STAT_ACTIVE || natp->nat_stat == STAT_SANCT)
&& natp->nat_timeused > m_m_p_d * 60) {
pr("Max minutes per day limit exceeded.\n");
return;
}
if (natp->nat_stat != STAT_VIS
@ -137,8 +137,8 @@ command(void)
now = time(NULL);
update_timeused(now);
natp = getnatp(player->cnum);
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) {
pr("Max minutes per day limit exceeded.\n");
return 0;
}
@ -188,10 +188,10 @@ status(void)
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) {
pr("Max minutes per day limit exceeded.\n");
player->nstat = (player->nstat & ~NORM) | VIS;
return 0;
}
if (player->btused) {
natp->nat_btu -= player->btused;