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.60 by root, Mon Oct 1 01:09:10 2007 UTC

351 } 351 }
352 else 352 else
353 { 353 {
354 inbuf_len += amount; 354 inbuf_len += amount;
355 355
356 cmd_ev.start ();
357 }
358 }
359}
360
361// called whenever we have additional commands to process
362void
363client::cmd_cb (iw &w)
364{
365 if (handle_packet ()) 356 if (handle_packet ())
366 w.start (); 357 {
367 else 358 while (handle_packet ())
368 flush (); 359 ;
360
361 flush ();
362 }
363 }
364 }
369} 365}
370 366
371/******************************************************************************* 367/*******************************************************************************
372 * 368 *
373 * Start of write related routines. 369 * Start of write related routines.
487} 483}
488 484
489void 485void
490client::send_msg (int color, const char *type, const char *msg) 486client::send_msg (int color, const char *type, const char *msg)
491{ 487{
492 if (msg_is_special (msg)) 488 if (!msg || !type) // it can happen (for example, missing attack messages cause this)
489 {
490 LOG (logBacktrace | llevError, "send_msg(%d,%p,%p) called with NULL msg or type.\n", color, type, msg);
491 return;
492 }
493
494 int len = strlen (msg);
495
496 if (msg_is_special (msg) || (type [0] == 'c' && type [1] == '/') || len > (MAXSOCKBUF - 128))
493 cfperl_send_msg (this, color, type, msg); 497 cfperl_send_msg (this, color, type, msg);
494 else if (can_msg) 498 else if (can_msg)
495 send_packet_printf ("msg %d %s %s", color & NDI_CLIENT_MASK, type, msg); 499 send_packet_printf ("msg %d %s %s", color & NDI_CLIENT_MASK, type, msg);
496 else if (color < 0) 500 else if (color < 0)
497 return; // client cannot handle this 501 return; // client cannot handle this

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines