… | |
… | |
148 | { |
148 | { |
149 | client &socket = *pl->ns; |
149 | client &socket = *pl->ns; |
150 | object *ob = pl->ob; |
150 | object *ob = pl->ob; |
151 | char buf[MAX_BUF]; /* eauugggh */ |
151 | char buf[MAX_BUF]; /* eauugggh */ |
152 | |
152 | |
153 | if (socket.force_newmap) |
153 | if (socket.current_map != ob->map || socket.force_newmap) |
154 | { |
|
|
155 | // force newmap is used for clients that do not redraw their map |
|
|
156 | // after image uploads. |
|
|
157 | socket.current_map = ob->map; |
|
|
158 | clear_map (pl); |
|
|
159 | } |
|
|
160 | else if (socket.current_map != ob->map) |
|
|
161 | { |
154 | { |
162 | clear_map (pl); |
155 | clear_map (pl); |
163 | socket.current_map = ob->map; |
156 | socket.current_map = ob->map; |
164 | |
157 | |
165 | if (socket.mapinfocmd) |
158 | if (socket.mapinfocmd) |
… | |
… | |
505 | */ |
498 | */ |
506 | void |
499 | void |
507 | AskSmooth (char *buf, int len, client *ns) |
500 | AskSmooth (char *buf, int len, client *ns) |
508 | { |
501 | { |
509 | ns->send_face (atoi (buf)); |
502 | ns->send_face (atoi (buf)); |
|
|
503 | ns->flush_fx (); |
510 | } |
504 | } |
511 | |
505 | |
512 | /** |
506 | /** |
513 | * This handles the general commands from the client (ie, north, fire, cast, |
507 | * This handles the general commands from the client (ie, north, fire, cast, |
514 | * etc.) |
508 | * etc.) |
… | |
… | |
615 | |
609 | |
616 | switch (ns->state) |
610 | switch (ns->state) |
617 | { |
611 | { |
618 | case ST_PLAYING: |
612 | case ST_PLAYING: |
619 | LOG (llevError, "Got reply message with ST_PLAYING input state\n"); |
613 | LOG (llevError, "Got reply message with ST_PLAYING input state\n"); |
620 | break; |
|
|
621 | |
|
|
622 | case ST_CHANGE_CLASS: |
|
|
623 | key_change_class (pl->ob, buf[0]); |
|
|
624 | break; |
614 | break; |
625 | |
615 | |
626 | case ST_GET_PARTY_PASSWORD: /* Get password for party */ |
616 | case ST_GET_PARTY_PASSWORD: /* Get password for party */ |
627 | receive_party_password (pl->ob, 13); |
617 | receive_party_password (pl->ob, 13); |
628 | break; |
618 | break; |
… | |
… | |
1189 | |
1179 | |
1190 | mapspace &ms = m->at (nx, ny); |
1180 | mapspace &ms = m->at (nx, ny); |
1191 | |
1181 | |
1192 | if (socket.extmap) |
1182 | if (socket.extmap) |
1193 | { |
1183 | { |
1194 | uint8 stat_hp = 0; |
1184 | uint8 stat_hp = 0; |
1195 | uint8 stat_width = 0; |
1185 | uint8 stat_width = 0; |
1196 | uint8 flags = 0; |
1186 | uint8 flags = 0; |
1197 | UUID player = 0; |
1187 | tag_t player = 0; |
1198 | |
1188 | |
1199 | // send hp information, if applicable |
1189 | // send hp information, if applicable |
1200 | if (object *op = ms.faces_obj [0]) |
1190 | if (object *op = ms.faces_obj [0]) |
1201 | { |
1191 | { |
1202 | if (op->head || op->invisible) |
1192 | if (op->head || op->invisible) |
… | |
… | |
1243 | |
1233 | |
1244 | mask |= 0x8; |
1234 | mask |= 0x8; |
1245 | *last_ext |= 0x80; |
1235 | *last_ext |= 0x80; |
1246 | last_ext = &sl[sl.length ()]; |
1236 | last_ext = &sl[sl.length ()]; |
1247 | |
1237 | |
1248 | sl << uint8 (0x47) << uint8 (8) << (uint64)player; |
1238 | sl << uint8 (0x47) << uint8 (4) << (uint32)player; |
1249 | } |
1239 | } |
1250 | |
1240 | |
1251 | if (lastcell.flags != flags) |
1241 | if (lastcell.flags != flags) |
1252 | { |
1242 | { |
1253 | lastcell.flags = flags; |
1243 | lastcell.flags = flags; |
… | |
… | |
1326 | esl.reset (eoldlen); |
1316 | esl.reset (eoldlen); |
1327 | } |
1317 | } |
1328 | } /* else this is a viewable space */ |
1318 | } /* else this is a viewable space */ |
1329 | } /* for x loop */ |
1319 | } /* for x loop */ |
1330 | } /* for y loop */ |
1320 | } /* for y loop */ |
|
|
1321 | |
|
|
1322 | socket.flush_fx (); |
1331 | |
1323 | |
1332 | /* Verify that we in fact do need to send this */ |
1324 | /* Verify that we in fact do need to send this */ |
1333 | if (socket.ext_mapinfos) |
1325 | if (socket.ext_mapinfos) |
1334 | { |
1326 | { |
1335 | if (!(sl.length () > startlen || socket.sent_scroll)) |
1327 | if (!(sl.length () > startlen || socket.sent_scroll)) |