(add): Initialize nat_last_login and nat_last_logout to zero rather

than current time.  Nation addition time is irrelevant.
(natstr): Document zero nat_last_login, nat_last_login mean never
logged in/out.
(player_main): Test nat_last_login zero instead of nat_hostaddr empty.

(player_main): Assign nat_userid, nat_hostname, nat_hostaddr straight
from player.  The last connection's host is now shown as dotted quads
instead of nowhere when the name isn't known.
(natstr): Document that nat_userid, nat_hostname may be empty.

(player_main): Simplify printing last connection address: nat_hostaddr
can't be empty here; don't bother to substitute "nobody" for empty
user.
This commit is contained in:
Markus Armbruster 2005-10-03 13:25:54 +00:00
parent 95d2b48ee2
commit f94f81ee16
3 changed files with 19 additions and 33 deletions

View file

@ -214,8 +214,7 @@ add(void)
natp->nat_dayno = 0;
natp->nat_minused = 0;
memset(natp->nat_b, 0, sizeof(natp->nat_b));
(void)time(&natp->nat_last_login);
(void)time(&natp->nat_last_logout);
natp->nat_last_login = natp->nat_last_login = 0;
natp->nat_money = 0;
natp->nat_level[NAT_TLEV] = start_technology;
natp->nat_level[NAT_RLEV] = start_research;