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

Comparing deliantra/server/include/client.h (file contents):
Revision 1.112 by root, Sun Nov 11 05:53:12 2012 UTC vs.
Revision 1.121 by root, Sat Nov 17 23:40:00 2018 UTC

1/* 1/*
2 * This file is part of Deliantra, the Roguelike Realtime MMORPG. 2 * This file is part of Deliantra, the Roguelike Realtime MMORPG.
3 * 3 *
4 * Copyright (©) 2017,2018 Marc Alexander Lehmann / the Deliantra team
4 * Copyright (©) 2005,2006,2007,2008,2009,2010,2011,2012 Marc Alexander Lehmann / Robin Redeker / the Deliantra team 5 * Copyright (©) 2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016 Marc Alexander Lehmann / Robin Redeker / the Deliantra team
5 * 6 *
6 * Deliantra is free software: you can redistribute it and/or modify it under 7 * Deliantra is free software: you can redistribute it and/or modify it under
7 * the terms of the Affero GNU General Public License as published by the 8 * the terms of the Affero GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your 9 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version. 10 * option) any later version.
101 ST_GET_PARTY_PASSWORD, 102 ST_GET_PARTY_PASSWORD,
102}; 103};
103 104
104// a handler for a specific type of packet 105// a handler for a specific type of packet
105enum { 106enum {
106 PF_PLAYER = 0x01, // must have valid player / will by synchronised 107 PF_PLAYER = 0x01, // must have valid player / will by synchronised
107 PF_PLAYING = 0x02, // must be in playing state 108 PF_PLAYING = 0x02, // must be in playing state
108 PF_COMMAND0 = 0x04, // command starts at offset 0 109 PF_COMMAND = 0x04, // is a user command
109 PF_COMMAND6 = 0x08, // command starts at offset 6
110}; 110};
111 111
112// face types. bit 0 means "has meta info prepended" 112// face types. bit 0 means "has meta info prepended"
113enum { 113enum {
114 FT_IMAGE = 0 * 2 + 0, // images 114 FT_IMAGE = 0 * 2 + 0, // images
150 unsigned int inbuf_len; // number of bytes valid in inbuf 150 unsigned int inbuf_len; // number of bytes valid in inbuf
151 statsinfo stats; 151 statsinfo stats;
152 object_vector_index ACC (RO, active); 152 object_vector_index ACC (RO, active);
153 player_ptr ACC (RO, pl); 153 player_ptr ACC (RO, pl);
154 154
155 char *ACC (RW, host); /* Which host it is connected from (ip address) */ 155 char *ACC (RW, host); /* Which host it is connected from (ip:port) */
156 uint8 ACC (RW, state); /* Input state of the player (name, password, etc */ 156 uint8 ACC (RW, state); /* Input state of the player (name, password, etc */
157 157
158 sint8 ACC (RW, last_level); /* Last level we sent to client */ 158 sint8 ACC (RW, last_level); /* Last level we sent to client */
159 uint16 ACC (RW, last_flags); /* fire/run on flags for last tick */ 159 uint16 ACC (RW, last_flags); /* fire/run on flags for last tick */
160 float ACC (RW, last_weapon_sp); /* if diff than weapon_sp, update client */ 160 float ACC (RW, last_weapon_sp); /* if diff than weapon_sp, update client */
179 bool ACC (RW, need_delinv0); /* If true, we need to delinv 0 before sending new floorbox */ 179 bool ACC (RW, need_delinv0); /* If true, we need to delinv 0 before sending new floorbox */
180 180
181 bool ACC (RW, update_look); /* If true, we need to send the look window */ 181 bool ACC (RW, update_look); /* If true, we need to send the look window */
182 bool ACC (RW, update_spells); // If true, we need to esrv_update_spells 182 bool ACC (RW, update_spells); // If true, we need to esrv_update_spells
183 bool ACC (RW, has_readable_type); /* If true client accept additional text information */ 183 bool ACC (RW, has_readable_type); /* If true client accept additional text information */
184 bool ACC (RW, monitor_spells); /* Client wishes to be informed when their spell list changes */ 184 uint8 ACC (RW, monitor_spells); /* Client wishes to be informed when their spell list changes */
185 185
186 bool ACC (RW, smoothing); // deliantra-style smoothing 186 bool ACC (RW, smoothing); // deliantra-style smoothing
187 bool ACC (RW, force_newmap); // force a newmap before next map update 187 bool ACC (RW, force_newmap); // force a newmap before next map update
188 uint16 ACC (RW, look_position); /* start of drawing of look window */ 188 uint16 ACC (RW, look_position); /* start of drawing of look window */
189 uint16 ACC (RW, mss); // likely tcp maximum segment size 189 uint16 ACC (RW, mss); // likely tcp maximum segment size
295 void send_raw (void *buf_, int len); 295 void send_raw (void *buf_, int len);
296 296
297 void send (void *buf_, int len); 297 void send (void *buf_, int len);
298 void send_packet (const_octet_string buf); 298 void send_packet (const_octet_string buf);
299 void send_packet (const_octet_string buf, int len); 299 void send_packet (const_octet_string buf, int len);
300 void send_packet_printf (const_utf8_string format, ...) attribute ((format (printf, 2, 3))); 300 void send_packet_printf (const_utf8_string format, ...) ecb_attribute ((format (printf, 2, 3)));
301 void send_packet (packet &sl); 301 void send_packet (packet &sl);
302
303 void send_drawinfo (const_utf8_string msg, int flags = NDI_BLACK);
304 302
305 MTH void send_face (faceidx facenum, int pri = 0); 303 MTH void send_face (faceidx facenum, int pri = 0);
306 MTH void send_faces (object *ob); 304 MTH void send_faces (object *ob);
307 MTH void send_animation (short anim_num); 305 MTH void send_animation (short anim_num);
308 void send_msg (int color, const_utf8_string type, const_utf8_string msg); 306 void send_msg (int color, const_utf8_string type, const_utf8_string msg);
367 statementvar (client *, var, clients [_i]) 365 statementvar (client *, var, clients [_i])
368 366
369// returns true when the message needs special (read: perl) treatment 367// returns true when the message needs special (read: perl) treatment
370static inline bool 368static inline bool
371msg_is_special (const_any_string msg, bool nl_special = true) 369msg_is_special (const_any_string msg, bool nl_special = true)
372{ 370{
373 return msg [strcspn (msg, nl_special ? "<&\n" : "<&")]; 371 return msg [strcspn (msg, nl_special ? "<&\n" : "<&")];
374} 372}
375 373
376#endif 374#endif
377 375

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines