]> git.pond.sub.org Git - empserver/blob - include/player.h
Indented with src/scripts/indent-emp.
[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 "prototype.h"
43 #include "queue.h"
44 #include "misc.h"
45 #include "com.h"
46 #include "empthread.h"
47
48 struct player {
49     struct emp_qelem queue;
50     empth_t *proc;
51     s_char hostaddr[32];
52     s_char hostname[512];
53     s_char client[128];
54     s_char userid[32];
55     int validated;
56     natid cnum;
57     int state;
58     struct cmndstr *command;
59     struct iop *iop;
60     s_char combuf[1024];
61     s_char *argp[128];
62     s_char *condarg;
63     time_t lasttime;
64     int ncomstat;
65     int minleft;
66     int btused;
67     int visitor;
68     int god;
69     int owner;
70     int nstat;
71     int waiting;
72     int simulation;             /* e.g. budget command */
73     double dolcost;
74     int broke;
75     time_t curup;               /* used in calc of minutes used */
76     int aborted;
77     int curid;                  /* for pr, cur. line's id, -1 none */
78     int blitz_time;
79     char *map;                  /* pointer to in-mem map */
80     char *bmap;                 /* pointer to in-mem bmap */
81 };
82
83 #define PS_INIT         0
84 #define PS_LOGIN        1
85 #define PS_PLAYING      2
86 #define PS_SHUTDOWN     3
87 #define PS_KILL         4
88
89 /* thread priorities */
90 #define PP_UPDATE       6
91 #define PP_SHUTDOWN     5
92 #define PP_SCHED        4
93 #define PP_TIMESTAMP    2
94 #define PP_PLAYER       3
95 #define PP_ACCEPT       3
96 #define PP_KILLIDLE     2
97
98 #include "prototypes.h"         /* must come at end, after defines and typedefs */
99
100 #endif /* _PLAYER_H_ */