… | |
… | |
118 | |
118 | |
119 | buflen = sizeof (oldbufsize); |
119 | buflen = sizeof (oldbufsize); |
120 | getsockopt (fd, SOL_SOCKET, SO_SNDBUF, (char *) &oldbufsize, (socklen_t *) & buflen); |
120 | getsockopt (fd, SOL_SOCKET, SO_SNDBUF, (char *) &oldbufsize, (socklen_t *) & buflen); |
121 | } |
121 | } |
122 | |
122 | |
|
|
123 | state = ST_SETUP; |
123 | mapmode = Map0Cmd; |
124 | mapmode = Map0Cmd; |
124 | darkness = 1; |
125 | darkness = 1; |
125 | mapx = 11; |
126 | mapx = 11; |
126 | mapy = 11; |
127 | mapy = 11; |
127 | itemcmd = 1; /* Default is version item1 command */ |
128 | itemcmd = 1; /* Default is version item1 command */ |
… | |
… | |
156 | } |
157 | } |
157 | |
158 | |
158 | client::~client () |
159 | client::~client () |
159 | { |
160 | { |
160 | if (pl) |
161 | if (pl) |
161 | pl->socket = 0; |
162 | pl->ns = 0; |
162 | |
163 | |
163 | if (fd >= 0) |
164 | if (fd >= 0) |
164 | close (fd); |
165 | close (fd); |
165 | |
166 | |
166 | sfree<uint8> (faces_sent, nrofpixmaps); |
167 | sfree<uint8> (faces_sent, nrofpixmaps); |
… | |
… | |
170 | } |
171 | } |
171 | |
172 | |
172 | void |
173 | void |
173 | client::destroy () |
174 | client::destroy () |
174 | { |
175 | { |
175 | destroyed = true; |
176 | INVOKE_CLIENT (DESTROY, this); |
|
|
177 | |
|
|
178 | state = ST_DEAD; |
176 | |
179 | |
177 | socket_ev.suspend (); |
180 | socket_ev.suspend (); |
178 | cmd_ev.suspend (); |
181 | cmd_ev.suspend (); |
179 | } |
182 | } |
180 | |
183 | |