ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/socket/lowlevel.C
(Generate patch)

Comparing deliantra/server/socket/lowlevel.C (file contents):
Revision 1.56 by root, Mon Jul 30 02:03:03 2007 UTC vs.
Revision 1.59 by root, Sun Sep 30 20:22:25 2007 UTC

487} 487}
488 488
489void 489void
490client::send_msg (int color, const char *type, const char *msg) 490client::send_msg (int color, const char *type, const char *msg)
491{ 491{
492 if (msg_is_special (msg)) 492 if (!msg || !type) // it can happen (for example, missing attack messages cause this)
493 {
494 LOG (logBacktrace | llevError, "send_msg(%d,%p,%p) called with NULL msg or type.\n", color, type, msg);
495 return;
496 }
497
498 int len = strlen (msg);
499
500 if (msg_is_special (msg) || (type [0] == 'c' && type [1] == '/') || len > (MAXSOCKBUF - 128))
493 cfperl_send_msg (this, color, type, msg); 501 cfperl_send_msg (this, color, type, msg);
494 else if (can_msg) 502 else if (can_msg)
495 send_packet_printf ("msg %d %s %s", color & NDI_CLIENT_MASK, type, msg); 503 send_packet_printf ("msg %d %s %s", color & NDI_CLIENT_MASK, type, msg);
496 else if (color < 0) 504 else if (color < 0)
497 return; // client cannot handle this 505 return; // client cannot handle this

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines