… | |
… | |
157 | } |
157 | } |
158 | |
158 | |
159 | client::~client () |
159 | client::~client () |
160 | { |
160 | { |
161 | if (pl) |
161 | if (pl) |
|
|
162 | { |
|
|
163 | pl->save (); |
|
|
164 | leave (pl, 1); |
162 | pl->ns = 0; |
165 | pl->ns = 0; |
|
|
166 | |
|
|
167 | delete pl; |
|
|
168 | } |
163 | |
169 | |
164 | if (fd >= 0) |
170 | if (fd >= 0) |
165 | close (fd); |
171 | close (fd); |
166 | |
172 | |
167 | sfree<uint8> (faces_sent, nrofpixmaps); |
173 | sfree<uint8> (faces_sent, nrofpixmaps); |
… | |
… | |
204 | void |
210 | void |
205 | free_all_newserver (void) |
211 | free_all_newserver (void) |
206 | { |
212 | { |
207 | LOG (llevDebug, "Freeing all new client/server information.\n"); |
213 | LOG (llevDebug, "Freeing all new client/server information.\n"); |
208 | free_socket_images (); |
214 | free_socket_images (); |
209 | } |
|
|
210 | |
|
|
211 | /** Sends the 'goodbye' command to the player, and closes connection. */ |
|
|
212 | void |
|
|
213 | final_free_player (player *pl) |
|
|
214 | { |
|
|
215 | free_player (pl); |
|
|
216 | } |
215 | } |
217 | |
216 | |
218 | client * |
217 | client * |
219 | client::create (int fd, const char *peername) |
218 | client::create (int fd, const char *peername) |
220 | { |
219 | { |