2 Copyright (C) Andrew Tridgell 2002
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 handle 'follow' lists. These are a little different to FICS in that they are persistent
21 (ie. they are more similar to the personal gnotify list)
27 a game has started between p1 and p2
28 anyone who has either player in their personal follow list will now send an
29 effective 'observe' command if they are idle
31 void follow_start(int p1,int p2)
34 for (p = 0; p < player_globals.p_num; p++) {
35 struct player *pp = &player_globals.parray[p];
38 /* don't follow ourselves */
39 if ((p == p1) || (p == p2)) {
43 /* don't follow while playing, examining etc */
44 if (pp->status != PLAYER_PROMPT) {
48 /* see if either player is in our follow list */
49 in1 = in_list(p, L_FOLLOW, player_globals.parray[p1].login);
51 in2 = in_list(p, L_FOLLOW, player_globals.parray[p2].login);
54 if (in1 == 0 && in2 == 0) {
58 /* fake up an observe command */
59 pcommand(p, "observe %s\n", player_globals.parray[in1?p1:p2].login);