|
@@ -228,25 +228,25 @@ static void NetworkClientError(byte res,
|
|
|
NetworkErrorCode errorno;
|
|
|
|
|
|
// We just want to close the connection..
|
|
|
if (res == NETWORK_RECV_STATUS_CLOSE_QUERY) {
|
|
|
cs->quited = true;
|
|
|
NetworkCloseClient(cs);
|
|
|
_networking = false;
|
|
|
|
|
|
DeleteWindowById(WC_NETWORK_STATUS_WINDOW, 0);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
switch(res) {
|
|
|
switch (res) {
|
|
|
case NETWORK_RECV_STATUS_DESYNC: errorno = NETWORK_ERROR_DESYNC; break;
|
|
|
case NETWORK_RECV_STATUS_SAVEGAME: errorno = NETWORK_ERROR_SAVEGAME_FAILED; break;
|
|
|
default: errorno = NETWORK_ERROR_GENERAL;
|
|
|
}
|
|
|
// This means we fucked up and the server closed the connection
|
|
|
if (res != NETWORK_RECV_STATUS_SERVER_ERROR && res != NETWORK_RECV_STATUS_SERVER_FULL &&
|
|
|
res != NETWORK_RECV_STATUS_SERVER_BANNED) {
|
|
|
SEND_COMMAND(PACKET_CLIENT_ERROR)(errorno);
|
|
|
|
|
|
// Dequeue all commands before closing the socket
|
|
|
NetworkSend_Packets(DEREF_CLIENT(0));
|
|
|
}
|
|
@@ -1159,25 +1159,25 @@ static void NetworkHandleLocalQueue(void
|
|
|
}
|
|
|
|
|
|
// We can execute this command
|
|
|
NetworkExecuteCommand(cp);
|
|
|
|
|
|
*cp_prev = cp->next;
|
|
|
free(cp);
|
|
|
}
|
|
|
|
|
|
// Just a safety check, to be removed in the future.
|
|
|
// Make sure that no older command appears towards the end of the queue
|
|
|
// In that case we missed executing it. This will never happen.
|
|
|
for(cp = _local_command_queue; cp; cp = cp->next) {
|
|
|
for (cp = _local_command_queue; cp; cp = cp->next) {
|
|
|
assert(_frame_counter < cp->frame);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
static bool NetworkDoClientLoop(void)
|
|
|
{
|
|
|
_frame_counter++;
|
|
|
|
|
|
NetworkHandleLocalQueue();
|
|
|
|
|
|
StateGameLoop();
|