… | |
… | |
150 | int ACC (RW, current_x), ACC (RW, current_y); // CF+ last/current map position |
150 | int ACC (RW, current_x), ACC (RW, current_y); // CF+ last/current map position |
151 | char ACC (RW, client)[64]; // CF+ client name/version |
151 | char ACC (RW, client)[64]; // CF+ client name/version |
152 | |
152 | |
153 | /* If we get an incomplete packet, this is used to hold the data. */ |
153 | /* If we get an incomplete packet, this is used to hold the data. */ |
154 | uint8 inbuf[MAXSOCKBUF]; |
154 | uint8 inbuf[MAXSOCKBUF]; |
|
|
155 | player *pl;//TODO should not be here, preferably |
155 | |
156 | |
156 | client_socket (); |
157 | client_socket (int fd, const char *from_ip); |
157 | ~client_socket (); |
158 | ~client_socket (); |
158 | void init (const char *from_ip); |
|
|
159 | |
159 | |
160 | int read_packet (); // returns length of packet or 0 |
160 | int read_packet (); // returns length of packet or 0 |
161 | void skip_packet (int len); // we have processed the packet, skip it |
161 | void skip_packet (int len); // we have processed the packet, skip it |
162 | |
162 | |
163 | void send (void *buf_, int len); |
163 | void send (void *buf_, int len); |
… | |
… | |
205 | #define EMI_HASMOREBITS 0x80 |
205 | #define EMI_HASMOREBITS 0x80 |
206 | |
206 | |
207 | #define FACE_TYPES 1 |
207 | #define FACE_TYPES 1 |
208 | #define PNG_FACE_INDEX 0 |
208 | #define PNG_FACE_INDEX 0 |
209 | |
209 | |
210 | struct Socket_Info |
|
|
211 | { |
|
|
212 | struct timeval timeout; /* Timeout for select */ |
|
|
213 | int max_filedescriptor; /* max filedescriptor on the system */ |
|
|
214 | int nconns; /* Number of connections */ |
|
|
215 | int allocated_sockets; /* number of allocated in init_sockets */ |
|
|
216 | }; |
|
|
217 | |
|
|
218 | extern Socket_Info socket_info; |
|
|
219 | |
|
|
220 | #define VERSION_CS 1023 /* version >= 1023 understand setup cmd */ |
210 | #define VERSION_CS 1023 /* version >= 1023 understand setup cmd */ |
221 | #define VERSION_SC 1027 |
211 | #define VERSION_SC 1027 |
222 | #define VERSION_INFO "Crossfire+ Server" |
212 | #define VERSION_INFO "Crossfire+ Server" |
223 | |
213 | |
|
|
214 | typedef unordered_vector<client_socket *> sockvec; |
|
|
215 | |
|
|
216 | extern sockvec client_sockets; |
|
|
217 | extern int nrofpixmaps; //TODO: hrmpf, should go |
|
|
218 | |
224 | #endif |
219 | #endif |
225 | |
220 | |