From 4f1ebae4b7203be8dc71a5018a6d7cb44b5eff1e Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sun, 2 Oct 2005 17:01:15 +0000 Subject: [PATCH] (natstr): Member nat_connected is inappropriate, because it is transient server state, not persistent game state. Remove. (player_main, edit): Remove uses. (coun): Use getplayer() instead of nat_connected. Delete the message on command being out of order. --- include/nat.h | 1 - info/Commands/country.t | 16 ++++------------ src/lib/commands/add.c | 1 - src/lib/commands/coun.c | 4 +--- src/lib/commands/edit.c | 1 - src/lib/player/player.c | 2 -- 6 files changed, 5 insertions(+), 20 deletions(-) diff --git a/include/nat.h b/include/nat.h index d1bae7eb..4530af91 100644 --- a/include/nat.h +++ b/include/nat.h @@ -71,7 +71,6 @@ struct natstr { coord nat_xcap, nat_ycap; /* cap location in abs coords */ coord nat_xorg, nat_yorg; /* origin location in abs coords */ s_char nat_dayno; /* day of the year mod 128 */ - s_char nat_connected; /* connected or not? */ s_char nat_update; /* Want an update or not. */ u_char nat_missed; /* How many updates missed */ u_short nat_tgms; /* # of telegrams to be announced */ diff --git a/info/Commands/country.t b/info/Commands/country.t index 9d35f7c7..ea30fd38 100644 --- a/info/Commands/country.t +++ b/info/Commands/country.t @@ -1,19 +1,11 @@ .TH Command COUNTRY -.NA country "Find out information about deity countries" +.NA country "Find out country status" .LV Expert .SY "country " - -The country command is temporarily out of order. -Please use the 'players' command instead. - -The country command displays a list of the countries you specify, -their numb, their last access time, their btu's, and their status. +The country command displays status of the countries you specify. .s1 -If you are \*QNOT\*U a deity, the country command will report on only -deity countries. (So that you can see if a deity is logged on) -Deity countries get the full report. Note that "Now logged on" is -often incorrect, and deities are recommended to use the new command -"players" to list players currently logged on. +Unless you are a deity, the country command will report only on +deity countries. .s1 .EX country * .NF diff --git a/src/lib/commands/add.c b/src/lib/commands/add.c index aa2df5c7..0f6bd15e 100644 --- a/src/lib/commands/add.c +++ b/src/lib/commands/add.c @@ -203,7 +203,6 @@ add(void) *natp->nat_hostname = '\0'; *natp->nat_userid = '\0'; natp->nat_btu = 0; - natp->nat_connected = 0; natp->nat_reserve = 0; natp->nat_tgms = 0; natp->nat_ystart = 0; diff --git a/src/lib/commands/coun.c b/src/lib/commands/coun.c index 96f643f8..c83e4367 100644 --- a/src/lib/commands/coun.c +++ b/src/lib/commands/coun.c @@ -52,8 +52,6 @@ coun(void) struct natstr nat; int first; - pr("The 'country' command is temporarily out of order.\n"); - pr("Please use the 'players' command instead.\n"); if (!snxtitem(&ni, EF_NATION, player->argp[1])) return RET_SYN; first = 1; @@ -84,7 +82,7 @@ coun_list(natid cn, struct natstr *natp) s_char *status; struct sctstr sect; - if (natp->nat_connected) + if (getplayer(cn)) pr("%3d %-16.16s [%d]", cn, " Now logged on", natp->nat_btu); else pr("%3d %-16.16s [%d]", cn, ctime(&natp->nat_last_login), diff --git a/src/lib/commands/edit.c b/src/lib/commands/edit.c index f7757250..6a111896 100644 --- a/src/lib/commands/edit.c +++ b/src/lib/commands/edit.c @@ -314,7 +314,6 @@ prnat(natid n) return; pr("Country #: %2d\n", n); pr("Name : %-20s\t", np->nat_cnam); - pr("Connected: %d\n", np->nat_connected); pr("Representative : %-20s\n", np->nat_pnam); pr("BTUs : %3d\t\t\t", np->nat_btu); pr("Reserves : %5ld\n", np->nat_reserve); diff --git a/src/lib/player/player.c b/src/lib/player/player.c index 034ed7b4..aef6cd8c 100644 --- a/src/lib/player/player.c +++ b/src/lib/player/player.c @@ -123,7 +123,6 @@ player_main(struct player *p) strcpy(natp->nat_hostaddr, player->hostaddr); time(&natp->nat_last_login); - natp->nat_connected = 1; putnat(natp); if (natp->nat_flags & NF_INFORM && natp->nat_tgms > 0) { if (natp->nat_tgms == 1) @@ -152,7 +151,6 @@ player_main(struct player *p) secs = secs % 60; if (chance(secs / 60.0)) natp->nat_minused += 1; - natp->nat_connected = 0; putnat(natp); pr("Bye-bye\n"); }