]> git.pond.sub.org Git - empserver/blob - include/player.h
Supply prototypes where possible. This uncovered type errors with
[empserver] / include / player.h
1 /*
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
5  *
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.
10  *
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.
15  *
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
19  *
20  *  ---
21  *
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.
25  *
26  *  ---
27  *
28  *  player.h: Definitions for player information (threads)
29  * 
30  *  Known contributors to this file:
31  *     Dave Pare, 1994
32  *     Doug Hay, 1998
33  */
34
35 #ifndef _PLAYER_H_
36 #define _PLAYER_H_
37
38 #include <sys/types.h>
39 #if !defined(_WIN32)
40 #include <netinet/in.h>
41 #endif
42 #include "queue.h"
43 #include "misc.h"
44 #include "com.h"
45 #include "empthread.h"
46
47 struct player {
48     struct emp_qelem queue;
49     empth_t *proc;
50     s_char hostaddr[32];
51     s_char hostname[512];
52     s_char client[128];
53     s_char userid[32];
54     int validated;
55     natid cnum;
56     int state;
57     struct cmndstr *command;
58     struct iop *iop;
59     s_char combuf[1024];
60     s_char *argp[128];
61     s_char *condarg;
62     time_t lasttime;
63     int ncomstat;
64     int minleft;
65     int btused;
66     int visitor;
67     int god;
68     int owner;
69     int nstat;
70     int waiting;
71     int simulation;             /* e.g. budget command */
72     double dolcost;
73     int broke;
74     time_t curup;               /* used in calc of minutes used */
75     int aborted;
76     int curid;                  /* for pr, cur. line's id, -1 none */
77     int blitz_time;
78     char *map;                  /* pointer to in-mem map */
79     char *bmap;                 /* pointer to in-mem bmap */
80 };
81
82 #define PS_INIT         0
83 #define PS_LOGIN        1
84 #define PS_PLAYING      2
85 #define PS_SHUTDOWN     3
86 #define PS_KILL         4
87
88 /* thread priorities */
89 #define PP_UPDATE       6
90 #define PP_SHUTDOWN     5
91 #define PP_SCHED        4
92 #define PP_TIMESTAMP    2
93 #define PP_PLAYER       3
94 #define PP_ACCEPT       3
95 #define PP_KILLIDLE     2
96
97 #include "prototypes.h"         /* must come at end, after defines and typedefs */
98
99 #endif /* _PLAYER_H_ */