2 * Empire - A multi-player, client/server Internet based war game.
3 * Copyright (C) 1986-2000, Dave Pare, Jeff Bailey, Thomas Ruschak,
4 * Ken Stevens, Steve McClure
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 * See the "LEGAL", "LICENSE", "CREDITS" and "README" files for all the
23 * related information and legal notices. It is expected that any future
24 * projects/authors will amend these files as needed.
28 * play.c: Who is logged on?
30 * Known contributors to this file:
42 static void play_header(void);
43 static int play_list(struct player *joe);
52 for (joe = player_prev(0); joe; joe = player_prev(joe)) {
55 saw += play_list(joe);
57 if (player->god || opt_BLITZ)
58 pr("%d player%s\n", count, splur(count));
67 pr("%9s %3s %-32s %5s %5s %-20s\n",
78 play_list(struct player *joe)
85 if (joe->cnum >= MAXNOC ||
86 !(natp = getnatp(joe->cnum)))
89 us = getnatp(player->cnum);
91 /* We are a god, we see everything */
92 } else if (opt_BLITZ) {
93 /* It's a blitz, we see everything */
94 } else if (joe->god) {
95 /* This country is a god, so we see it */
96 } else if (us->nat_stat == VIS) {
97 /* We are a visitor country, we can't see squat, except deities */
99 } else if (joe->cnum != player->cnum) {
100 /* This isn't us. Can we see it? */
101 if (natp->nat_stat == VIS) {
102 /* Yes, we can see visitors are logged on */
103 } else if (getrel(natp, player->cnum) < ALLIED) {
104 /* This is a non-allied country, don't show it. */
111 if (!joe->combuf || !*joe->combuf)
119 pr("%-9.9s %3d %32.32s %2d:%02d %4ds %-20.20s\n",
122 (player->god || joe->cnum == player->cnum)?praddr(joe):(s_char *)"",
123 natp->nat_minused / 60, natp->nat_minused % 60,