ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/socket/info.C
(Generate patch)

Comparing deliantra/server/socket/info.C (file contents):
Revision 1.47 by root, Thu Nov 8 19:43:29 2007 UTC vs.
Revision 1.50 by root, Tue May 6 16:55:26 2008 UTC

1/* 1/*
2 * This file is part of Deliantra, the Roguelike Realtime MMORPG. 2 * This file is part of Deliantra, the Roguelike Realtime MMORPG.
3 * 3 *
4 * Copyright (©) 2005,2006,2007 Marc Alexander Lehmann / Robin Redeker / the Deliantra 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 * Deliantra 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
263 263
264void 264void
265new_info_map_except (int color, maptile * map, object *op, const char *str) 265new_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 */
275void 275void
276new_info_map_except2 (int color, maptile * map, object *op1, object *op2, const char *str) 276new_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 */
286void 286void
287new_info_map (int color, maptile * map, const char *str) 287new_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 */
494void
495Log_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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines