1 | /* |
1 | /* |
2 | CrossFire, A Multiplayer game for X-windows |
2 | CrossFire, A Multiplayer game for X-windows |
3 | |
3 | |
|
|
4 | Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team |
4 | Copyright (C) 2001 Mark Wedel |
5 | Copyright (C) 2001 Mark Wedel |
5 | Copyright (C) 1992 Frank Tore Johansen |
6 | Copyright (C) 1992 Frank Tore Johansen |
6 | |
7 | |
7 | This program is free software; you can redistribute it and/or modify |
8 | This program is free software; you can redistribute it and/or modify |
8 | it under the terms of the GNU General Public License as published by |
9 | it under the terms of the GNU General Public License as published by |
… | |
… | |
162 | #endif |
163 | #endif |
163 | } |
164 | } |
164 | |
165 | |
165 | client::~client () |
166 | client::~client () |
166 | { |
167 | { |
|
|
168 | sockvec::iterator i = find (clients.begin (), clients.end (), this); |
|
|
169 | if (i != clients.end ()) |
|
|
170 | clients.erase (i); |
|
|
171 | |
167 | sfree<uint8> (faces_sent, nrofpixmaps); |
172 | sfree<uint8> (faces_sent, nrofpixmaps); |
168 | free (stats.range); |
173 | free (stats.range); |
169 | free (stats.title); |
174 | free (stats.title); |
170 | free (host); |
175 | free (host); |
171 | } |
176 | } |
172 | |
177 | |
173 | void |
178 | void |
174 | client::do_destroy () |
179 | client::do_destroy () |
175 | { |
180 | { |
176 | attachable::do_destroy (); |
181 | attachable::do_destroy (); |
177 | |
|
|
178 | sockvec::iterator i = find (clients.begin (), clients.end (), this); |
|
|
179 | if (i != clients.end ()) |
|
|
180 | clients.erase (i); |
|
|
181 | |
182 | |
182 | if (pl) |
183 | if (pl) |
183 | pl->disconnect (); |
184 | pl->disconnect (); |
184 | |
185 | |
185 | if (fd >= 0) |
186 | if (fd >= 0) |