Crossfire Server, Trunk  R20576
Go to the documentation of this file.
9 #ifndef NEWSERVER_H
10 #define NEWSERVER_H
16 #define MIN_NUM_LOOK_OBJECTS 3 /* 3=prev group, one object, next group */
28 #define MAX_NUM_LOOK_OBJECTS 100
33  int darkness;
34 };
42 #define MAX_HEAD_OFFSET 8
48 struct Map {
50 };
53 #define MAXANIMNUM 2000
56 struct statsinfo {
57  char *range, *title;
58 };
68 };
75 struct listen_info {
76  int family;
77  int socktype;
78  int protocol;
80  struct sockaddr *addr;
81 };
87 typedef struct buffer_struct {
88  char data[SOCKETBUFSIZE];
89  int start;
90  int len;
99 typedef struct socket_struct {
100  enum Sock_Status status;
101  int fd;
103  struct Map lastmap;
104  int8_t map_scroll_x, map_scroll_y;
105  size_t faces_sent_len;
107  uint8_t anims_sent[MAXANIMNUM];
108  struct statsinfo stats;
110  char *host;
124  bool heartbeat;
125  uint32_t cs_version, sc_version;
128  uint8_t mapx, mapy;
131  /* Below are flags for extedend infos to pass to client
132  * with S->C mapextended command (note: this comment seems incorrect?) */
138  char *account_name;
143 } socket_struct;
149 #define NS_FACESENT_FACE 0x1
150 #define NS_FACESENT_SMOOTH 0x2
153 typedef struct Socket_Info {
154  struct timeval timeout;
157 } Socket_Info;
159 extern Socket_Info socket_info;
161 #define VERSION_CS 1023
162 #define VERSION_SC 1029
163 #define VERSION_INFO "Crossfire Server"
165 #endif /* NEWSERVER_H */
uint8_t login_method
Login method this client is using.
Definition: newserver.h:140
uint8_t faceset
Set the client is using, default 0.
Definition: newserver.h:129
struct buffer_struct buffer_struct
The following is the setup for a ring buffer for storing outbut data that the OS can't handle right a...
uint32_t tick
Client wishes to get tick commands.
Definition: newserver.h:118
uint32_t want_pickup
Client wants pickup information when logging in.
Definition: newserver.h:120
char * account_name
Name of the account logged in on this socket.
Definition: newserver.h:138
What state a socket is in.
Definition: newserver.h:64
unsigned char uint8_t
Definition: win32.h:161
int protocol
Definition: newserver.h:78
uint16_t look_position
Start of drawing of look window.
Definition: newserver.h:126
uint32_t last_tick
Number of ticks since last communication.
Definition: newserver.h:142
struct socket_struct socket_struct
Socket structure, represents a client-server connection.
Socket structure, represents a client-server connection.
Definition: newserver.h:99
struct sockaddr * addr
Definition: newserver.h:80
bool heartbeat
Client will send hearbeats.
Definition: newserver.h:124
struct Socket_Info Socket_Info
Holds some system-related information.
int8_t sounds_this_tick
Number of sounds sent this tick.
Definition: newserver.h:133
uint16_t container_position
Start of container contents to send to client.
Definition: newserver.h:127
#define socklen_t
Definition: win32.h:130
int max_filedescriptor
max filedescriptor on the system.
Definition: newserver.h:155
char * title
Definition: newserver.h:57
One map cell, as sent to the client.
Definition: newserver.h:31
int socktype
Definition: newserver.h:77
char * host
Which host it is connected from (ip address).
Definition: newserver.h:110
socklen_t addrlen
Definition: newserver.h:79
uint16_t notifications
Notifications this client wants to get.
Definition: newserver.h:141
size_t faces_sent_len
This is the number of elements allocated in faces_sent[].
Definition: newserver.h:105
uint32_t update_look
If true, we need to send the look window.
Definition: newserver.h:115
uint32_t facecache
If true, client is caching images.
Definition: newserver.h:113
buffer_struct outputbuffer
For undeliverable data.
Definition: newserver.h:111
uint32_t sound
Client sound mode.
Definition: newserver.h:123
Socket_Info socket_info
Socket information.
Definition: init.c:47
Account_Char * account_chars
Detailed information on characters on this account.
Definition: newserver.h:139
uint8_t num_look_objects
The maximum number of objects to show on the ground view; this number includes the prev/next group fa...
Definition: newserver.h:134
Holds some system-related information.
Definition: newserver.h:153
Contains the last range/title information sent to client.
Definition: newserver.h:56
#define MAX_CLIENT_Y
Definition: newserver.h:45
One map for a player.
Definition: newserver.h:48
SOCKETBUFSIZE is the size of the buffer used internally by the server for storing backlogged messages...
Definition: config.h:521
True max is 16383 given current map compaction method.
Definition: newserver.h:53
#define MAP_LAYERS
Definition: map.h:32
int8_t map_scroll_y
Definition: newserver.h:104
uint32_t sc_version
Versions of the client.
Definition: newserver.h:125
Contains parameters for socket() and bind() for listening sockets.
Definition: newserver.h:75
One character account.
Definition: account_char.h:26
The following is the setup for a ring buffer for storing outbut data that the OS can't handle right a...
Definition: newserver.h:87
uint32_t can_write
Can we write to this socket?
Definition: newserver.h:117
uint32_t update_inventory
If true, we need to send the inventory list.
Definition: newserver.h:116
int allocated_sockets
Number of allocated items in init_sockets.
Definition: newserver.h:156
uint32_t is_bot
Client shouldn't be reported to metaserver.
Definition: newserver.h:119
uint32_t extended_stats
Client wants base and maximum statistics information.
Definition: newserver.h:121
unsigned short uint16_t
Definition: win32.h:163
#define MAX_CLIENT_X
Definition: newserver.h:44
unsigned int uint32_t
Definition: win32.h:162
uint32_t darkness
True if client wants darkness information.
Definition: newserver.h:114
uint8_t password_fails
How many times the player has failed to give the right password.
Definition: newserver.h:112
signed char int8_t
Type definitions for fixed-size integer types.
Definition: win32.h:158
int darkness
Cell's darkness.
Definition: newserver.h:33
uint32_t monitor_spells
Client wishes to be informed when their spell list changes.
Definition: newserver.h:122
int family
Definition: newserver.h:76
Contains the base information we use to make up a packet we want to send.
Definition: newclient.h:680
uint8_t mapy
How large a map the client wants.
Definition: newserver.h:128
struct listen_info * listen
Definition: newserver.h:102
uint8_t * faces_sent
This is a bitmap on sent face status.
Definition: newserver.h:106
uint16_t faces[MAP_LAYERS]
Face numbers.
Definition: newserver.h:32
SockList inbuf
If we get an incomplete packet, this is used to hold the data.
Definition: newserver.h:109