… | |
… | |
95 | |
95 | |
96 | if (!pl || (pl->type == PLAYER && pl->contr == NULL)) |
96 | if (!pl || (pl->type == PLAYER && pl->contr == NULL)) |
97 | return; |
97 | return; |
98 | |
98 | |
99 | if (pl->type == PLAYER) |
99 | if (pl->type == PLAYER) |
100 | { |
|
|
101 | esrv_print_msg (&pl->contr->socket, colr, (char *) tmp); |
100 | esrv_print_msg (pl->contr->socket, colr, (char *) tmp); |
102 | return; |
|
|
103 | } |
|
|
104 | } |
101 | } |
105 | |
102 | |
106 | /** |
103 | /** |
107 | * Prints out the contents of specified buffer structures, |
104 | * Prints out the contents of specified buffer structures, |
108 | * and clears the string. |
105 | * and clears the string. |
… | |
… | |
268 | if (!pl || (pl->type != PLAYER) || (pl->contr == NULL)) |
265 | if (!pl || (pl->type != PLAYER) || (pl->contr == NULL)) |
269 | return; |
266 | return; |
270 | |
267 | |
271 | if (pri >= pl->contr->listening) |
268 | if (pri >= pl->contr->listening) |
272 | return; |
269 | return; |
|
|
270 | |
273 | if (!CLIENT_SUPPORT_READABLES (&pl->contr->socket, type)) |
271 | if (!CLIENT_SUPPORT_READABLES (pl->contr->socket, type)) |
274 | { |
272 | { |
275 | char *buf = (char *) malloc (strlen (oldmessage == NULL ? message : oldmessage) + 1); |
273 | char *buf = (char *) malloc (strlen (oldmessage == NULL ? message : oldmessage) + 1); |
276 | |
274 | |
277 | if (buf == NULL) |
275 | if (buf == NULL) |
278 | LOG (llevError, "info::draw_ext_info -> Out of memory!"); |
276 | LOG (llevError, "info::draw_ext_info -> Out of memory!"); |
… | |
… | |
283 | new_draw_info (flags, pri, pl, buf); |
281 | new_draw_info (flags, pri, pl, buf); |
284 | free (buf); |
282 | free (buf); |
285 | } |
283 | } |
286 | } |
284 | } |
287 | else |
285 | else |
288 | { |
|
|
289 | esrv_print_ext_msg (&pl->contr->socket, flags & NDI_COLOR_MASK, type, subtype, message); |
286 | esrv_print_ext_msg (pl->contr->socket, flags & NDI_COLOR_MASK, type, subtype, message); |
290 | } |
|
|
291 | } |
287 | } |
292 | |
288 | |
293 | void |
289 | void |
294 | draw_ext_info_format (int flags, int pri, const object *pl, uint8 type, uint8 subtype, const char *old_format, char *new_format, ...) |
290 | draw_ext_info_format (int flags, int pri, const object *pl, uint8 type, uint8 subtype, const char *old_format, char *new_format, ...) |
295 | { |
291 | { |
… | |
… | |
299 | if (!pl || (pl->type != PLAYER) || (pl->contr == NULL)) |
295 | if (!pl || (pl->type != PLAYER) || (pl->contr == NULL)) |
300 | return; |
296 | return; |
301 | |
297 | |
302 | if (pri >= pl->contr->listening) |
298 | if (pri >= pl->contr->listening) |
303 | return; |
299 | return; |
|
|
300 | |
304 | if (!CLIENT_SUPPORT_READABLES (&pl->contr->socket, type)) |
301 | if (!CLIENT_SUPPORT_READABLES (pl->contr->socket, type)) |
305 | { |
302 | { |
306 | va_list ap; |
303 | va_list ap; |
307 | |
304 | |
308 | LOG (llevDebug, "Non supported extension text type for client.\n"); |
305 | LOG (llevDebug, "Non supported extension text type for client.\n"); |
309 | va_start (ap, new_format); |
306 | va_start (ap, new_format); |
… | |
… | |
318 | |
315 | |
319 | va_start (ap, new_format); |
316 | va_start (ap, new_format); |
320 | vsnprintf (buf, HUGE_BUF, new_format, ap); |
317 | vsnprintf (buf, HUGE_BUF, new_format, ap); |
321 | va_end (ap); |
318 | va_end (ap); |
322 | strip_media_tag (buf); |
319 | strip_media_tag (buf); |
323 | esrv_print_ext_msg (&pl->contr->socket, flags & NDI_COLOR_MASK, type, subtype, buf); |
320 | esrv_print_ext_msg (pl->contr->socket, flags & NDI_COLOR_MASK, type, subtype, buf); |
324 | } |
321 | } |
325 | } |
322 | } |
326 | |
323 | |
327 | /** |
324 | /** |
328 | * Writes to everyone on the map *except* op. This is useful for emotions. |
325 | * Writes to everyone on the map *except* op. This is useful for emotions. |
… | |
… | |
637 | |
634 | |
638 | for (int y = ymin; y <= ymax; y++) |
635 | for (int y = ymin; y <= ymax; y++) |
639 | for (int x = xmin; x <= xmax; x++) |
636 | for (int x = xmin; x <= xmax; x++) |
640 | sl << uint8 (map_mark[x + MAGIC_MAP_SIZE * y] & ~FACE_FLOOR); |
637 | sl << uint8 (map_mark[x + MAGIC_MAP_SIZE * y] & ~FACE_FLOOR); |
641 | |
638 | |
642 | Send_With_Handling (&pl->contr->socket, &sl); |
639 | Send_With_Handling (pl->contr->socket, &sl); |
643 | |
|
|
644 | |
640 | |
645 | free (map_mark); |
641 | free (map_mark); |
646 | } |
642 | } |
647 | |
643 | |
648 | |
644 | |