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.47 by root, Tue Jun 12 10:29:52 2007 UTC vs.
Revision 1.48 by root, Sun Jun 24 04:09:29 2007 UTC

511 va_end (ap); 511 va_end (ap);
512 512
513 send_packet (sl); 513 send_packet (sl);
514} 514}
515 515
516void 516// returns true when the message needs special (read: perl) treatment
517client::send_drawinfo (const char *msg, int flags) 517static bool
518{ 518msg_is_special (const char *msg)
519 send_packet_printf ("drawinfo %d %s", flags, msg); 519{
520 return msg [strcspn (msg, "<[&\n")];
520} 521}
521 522
522void 523void
523client::send_msg (int color, const char *type, const char *msg) 524client::send_msg (int color, const char *type, const char *msg)
524{ 525{
526 if (msg_is_special (msg))
527 cfperl_send_msg (this, color, type, msg);
525 if (can_msg) 528 else if (can_msg)
526 send_packet_printf ("msg %d %s %s", color, type, msg); 529 send_packet_printf ("msg %d %s %s", color, type, msg);
527 else if (color < 0) 530 else if (color < 0)
528 return; // client cannot handle this 531 return; // client cannot handle this
529 else if (strchr (msg, '<') || strchr (msg, '&'))
530 {
531 //TODO: should escape/modify to old syntax
532 send_packet_printf ("drawinfo %d %s", color, msg);
533 }
534 else 532 else
535 send_packet_printf ("drawinfo %d %s", color, msg); 533 send_packet_printf ("drawinfo %d %s", color, msg);
534}
535
536void
537client::send_drawinfo (const char *msg, int flags)
538{
539 send_msg (flags, "log", msg);
536} 540}
537 541
538/*********************************************************************** 542/***********************************************************************
539 * 543 *
540 * packet functions/utilities 544 * packet functions/utilities

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines