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.67 by root, Wed Aug 15 05:01:25 2007 UTC vs.
Revision 1.71 by root, Sat Aug 25 22:19:26 2007 UTC

170 /* MAP_CLIENT_.., the upper left is used */ 170 /* MAP_CLIENT_.., the upper left is used */
171 171
172 shstr ACC (RW, invis_race); /* What race invisible to? */ 172 shstr ACC (RW, invis_race); /* What race invisible to? */
173 173
174 MTH static player *create (); 174 MTH static player *create ();
175 static player *find (const char *name);
175 176
176 static player *load_pl (object_thawer &thawer); 177 static player *load_pl (object_thawer &thawer);
177 MTH static player *load_pl (const char *path); 178 MTH static player *load_pl (const char *path);
178 179
179 bool save_pl (object_freezer &freezer); 180 bool save_pl (object_freezer &freezer);
201 MTH void chargen_race_done (); 202 MTH void chargen_race_done ();
202 MTH void chargen_race_next (); 203 MTH void chargen_race_next ();
203 204
204 MTH void set_observe (object *ob); 205 MTH void set_observe (object *ob);
205 206
207 void send_msg (int color, const char *type, const char *msg)
208 {
209 ns->send_msg (color, type, msg);
210 }
211
212 // a prominent box that can easily be escaped away or so
213 // should be used for informative output such as who, maps etc.
214 // will stay on-screen
215 void infobox (const char *title, const char *msg, int color = NDI_BLACK)
216 {
217 send_msg (NDI_REPLY, LOG_CHANNEL, msg);
218 }
219
220 // a prominent msg that signifies some important event,
221 // an improvement potion effect potion. should not be long.
222 // might time out after a while
223 void statusmsg (const char *msg, int color = NDI_BLACK)
224 {
225 send_msg (NDI_REPLY | color, INFO_CHANNEL, msg);
226 }
227
228 // a prominent box that signifies some error such as a failed
229 // improvement potion. should not be long.
230 void failmsg (const char *msg, int color = NDI_RED)
231 {
232 play_sound (sound_find ("generic_failure"));
233 statusmsg (msg, color);
234 }
235
206 ~player (); 236 ~player ();
207 237
208private: 238private:
209 void set_object (object *op); 239 void set_object (object *op);
210 player (); 240 player ();
216 246
217#define for_all_players(var) \ 247#define for_all_players(var) \
218 for (unsigned _i = 0; _i < ::players.size (); ++_i) \ 248 for (unsigned _i = 0; _i < ::players.size (); ++_i) \
219 statementvar (player *, var, ::players [_i]) 249 statementvar (player *, var, ::players [_i])
220 250
251inline void
252object::statusmsg (const char *msg, int color)
253{
254 if (expect_true (contr)) contr->statusmsg (msg, color);
255}
256
257inline void
258object::failmsg (const char *msg, int color)
259{
260 if (expect_true (contr)) contr->failmsg (msg, color);
261}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines