… | |
… | |
258 | int len; |
258 | int len; |
259 | int count; |
259 | int count; |
260 | char msg[MSG_BUF_SIZE]; |
260 | char msg[MSG_BUF_SIZE]; |
261 | } msgbuf[MSG_BUF_COUNT]; |
261 | } msgbuf[MSG_BUF_COUNT]; |
262 | |
262 | |
263 | MTH bool msg_suppressed (const char *msg); |
263 | MTH bool msg_suppressed (const_utf8_string msg); |
264 | |
264 | |
265 | /* The following is the setup for a ring buffer for storing output |
265 | /* The following is the setup for a ring buffer for storing output |
266 | * data that the OS can't handle right away. |
266 | * data that the OS can't handle right away. |
267 | * TODO: this member is enourmously large - optimise? |
267 | * TODO: this member is enourmously large - optimise? |
268 | */ |
268 | */ |
… | |
… | |
290 | MTH void flush (); |
290 | MTH void flush (); |
291 | MTH void write_outputbuffer (); |
291 | MTH void write_outputbuffer (); |
292 | MTH int outputbuffer_len () const { return outputbuffer.len; } |
292 | MTH int outputbuffer_len () const { return outputbuffer.len; } |
293 | void send (void *buf_, int len); |
293 | void send (void *buf_, int len); |
294 | |
294 | |
295 | void send_packet (const char *buf); |
295 | void send_packet (const_octet_string buf); |
296 | void send_packet (const char *buf, int len); |
296 | void send_packet (const_octet_string buf, int len); |
297 | void send_packet_printf (const char *format, ...) attribute ((format (printf, 2, 3))); |
297 | void send_packet_printf (const_utf8_string format, ...) attribute ((format (printf, 2, 3))); |
298 | void send_packet (packet &sl); |
298 | void send_packet (packet &sl); |
299 | |
299 | |
300 | void send_drawinfo (const char *msg, int flags = NDI_BLACK); |
300 | void send_drawinfo (const_utf8_string msg, int flags = NDI_BLACK); |
301 | |
301 | |
302 | MTH void send_face (faceidx facenum, int pri = 0); |
302 | MTH void send_face (faceidx facenum, int pri = 0); |
303 | MTH void send_faces (object *ob); |
303 | MTH void send_faces (object *ob); |
304 | MTH void send_animation (short anim_num); |
304 | MTH void send_animation (short anim_num); |
305 | void send_msg (int color, const char *type, const char *msg); |
305 | void send_msg (int color, const_utf8_string type, const_utf8_string msg); |
306 | |
306 | |
307 | MTH void play_sound (faceidx sound, int dx = 0, int dy = 0); |
307 | MTH void play_sound (faceidx sound, int dx = 0, int dy = 0); |
308 | // called when something under the player changes |
308 | // called when something under the player changes |
309 | MTH void floorbox_update () { update_look = 1; } |
309 | MTH void floorbox_update () { update_look = 1; } |
310 | // called when the player has been moved |
310 | // called when the player has been moved |
… | |
… | |
378 | for (int _i = 0; _i < clients.size (); ++_i) \ |
378 | for (int _i = 0; _i < clients.size (); ++_i) \ |
379 | statementvar (client *, var, clients [_i]) |
379 | statementvar (client *, var, clients [_i]) |
380 | |
380 | |
381 | // returns true when the message needs special (read: perl) treatment |
381 | // returns true when the message needs special (read: perl) treatment |
382 | static inline bool |
382 | static inline bool |
383 | msg_is_special (const char *msg, bool nl_special = true) |
383 | msg_is_special (const_any_string msg, bool nl_special = true) |
384 | { |
384 | { |
385 | return msg [strcspn (msg, nl_special ? "<&\n" : "<&")]; |
385 | return msg [strcspn (msg, nl_special ? "<&\n" : "<&")]; |
386 | } |
386 | } |
387 | |
387 | |
388 | #endif |
388 | #endif |