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.27 by root, Tue Dec 26 17:11:40 2006 UTC vs.
Revision 1.30 by pippijn, Sat Jan 6 14:42:31 2007 UTC

1
2/* 1/*
3 CrossFire, A Multiplayer game for X-windows 2 CrossFire, A Multiplayer game for X-windows
4 3
4 Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team
5 Copyright (C) 2002 Mark Wedel & Crossfire Development Team 5 Copyright (C) 2002 Mark Wedel & Crossfire Development Team
6 Copyright (C) 1992 Frank Tore Johansen 6 Copyright (C) 1992 Frank Tore Johansen
7 7
8 This program is free software; you can redistribute it and/or modify 8 This program 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
191 new_draw_info (flags & ~NDI_ALL, pri, pl->ob, buf); 191 new_draw_info (flags & ~NDI_ALL, pri, pl->ob, buf);
192 192
193 return; 193 return;
194 } 194 }
195 195
196 if (!pl || (pl->type == PLAYER && pl->contr == NULL)) 196 if (!pl || pl->type != PLAYER || !pl->contr || !pl->contr->ns)
197 {
198 /* Write to the socket? */
199 print_message (0, NULL, buf);
200 return;
201 }
202
203 if (pl->type != PLAYER)
204 return; 197 return;
205 198
206 if (pri >= pl->contr->listening) 199 if (pri >= pl->contr->listening)
207 return; 200 return;
208 201
209 if ((flags & NDI_COLOR_MASK) == NDI_BLACK && !(flags & NDI_UNIQUE)) 202 if ((flags & NDI_COLOR_MASK) == NDI_BLACK && !(flags & NDI_UNIQUE))
210 /* following prints stuff out, as appropriate */
211 check_output_buffers (pl, buf); 203 check_output_buffers (pl, buf);
212 else 204 else
213 print_message (flags & NDI_COLOR_MASK, pl, buf); 205 print_message (flags & NDI_COLOR_MASK, pl, buf);
214} 206}
215 207
225new_draw_info_format (int flags, int pri, const object *pl, const char *format, ...) 217new_draw_info_format (int flags, int pri, const object *pl, const char *format, ...)
226{ 218{
227 char buf[HUGE_BUF]; 219 char buf[HUGE_BUF];
228 220
229 va_list ap; 221 va_list ap;
230
231 va_start (ap, format); 222 va_start (ap, format);
232
233 vsnprintf (buf, HUGE_BUF, format, ap); 223 vsnprintf (buf, HUGE_BUF, format, ap);
234
235 va_end (ap); 224 va_end (ap);
236 225
237 new_draw_info (flags, pri, pl, buf); 226 new_draw_info (flags, pri, pl, buf);
238} 227}
239 228
516 * being nonzero have been changed to check for 1. Also, since 505 * being nonzero have been changed to check for 1. Also, since
517 * map_mark is a char value, putting 2 in should cause no problems. 506 * map_mark is a char value, putting 2 in should cause no problems.
518 * 507 *
519 * This function examines the map the player is on, and determines what 508 * This function examines the map the player is on, and determines what
520 * is visible. 2 is set for walls or objects that blocks view. 1 509 * is visible. 2 is set for walls or objects that blocks view. 1
521 * is for open spaces. map_mark should already have been initialized 510 * is for open spaces. map_mark should already have been initialised
522 * to zero before this is called. 511 * to zero before this is called.
523 * strength is an initial strength*2 rectangular area that we automatically 512 * strength is an initial strength*2 rectangular area that we automatically
524 * see in/penetrate through. 513 * see in/penetrate through.
525 */ 514 */
526 515

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines