Crossfire Server, Branches 1.12  R18729
newserver.h
Go to the documentation of this file.
1 /*
2  * static char *rcsid_newserver_h =
3  * "$Id: newserver.h 11578 2009-02-23 22:02:27Z lalo $";
4  */
5 
6 /*
7  CrossFire, A Multiplayer game for X-windows
8 
9  Copyright (C) 2002 Mark Wedel & Crossfire Development Team
10  Copyright (C) 1992 Frank Tore Johansen
11 
12  This program is free software; you can redistribute it and/or modify
13  it under the terms of the GNU General Public License as published by
14  the Free Software Foundation; either version 2 of the License, or
15  (at your option) any later version.
16 
17  This program is distributed in the hope that it will be useful,
18  but WITHOUT ANY WARRANTY; without even the implied warranty of
19  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  GNU General Public License for more details.
21 
22  You should have received a copy of the GNU General Public License
23  along with this program; if not, write to the Free Software
24  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 
26  The author can be reached via e-mail to crossfire-devel@real-time.com
27 */
28 
37 #ifndef NEWSERVER_H
38 #define NEWSERVER_H
39 
44 #define MIN_NUM_LOOK_OBJECTS 3 /* 3=prev group, one object, next group */
45 
50 #define DEFAULT_NUM_LOOK_OBJECTS 50
51 
56 #define MAX_NUM_LOOK_OBJECTS 100
57 
62  int darkness;
63 };
64 
71 #define MAX_HEAD_OFFSET 8
72 
73 #define MAX_CLIENT_X (MAP_CLIENT_X+MAX_HEAD_OFFSET)
74 #define MAX_CLIENT_Y (MAP_CLIENT_Y+MAX_HEAD_OFFSET)
75 
77 struct Map {
79 };
80 
82 #define MAXANIMNUM 2000
83 
85 struct statsinfo {
86  char *range, *title;
87 };
88 
89 
97 };
98 
103 typedef struct buffer_struct {
105  int start;
106  int len;
107 } buffer_struct;
108 
110 #define MAX_PASSWORD_FAILURES 5
111 
115 typedef struct socket_struct {
117  int fd;
118  struct Map lastmap;
120  size_t faces_sent_len;
123  struct statsinfo stats;
125  char *host;
146  /* Below are flags for extedend infos to pass to client
147  * with S->C mapextended command (note: this comment seems incorrect?) */
153 } socket_struct;
154 
155 #define CLIENT_SUPPORT_READABLES(__sockPtr, __type)\
156  (((__type) > 0) && \
157  ((__sockPtr)->has_readable_type) && \
158  ((__sockPtr)->supported_readables&(1<<(__type))))
159 
164 #define NS_FACESENT_FACE 0x1
165 #define NS_FACESENT_SMOOTH 0x2
166 
167 #define FACE_TYPES 1
168 #define PNG_FACE_INDEX 0
169 
171 typedef struct Socket_Info {
172  struct timeval timeout;
174  int nconns;
176 } Socket_Info;
177 
178 extern Socket_Info socket_info;
179 
180 #define VERSION_CS 1023
181 #define VERSION_SC 1028
182 #define VERSION_INFO "Crossfire Server"
183 
184 #endif /* NEWSERVER_H */
signed char sint8
Definition: global.h:80
struct buffer_struct buffer_struct
uint8 num_look_objects
Definition: newserver.h:149
uint32 cs_version
Definition: newserver.h:141
uint32 can_write
Definition: newserver.h:132
Sock_Status
Definition: newserver.h:93
struct socket_struct socket_struct
uint32 tick
Definition: newserver.h:136
struct Map lastmap
Definition: newserver.h:118
struct Socket_Info Socket_Info
enum Sock_Status status
Definition: newserver.h:116
sint8 map_scroll_y
Definition: newserver.h:119
int max_filedescriptor
Definition: newserver.h:173
char * title
Definition: newserver.h:86
sint8 sounds_this_tick
Definition: newserver.h:148
uint32 sc_version
Definition: newserver.h:141
char * host
Definition: newserver.h:125
size_t faces_sent_len
Definition: newserver.h:120
uint32 sound
Definition: newserver.h:139
uint8 * faces_sent
Definition: newserver.h:121
buffer_struct outputbuffer
Definition: newserver.h:126
Socket_Info socket_info
Definition: init.c:63
uint32 has_readable_type
Definition: newserver.h:133
#define MAX_CLIENT_Y
Definition: newserver.h:74
Definition: newserver.h:77
#define SOCKETBUFSIZE
Definition: config.h:525
#define MAXANIMNUM
Definition: newserver.h:82
uint32 monitor_spells
Definition: newserver.h:135
#define MAP_LAYERS
Definition: map.h:60
sint8 map_scroll_x
Definition: newserver.h:119
uint32 is_bot
Definition: newserver.h:137
unsigned char uint8
Definition: global.h:75
uint32 facecache
Definition: newserver.h:128
char * range
Definition: newserver.h:86
int allocated_sockets
Definition: newserver.h:175
struct map_cell_struct cells[MAX_CLIENT_X][MAX_CLIENT_Y]
Definition: newserver.h:78
uint16 faces[MAP_LAYERS]
Definition: newserver.h:60
uint32 supported_readables
Definition: newserver.h:140
unsigned short uint16
Definition: global.h:67
uint16 look_position
Definition: newserver.h:142
#define MAX_CLIENT_X
Definition: newserver.h:73
uint32 darkness
Definition: newserver.h:130
uint32 update_look
Definition: newserver.h:131
struct timeval timeout
Definition: newserver.h:172
struct statsinfo stats
Definition: newserver.h:123
uint16 smooth[MAP_LAYERS]
Definition: newserver.h:61
uint32 newmapcmd
Definition: newserver.h:129
uint8 anims_sent[MAXANIMNUM]
Definition: newserver.h:122
unsigned int uint32
Definition: global.h:58
char data[SOCKETBUFSIZE]
Definition: newserver.h:104
uint8 password_fails
Definition: newserver.h:127
SockList inbuf
Definition: newserver.h:124
uint32 want_pickup
Definition: newserver.h:138
uint8 faceset
Definition: newserver.h:144