Rewrite accounting of play time
Replace daychange() and gettimeleft() by update_timeused_login(), update_timeused() and enforce_minimum_session_time(). The new code doesn't assume the day is always 24 hours long which can occur when transitioning into or out of DST and such. Logging in after more a multiple of 128 days now resets nat_timeused properly. Fix nat_timeused calculation on midnight rollover to include the time since midnight. struct natstr member nat_dayno and struct player member timeleft are now unused, remove them.
This commit is contained in:
parent
f46dc55254
commit
875a80d14f
8 changed files with 69 additions and 74 deletions
|
@ -67,8 +67,7 @@ struct player {
|
|||
char *argp[128]; /* arguments, ASCII, valid if command */
|
||||
char *condarg; /* conditional, ASCII, valid if command */
|
||||
char *comtail[128]; /* start of args in combuf[] */
|
||||
time_t lasttime; /* when timeleft was last debited */
|
||||
int timeleft;
|
||||
time_t lasttime; /* when nat_timeused was last updated */
|
||||
int btused;
|
||||
int god;
|
||||
int owner;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue