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.29 by pippijn, Wed Jan 3 00:21:36 2007 UTC vs.
Revision 1.33 by pippijn, Sat Jan 20 13:47:17 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
10 the Free Software Foundation; either version 2 of the License, or 10 * the Free Software Foundation; either version 2 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,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
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, write to the Free Software 19 * along with this program; if not, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 21 *
22 The authors can be reached via e-mail at <crossfire@schmorp.de> 22 * The authors can be reached via e-mail at <crossfire@schmorp.de>
23*/ 23 */
24 24
25/** 25/**
26 * \file 26 * \file
27 * Basic client output functions. 27 * Basic client output functions.
28 * 28 *
255} 255}
256 256
257void 257void
258draw_ext_info_format (int flags, int pri, const object *pl, uint8 type, uint8 subtype, const char *old_format, char *new_format, ...) 258draw_ext_info_format (int flags, int pri, const object *pl, uint8 type, uint8 subtype, const char *old_format, char *new_format, ...)
259{ 259{
260
261 char buf[HUGE_BUF]; 260 char buf[HUGE_BUF];
262 261
263 if (!pl || (pl->type != PLAYER) || (pl->contr == NULL)) 262 if (!pl || (pl->type != PLAYER) || (pl->contr == NULL))
264 return; 263 return;
265 264
298{ 297{
299 player *pl; 298 player *pl;
300 299
301 for_all_players (pl) 300 for_all_players (pl)
302 if (pl->ob != NULL && pl->ob->map == map && pl->ob != op) 301 if (pl->ob != NULL && pl->ob->map == map && pl->ob != op)
303 {
304 new_draw_info (color, 0, pl->ob, str); 302 new_draw_info (color, 0, pl->ob, str);
305 }
306} 303}
307 304
308/** 305/**
309 * Writes to everyone on the map except op1 and op2 306 * Writes to everyone on the map except op1 and op2
310 */ 307 */
314{ 311{
315 player *pl; 312 player *pl;
316 313
317 for_all_players (pl) 314 for_all_players (pl)
318 if (pl->ob != NULL && pl->ob->map == map && pl->ob != op1 && pl->ob != op2) 315 if (pl->ob != NULL && pl->ob->map == map && pl->ob != op1 && pl->ob != op2)
319 {
320 new_draw_info (color, 0, pl->ob, str); 316 new_draw_info (color, 0, pl->ob, str);
321 }
322} 317}
323 318
324/** 319/**
325 * Writes to everyone on the specified map 320 * Writes to everyone on the specified map
326 */ 321 */
330{ 325{
331 player *pl; 326 player *pl;
332 327
333 for_all_players (pl) 328 for_all_players (pl)
334 if (pl->ob != NULL && pl->ob->map == map) 329 if (pl->ob != NULL && pl->ob->map == map)
335 {
336 new_draw_info (color, 0, pl->ob, str); 330 new_draw_info (color, 0, pl->ob, str);
337 }
338} 331}
339
340 332
341/** 333/**
342 * This does nothing now. However, in theory, we should probably send 334 * This does nothing now. However, in theory, we should probably send
343 * something to the client and let the client figure out how it might want 335 * something to the client and let the client figure out how it might want
344 * to handle this 336 * to handle this
451magic_mapping_mark_recursive (object *pl, char *map_mark, int px, int py) 443magic_mapping_mark_recursive (object *pl, char *map_mark, int px, int py)
452{ 444{
453 int x, y, dx, dy, mflags; 445 int x, y, dx, dy, mflags;
454 sint16 nx, ny; 446 sint16 nx, ny;
455 maptile *mp; 447 maptile *mp;
456 New_Face *f; 448 facetile *f;
457 449
458 for (dx = -1; dx <= 1; dx++) 450 for (dx = -1; dx <= 1; dx++)
459 { 451 {
460 for (dy = -1; dy <= 1; dy++) 452 for (dy = -1; dy <= 1; dy++)
461 { 453 {
517magic_mapping_mark (object *pl, char *map_mark, int strength) 509magic_mapping_mark (object *pl, char *map_mark, int strength)
518{ 510{
519 int x, y, mflags; 511 int x, y, mflags;
520 sint16 nx, ny; 512 sint16 nx, ny;
521 maptile *mp; 513 maptile *mp;
522 New_Face *f; 514 facetile *f;
523 515
524 for (x = -strength; x < strength; x++) 516 for (x = -strength; x < strength; x++)
525 { 517 {
526 for (y = -strength; y < strength; y++) 518 for (y = -strength; y < strength; y++)
527 { 519 {
557 * The following function is a lot messier than it really should be, 549 * The following function is a lot messier than it really should be,
558 * but there is no real easy solution. 550 * but there is no real easy solution.
559 * 551 *
560 * Mark Wedel 552 * Mark Wedel
561 */ 553 */
562
563void 554void
564draw_magic_map (object *pl) 555draw_magic_map (object *pl)
565{ 556{
566 char *map_mark = (char *)calloc (MAGIC_MAP_SIZE * MAGIC_MAP_SIZE, 1); 557 char *map_mark = (char *)calloc (MAGIC_MAP_SIZE * MAGIC_MAP_SIZE, 1);
567 int xmin, xmax, ymin, ymax; 558 int xmin, xmax, ymin, ymax;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines