ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/include/player.h
(Generate patch)

Comparing deliantra/server/include/player.h (file contents):
Revision 1.44 by root, Mon Jan 8 18:18:35 2007 UTC vs.
Revision 1.49 by root, Wed Apr 25 18:47:50 2007 UTC

1/* 1/*
2 CrossFire, A Multiplayer game for X-windows 2 * CrossFire, A Multiplayer game for X-windows
3 3 *
4 Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team 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
25#define NUM_OUTPUT_BUFS 5
26struct Output_Buf
27{
28 shstr buf; /* Actual string pointer */
29 uint32 first_update; /* First time this message was stored */
30 uint16 count; /* How many times we got this message */
31};
32 24
33/* wand/rod/horn rolled into range_misc. They all use the same body location 25/* wand/rod/horn rolled into range_misc. They all use the same body location
34 * anyways. 26 * anyways.
35 */ 27 */
36enum rangetype 28enum rangetype
184 sint8 blocked_los[MAP_CLIENT_X][MAP_CLIENT_Y]; /* array showing what spaces */ 176 sint8 blocked_los[MAP_CLIENT_X][MAP_CLIENT_Y]; /* array showing what spaces */
185 /* the player can see. For maps smaller than */ 177 /* the player can see. For maps smaller than */
186 /* MAP_CLIENT_.., the upper left is used */ 178 /* MAP_CLIENT_.., the upper left is used */
187 179
188 shstr ACC (RW, invis_race); /* What race invisible to? */ 180 shstr ACC (RW, invis_race); /* What race invisible to? */
189 Output_Buf outputs[NUM_OUTPUT_BUFS]; /* holds output strings to client */
190 181
191 MTH static player *create (); 182 MTH static player *create ();
192 183
193 static player *load_pl (object_thawer &thawer); 184 static player *load_pl (object_thawer &thawer);
194 MTH static player *load_pl (const char *path); 185 MTH static player *load_pl (const char *path);
197 MTH bool save_pl (const char *path); 188 MTH bool save_pl (const char *path);
198 189
199 void do_destroy (); 190 void do_destroy ();
200 void gather_callbacks (AV *&callbacks, event_type event) const; 191 void gather_callbacks (AV *&callbacks, event_type event) const;
201 192
193 // wether the player can "see" this mapspace or not, decided by los
194 // 0 - nothing see, 100 - fully visible
195 MTH sint8 visibility_at (maptile *map, int x, int y) const;
196
202 MTH void connect (client *ns); 197 MTH void connect (client *ns);
203 MTH void disconnect (); 198 MTH void disconnect ();
204 199
205 MTH void activate (); 200 MTH void activate ();
206 MTH void deactivate (); 201 MTH void deactivate ();
207 202
208 // enters the initial map, after login or creation 203 // enters the initial map, after login or creation
209 MTH void enter_map (); 204 MTH void enter_map ();
205
206 MTH void chargen_race_done ();
207 MTH void chargen_race_next ();
210 208
211 ~player (); 209 ~player ();
212 210
213private: 211private:
214 void set_object (object *op); 212 void set_object (object *op);
218typedef object_vector<player, &player::active> playervec; 216typedef object_vector<player, &player::active> playervec;
219 217
220extern playervec players; 218extern playervec players;
221 219
222#define for_all_players(var) \ 220#define for_all_players(var) \
223 for (int _i = 0; _i < players.size (); ++_i) \ 221 for (unsigned _i = 0; _i < players.size (); ++_i) \
224 declvar (player *, var, players [_i]) 222 declvar (player *, var, players [_i])
225 223

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines