… | |
… | |
83 | |
83 | |
84 | if (!pl || (pl->type == PLAYER && pl->contr == NULL)) |
84 | if (!pl || (pl->type == PLAYER && pl->contr == NULL)) |
85 | return; |
85 | return; |
86 | |
86 | |
87 | if (pl->type == PLAYER) |
87 | if (pl->type == PLAYER) |
88 | esrv_print_msg (pl->contr->socket, colr, (char *) tmp); |
88 | esrv_print_msg (pl->contr->ns, colr, (char *) tmp); |
89 | } |
89 | } |
90 | |
90 | |
91 | /** |
91 | /** |
92 | * Prints out the contents of specified buffer structures, |
92 | * Prints out the contents of specified buffer structures, |
93 | * and clears the string. |
93 | * and clears the string. |
… | |
… | |
187 | { |
187 | { |
188 | if (flags & NDI_ALL) |
188 | if (flags & NDI_ALL) |
189 | { |
189 | { |
190 | player *tmppl; |
190 | player *tmppl; |
191 | |
191 | |
192 | for (tmppl = first_player; tmppl != NULL; tmppl = tmppl->next) |
192 | for_all_players (pl) |
193 | new_draw_info ((flags & ~NDI_ALL), pri, tmppl->ob, buf); |
193 | new_draw_info ((flags & ~NDI_ALL), pri, tmppl->ob, buf); |
194 | |
194 | |
195 | return; |
195 | return; |
196 | } |
196 | } |
197 | |
197 | |
… | |
… | |
247 | return; |
247 | return; |
248 | |
248 | |
249 | if (pri >= pl->contr->listening) |
249 | if (pri >= pl->contr->listening) |
250 | return; |
250 | return; |
251 | |
251 | |
252 | if (!CLIENT_SUPPORT_READABLES (pl->contr->socket, type)) |
252 | if (!CLIENT_SUPPORT_READABLES (pl->contr->ns, type)) |
253 | { |
253 | { |
254 | char *buf = (char *) malloc (strlen (oldmessage == NULL ? message : oldmessage) + 1); |
254 | char *buf = (char *) malloc (strlen (oldmessage == NULL ? message : oldmessage) + 1); |
255 | |
255 | |
256 | if (buf == NULL) |
256 | if (buf == NULL) |
257 | LOG (llevError, "info::draw_ext_info -> Out of memory!"); |
257 | LOG (llevError, "info::draw_ext_info -> Out of memory!"); |
… | |
… | |
262 | new_draw_info (flags, pri, pl, buf); |
262 | new_draw_info (flags, pri, pl, buf); |
263 | free (buf); |
263 | free (buf); |
264 | } |
264 | } |
265 | } |
265 | } |
266 | else |
266 | else |
267 | esrv_print_ext_msg (pl->contr->socket, flags & NDI_COLOR_MASK, type, subtype, message); |
267 | esrv_print_ext_msg (pl->contr->ns, flags & NDI_COLOR_MASK, type, subtype, message); |
268 | } |
268 | } |
269 | |
269 | |
270 | void |
270 | void |
271 | draw_ext_info_format (int flags, int pri, const object *pl, uint8 type, uint8 subtype, const char *old_format, char *new_format, ...) |
271 | draw_ext_info_format (int flags, int pri, const object *pl, uint8 type, uint8 subtype, const char *old_format, char *new_format, ...) |
272 | { |
272 | { |
… | |
… | |
277 | return; |
277 | return; |
278 | |
278 | |
279 | if (pri >= pl->contr->listening) |
279 | if (pri >= pl->contr->listening) |
280 | return; |
280 | return; |
281 | |
281 | |
282 | if (!CLIENT_SUPPORT_READABLES (pl->contr->socket, type)) |
282 | if (!CLIENT_SUPPORT_READABLES (pl->contr->ns, type)) |
283 | { |
283 | { |
284 | va_list ap; |
284 | va_list ap; |
285 | |
285 | |
286 | LOG (llevDebug, "Non supported extension text type for client.\n"); |
286 | LOG (llevDebug, "Non supported extension text type for client.\n"); |
287 | va_start (ap, new_format); |
287 | va_start (ap, new_format); |
… | |
… | |
296 | |
296 | |
297 | va_start (ap, new_format); |
297 | va_start (ap, new_format); |
298 | vsnprintf (buf, HUGE_BUF, new_format, ap); |
298 | vsnprintf (buf, HUGE_BUF, new_format, ap); |
299 | va_end (ap); |
299 | va_end (ap); |
300 | strip_media_tag (buf); |
300 | strip_media_tag (buf); |
301 | esrv_print_ext_msg (pl->contr->socket, flags & NDI_COLOR_MASK, type, subtype, buf); |
301 | esrv_print_ext_msg (pl->contr->ns, flags & NDI_COLOR_MASK, type, subtype, buf); |
302 | } |
302 | } |
303 | } |
303 | } |
304 | |
304 | |
305 | /** |
305 | /** |
306 | * Writes to everyone on the map *except* op. This is useful for emotions. |
306 | * Writes to everyone on the map *except* op. This is useful for emotions. |
… | |
… | |
309 | void |
309 | void |
310 | new_info_map_except (int color, maptile * map, object *op, const char *str) |
310 | new_info_map_except (int color, maptile * map, object *op, const char *str) |
311 | { |
311 | { |
312 | player *pl; |
312 | player *pl; |
313 | |
313 | |
314 | for (pl = first_player; pl != NULL; pl = pl->next) |
314 | for_all_players (pl) |
315 | if (pl->ob != NULL && pl->ob->map == map && pl->ob != op) |
315 | if (pl->ob != NULL && pl->ob->map == map && pl->ob != op) |
316 | { |
316 | { |
317 | new_draw_info (color, 0, pl->ob, str); |
317 | new_draw_info (color, 0, pl->ob, str); |
318 | } |
318 | } |
319 | } |
319 | } |
… | |
… | |
325 | void |
325 | void |
326 | new_info_map_except2 (int color, maptile * map, object *op1, object *op2, const char *str) |
326 | new_info_map_except2 (int color, maptile * map, object *op1, object *op2, const char *str) |
327 | { |
327 | { |
328 | player *pl; |
328 | player *pl; |
329 | |
329 | |
330 | for (pl = first_player; pl != NULL; pl = pl->next) |
330 | for_all_players (pl) |
331 | if (pl->ob != NULL && pl->ob->map == map && pl->ob != op1 && pl->ob != op2) |
331 | if (pl->ob != NULL && pl->ob->map == map && pl->ob != op1 && pl->ob != op2) |
332 | { |
332 | { |
333 | new_draw_info (color, 0, pl->ob, str); |
333 | new_draw_info (color, 0, pl->ob, str); |
334 | } |
334 | } |
335 | } |
335 | } |
… | |
… | |
341 | void |
341 | void |
342 | new_info_map (int color, maptile * map, const char *str) |
342 | new_info_map (int color, maptile * map, const char *str) |
343 | { |
343 | { |
344 | player *pl; |
344 | player *pl; |
345 | |
345 | |
346 | for (pl = first_player; pl != NULL; pl = pl->next) |
346 | for_all_players (pl) |
347 | if (pl->ob != NULL && pl->ob->map == map) |
347 | if (pl->ob != NULL && pl->ob->map == map) |
348 | { |
348 | { |
349 | new_draw_info (color, 0, pl->ob, str); |
349 | new_draw_info (color, 0, pl->ob, str); |
350 | } |
350 | } |
351 | } |
351 | } |
… | |
… | |
614 | |
614 | |
615 | for (int y = ymin; y <= ymax; y++) |
615 | for (int y = ymin; y <= ymax; y++) |
616 | for (int x = xmin; x <= xmax; x++) |
616 | for (int x = xmin; x <= xmax; x++) |
617 | sl << uint8 (map_mark[x + MAGIC_MAP_SIZE * y] & ~FACE_FLOOR); |
617 | sl << uint8 (map_mark[x + MAGIC_MAP_SIZE * y] & ~FACE_FLOOR); |
618 | |
618 | |
619 | pl->contr->socket->send_packet (sl); |
619 | pl->contr->ns->send_packet (sl); |
620 | |
620 | |
621 | free (map_mark); |
621 | free (map_mark); |
622 | } |
622 | } |
623 | |
623 | |
624 | /** |
624 | /** |