2 Copyright (c) 1993 Richard V. Nash.
3 Copyright (c) 2000 Dan Papasian
4 Copyright (C) Andrew Tridgell 2002
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., 675 Mass Ave, Cambridge, MA 02139, USA.
24 #define MAX_OBSERVE 30 /* max # of games one person can observe */
30 #define MAX_MESSAGES 40
31 #define MAX_INCHANNELS 16
33 #define PLAYER_EMPTY 0
35 #define PLAYER_INQUEUE 2
36 #define PLAYER_LOGIN 3
37 #define PLAYER_PASSWORD 4
38 #define PLAYER_PROMPT 5
48 GENSTRUCT struct statistics {
49 int num, win, los, dra, rating, ltime, best, whenbest;
53 GENSTRUCT struct simul_info_t {
56 int num_wins, num_draws, num_losses;
57 int boards[MAX_SIMUL];
61 #define PFLAG_OPEN 0x2
62 #define PFLAG_ROPEN 0x4
63 #define PFLAG_SIMOPEN 0x8
64 #define PFLAG_FLIP 0x10
65 #define PFLAG_ADMINLIGHT 0x20
66 #define PFLAG_RATED 0x40
67 #define PFLAG_BLACKSIDE 0x80 /* not done; replacing side. */
68 #define PFLAG_LASTBLACK 0x100
69 #define PFLAG_PIN 0x200
70 #define PFLAG_GIN 0x400
71 #define PFLAG_AVAIL 0x800 /* to be informed about who is available for games*/
72 #define PFLAG_PRIVATE 0x1000
73 #define PFLAG_JPRIVATE 0x2000
74 #define PFLAG_AUTOMAIL 0x4000
75 #define PFLAG_MAILMESS 0x8000
76 #define PFLAG_SHOUT 0x10000
77 #define PFLAG_CSHOUT 0x20000
78 #define PFLAG_TELL 0x40000
79 #define PFLAG_KIBITZ 0x80000
80 #define PFLAG_NOTIFYBY 0x100000
81 #define PFLAG_PGN 0x200000
82 #define PFLAG_BELL 0x400000
83 #define PFLAG_HIDEINFO 0x800000
84 #define PFLAG_TOURNEY 0x1000000 /* Not coded yet. */
85 #define PFLAG_ADS 0x2000000
86 /* Note: we're starting the last byte, assuming a long int has 4 bytes;
87 If we run out, we probably should make a Flag1 and a Flag2. */
89 #define PFLAG_DEFAULT (PFLAG_OPEN | PFLAG_ROPEN | PFLAG_SHOUT \
90 | PFLAG_CSHOUT | PFLAG_KIBITZ \
93 /* PFLAG_SAVED will make a good mask. */
94 #define PFLAG_SAVED (PFLAG_OPEN | PFLAG_ROPEN | PFLAG_RATED | PFLAG_BELL \
95 | PFLAG_PIN | PFLAG_GIN | PFLAG_AVAIL | PFLAG_PRIVATE \
96 | PFLAG_JPRIVATE | PFLAG_AUTOMAIL | PFLAG_MAILMESS \
97 | PFLAG_MAILMESS | PFLAG_SHOUT | PFLAG_CSHOUT \
98 | PFLAG_TELL | PFLAG_KIBITZ | PFLAG_NOTIFYBY | PFLAG_PGN)
100 GENSTRUCT struct player {
101 /* This first block is not saved between logins */
106 int opponent; /* Only valid if game is >= 0 */
107 int side; /* Only valid if game is >= 0 */
110 int ftell; /* Are you forwarding tells? -1 if not else who from */
112 int last_command_time;
114 int observe_list[MAX_OBSERVE];
115 struct in_addr thisHost;
118 struct simul_info_t *simul_info;
119 int num_comments; /* number of lines in comments file */
123 int number_pend_from; /* not really necessary but are used to cut down */
124 int number_pend_to; /* search - DAV */
125 struct ivariables ivariables;
128 /* this is a dummy variable used to tell which bits are saved in the structure */
129 unsigned not_saved_marker;
141 struct statistics s_stats;
142 struct statistics b_stats;
143 struct statistics w_stats;
144 struct statistics l_stats;
145 struct statistics bug_stats;
157 char *planLines[MAX_PLAN];
159 char *formulaLines[MAX_FORMULA];
163 struct in_addr lastHost;
165 struct alias_type *alias_list; _LEN(numAlias)
169 int admin_latest_news;
172 typedef struct textlist {
175 struct textlist *next;
178 #endif /* _PLAYERDB_H */