… | |
… | |
101 | |
101 | |
102 | /* how many times we are allowed to give the wrong password before being kicked. */ |
102 | /* how many times we are allowed to give the wrong password before being kicked. */ |
103 | # define MAX_PASSWORD_FAILURES 5 |
103 | # define MAX_PASSWORD_FAILURES 5 |
104 | |
104 | |
105 | ACC_CLASS (client_socket) // should become player when newsocket is a baseclass of player |
105 | ACC_CLASS (client_socket) // should become player when newsocket is a baseclass of player |
106 | struct NewSocket : zero_initialised |
106 | struct client_socket : zero_initialised |
107 | { |
107 | { |
108 | enum Sock_Status status; |
108 | enum Sock_Status status; |
109 | int ACC (RW, fd); |
109 | int ACC (RW, fd); |
110 | unsigned int inbuf_len; // number of bytes valid in inbuf |
110 | unsigned int inbuf_len; // number of bytes valid in inbuf |
111 | struct Map lastmap; |
111 | struct Map lastmap; |
… | |
… | |
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 | |
155 | |
|
|
156 | client_socket (); |
|
|
157 | ~client_socket (); |
|
|
158 | void init (const char *from_ip); |
|
|
159 | |
156 | int read_packet (); // returns length of packet or 0 |
160 | int read_packet (); // returns length of packet or 0 |
157 | 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 |
158 | |
162 | |
159 | void send (void *buf_, int len); |
163 | void send (void *buf_, int len); |
160 | |
164 | |