… | |
… | |
95 | { |
95 | { |
96 | command &cmd = cmd_queue.front (); |
96 | command &cmd = cmd_queue.front (); |
97 | |
97 | |
98 | if (cmd.stamp + MAX_QUEUE_BACKLOG < NOW) |
98 | if (cmd.stamp + MAX_QUEUE_BACKLOG < NOW) |
99 | { |
99 | { |
100 | reset_state (); |
100 | reset_state (); // the command might actually reset some movement state etc. |
101 | send_packet_printf ("drawinfo %d ignoring delayed commands.", NDI_RED); |
101 | |
|
|
102 | if (pl) |
|
|
103 | pl->failmsg ( |
|
|
104 | "Cannot keep up with your commands, ignoring them! " |
|
|
105 | "H<Your character cannot keep up with the instructions you give G<him|her>. " |
|
|
106 | "Try issuing commands slower, or, if G<he|she> is incapacitated (paralyzed and so on), " |
|
|
107 | "wait till your character can act again.\n\nIf G<he|she> is permanently stuck, then " |
|
|
108 | "try the B<suicide> command (or use B<chat> to ask somebody to B<invite> you out).>" |
|
|
109 | ); |
102 | } |
110 | } |
103 | else |
111 | else |
104 | execute (cmd.handler, cmd.data, cmd.datalen); |
112 | execute (cmd.handler, cmd.data, cmd.datalen); |
105 | |
113 | |
106 | sfree<char> (cmd.data, cmd.datalen + 1); |
114 | sfree<char> (cmd.data, cmd.datalen + 1); |
… | |
… | |
158 | tcpi.tcpi_snd_ssthresh, tcpi.tcpi_snd_cwnd, tcpi.tcpi_advmss, tcpi.tcpi_pmtu, tcpi.tcpi_advmss, |
166 | tcpi.tcpi_snd_ssthresh, tcpi.tcpi_snd_cwnd, tcpi.tcpi_advmss, tcpi.tcpi_pmtu, tcpi.tcpi_advmss, |
159 | |
167 | |
160 | tcpi.tcpi_snd_cwnd - (tcpi.tcpi_unacked - tcpi.tcpi_sacked)); |
168 | tcpi.tcpi_snd_cwnd - (tcpi.tcpi_unacked - tcpi.tcpi_sacked)); |
161 | #endif |
169 | #endif |
162 | |
170 | |
163 | // fast-time-out a player by checking for missign acks |
171 | // fast-time-out a player by checking for missing acks |
164 | // do this only when player is active |
172 | // do this only when player is active |
165 | if (pl && pl->active |
173 | if (pl && pl->active |
166 | && tcpi.tcpi_last_ack_recv > int (SOCKET_TIMEOUT * 1000)) |
174 | && tcpi.tcpi_last_ack_recv > int (SOCKET_TIMEOUT * 1000)) |
167 | { |
175 | { |
168 | send_msg (NDI_RED | NDI_REPLY, "connection-timeout", "safety disconnect due to tcp/ip timeout (no packets received)"); |
176 | send_msg (NDI_RED | NDI_REPLY, "connection-timeout", "safety disconnect due to tcp/ip timeout (no packets received)"); |