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.22 by root, Thu Dec 21 06:12:37 2006 UTC vs.
Revision 1.25 by root, Mon Dec 25 14:43:23 2006 UTC

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
270void 270void
271draw_ext_info_format (int flags, int pri, const object *pl, uint8 type, uint8 subtype, const char *old_format, char *new_format, ...) 271draw_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.
309void 309void
310new_info_map_except (int color, maptile * map, object *op, const char *str) 310new_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}
325void 325void
326new_info_map_except2 (int color, maptile * map, object *op1, object *op2, const char *str) 326new_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}
341void 341void
342new_info_map (int color, maptile * map, const char *str) 342new_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}
598 xmax = 0; 598 xmax = 0;
599 ymax = 0; 599 ymax = 0;
600 600
601 for (int x = 0; x < MAGIC_MAP_SIZE; x++) 601 for (int x = 0; x < MAGIC_MAP_SIZE; x++)
602 for (int y = 0; y < MAGIC_MAP_SIZE; y++) 602 for (int y = 0; y < MAGIC_MAP_SIZE; y++)
603 if (map_mark[x + MAP_WIDTH (pl->map) * y] | FACE_FLOOR) 603 if (map_mark[x + pl->map->width * y] | FACE_FLOOR)
604 { 604 {
605 xmin = x < xmin ? x : xmin; 605 xmin = x < xmin ? x : xmin;
606 xmax = x > xmax ? x : xmax; 606 xmax = x > xmax ? x : xmax;
607 ymin = y < ymin ? y : ymin; 607 ymin = y < ymin ? y : ymin;
608 ymax = y > ymax ? y : ymax; 608 ymax = y > ymax ? y : ymax;
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/**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines