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

Comparing deliantra/server/socket/loop.C (file contents):
Revision 1.47 by root, Sat May 12 22:04:20 2007 UTC vs.
Revision 1.48 by root, Fri May 18 19:46:22 2007 UTC

85} 85}
86 86
87bool 87bool
88client::handle_command () 88client::handle_command ()
89{ 89{
90 bool skipping = false;
91
92 while (!cmd_queue.empty () 90 if (!cmd_queue.empty ()
93 && !(state == ST_PLAYING && pl->ob && pl->ob->speed_left <= 0.f)) 91 && state == ST_PLAYING
92 && pl->ob->speed_left > 0.f)
94 { 93 {
95 command &cmd = cmd_queue.front (); 94 command &cmd = cmd_queue.front ();
96 95
97 if (cmd.stamp + MAX_QUEUE_BACKLOG < now ()) 96 if (cmd.stamp + MAX_QUEUE_BACKLOG < now ())
98 { 97 {
99 if (!skipping)
100 {
101 skipping = true;
102 reset_state (); 98 reset_state ();
103 send_packet_printf ("drawinfo %d ignoring delayed commands.", NDI_RED); 99 send_packet_printf ("drawinfo %d ignoring delayed commands.", NDI_RED);
104 }
105
106 cmd_queue.pop_front ();
107 } 100 }
108 else 101 else
109 {
110 execute (cmd.handler, cmd.data, cmd.datalen); 102 execute (cmd.handler, cmd.data, cmd.datalen);
103
111 cmd_queue.pop_front (); 104 cmd_queue.pop_front ();
112 return true; 105 return true;
113 }
114 } 106 }
115 107 else
116 return false; 108 return false;
117} 109}
118 110
119void 111void
120flush_sockets (void) 112flush_sockets (void)
121{ 113{

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines