1 | /* |
1 | /* |
2 | * This file is part of Crossfire TRT, the Roguelike Realtime MORPG. |
2 | * This file is part of Deliantra, the Roguelike Realtime MMORPG. |
3 | * |
3 | * |
4 | * Copyright (©) 2005,2006,2007 Marc Alexander Lehmann / Robin Redeker / the Crossfire TRT team |
4 | * Copyright (©) 2005,2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
5 | * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team |
5 | * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team |
6 | * Copyright (©) 1992,2007 Frank Tore Johansen |
6 | * Copyright (©) 1992,2007 Frank Tore Johansen |
7 | * |
7 | * |
8 | * Crossfire TRT is free software: you can redistribute it and/or modify |
8 | * Deliantra is free software: you can redistribute it and/or modify |
9 | * 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 |
10 | * the Free Software Foundation, either version 3 of the License, or |
10 | * the Free Software Foundation, either version 3 of the License, or |
11 | * (at your option) any later version. |
11 | * (at your option) any later version. |
12 | * |
12 | * |
13 | * This program is distributed in the hope that it will be useful, |
13 | * This program is distributed in the hope that it will be useful, |
… | |
… | |
16 | * GNU General Public License for more details. |
16 | * GNU General Public License for more details. |
17 | * |
17 | * |
18 | * You should have received a copy of the GNU General Public License |
18 | * You should have received a copy of the GNU General Public License |
19 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
19 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
20 | * |
20 | * |
21 | * The authors can be reached via e-mail to <crossfire@schmorp.de> |
21 | * The authors can be reached via e-mail to <support@deliantra.net> |
22 | */ |
22 | */ |
23 | |
23 | |
24 | /** |
24 | /** |
25 | * \file |
25 | * \file |
26 | * Basic client output functions. |
26 | * Basic client output functions. |
… | |
… | |
263 | |
263 | |
264 | void |
264 | void |
265 | new_info_map_except (int color, maptile * map, object *op, const char *str) |
265 | new_info_map_except (int color, maptile * map, object *op, const char *str) |
266 | { |
266 | { |
267 | for_all_players (pl) |
267 | for_all_players (pl) |
268 | if (pl->ob != NULL && pl->ob->map == map && pl->ob != op) |
268 | if (pl->ob->map == map && pl->ob != op) |
269 | new_draw_info (color, 0, pl->ob, str); |
269 | new_draw_info (color, 0, pl->ob, str); |
270 | } |
270 | } |
271 | |
271 | |
272 | /** |
272 | /** |
273 | * Writes to everyone on the map except op1 and op2 |
273 | * Writes to everyone on the map except op1 and op2 |
274 | */ |
274 | */ |
275 | void |
275 | void |
276 | new_info_map_except2 (int color, maptile * map, object *op1, object *op2, const char *str) |
276 | new_info_map_except2 (int color, maptile * map, object *op1, object *op2, const char *str) |
277 | { |
277 | { |
278 | for_all_players (pl) |
278 | for_all_players (pl) |
279 | if (pl->ob != NULL && pl->ob->map == map && pl->ob != op1 && pl->ob != op2) |
279 | if (pl->ob->map == map && pl->ob != op1 && pl->ob != op2) |
280 | new_draw_info (color, 0, pl->ob, str); |
280 | new_draw_info (color, 0, pl->ob, str); |
281 | } |
281 | } |
282 | |
282 | |
283 | /** |
283 | /** |
284 | * Writes to everyone on the specified map |
284 | * Writes to everyone on the specified map |
285 | */ |
285 | */ |
286 | void |
286 | void |
287 | new_info_map (int color, maptile * map, const char *str) |
287 | new_info_map (int color, maptile * map, const char *str) |
288 | { |
288 | { |
289 | for_all_players (pl) |
289 | for_all_players (pl) |
290 | if (pl->ob != NULL && pl->ob->map == map) |
290 | if (pl->ob->map == map) |
291 | new_draw_info (color, 0, pl->ob, str); |
291 | new_draw_info (color, 0, pl->ob, str); |
292 | } |
292 | } |
293 | |
293 | |
294 | /** |
294 | /** |
295 | * Sets player title. |
295 | * Sets player title. |
… | |
… | |
486 | pl->contr->ns->send_packet (sl); |
486 | pl->contr->ns->send_packet (sl); |
487 | |
487 | |
488 | free (map_mark); |
488 | free (map_mark); |
489 | } |
489 | } |
490 | |
490 | |
491 | /** |
|
|
492 | * Send a kill log record to sockets |
|
|
493 | */ |
|
|
494 | void |
|
|
495 | Log_Kill (const char *Who, const char *What, int WhatType, const char *With, int WithType) |
|
|
496 | { |
|
|
497 | size_t len; |
|
|
498 | char buf[MAX_BUF]; |
|
|
499 | |
|
|
500 | if (With != NULL) |
|
|
501 | snprintf (buf, MAX_BUF, "%s\t%s\t%d\t%s\t%d\n", Who, What, WhatType, With, WithType); |
|
|
502 | else |
|
|
503 | snprintf (buf, MAX_BUF, "%s\t%s\t%d\n", Who, What, WhatType); |
|
|
504 | |
|
|
505 | len = strlen (buf); |
|
|
506 | } |
|
|
507 | |
|
|