summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2013-11-21 18:35:31 +0000
committerrubidium <rubidium@openttd.org>2013-11-21 18:35:31 +0000
commit1a043202d1c89fa30a47f4452aef9d14e905f77a (patch)
tree72cbe21a7dddeb208031ecfbb1aa692754784ac2
parentae7b830964996cdf8ff0a59e6254548ba997e785 (diff)
downloadopenttd-1a043202d1c89fa30a47f4452aef9d14e905f77a.tar.xz
(svn r26043) -Fix [FS#5811]: occasional hanging when client joins
-rw-r--r--src/network/network_server.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp
index 716b41744..fcaad19ab 100644
--- a/src/network/network_server.cpp
+++ b/src/network/network_server.cpp
@@ -113,6 +113,12 @@ struct PacketWriter : SaveFilter {
if (this->mutex != NULL) this->mutex->SendSignal();
if (this->mutex != NULL) this->mutex->EndCritical();
+
+ /* Make sure the saving is completely cancelled. Yes,
+ * we need to handle the save finish as well as the
+ * next connection might just be requesting a map. */
+ WaitTillSaved();
+ ProcessAsyncSaveFinish();
}
/**
@@ -236,13 +242,6 @@ ServerNetworkGameSocketHandler::~ServerNetworkGameSocketHandler()
this->savegame->Destroy();
this->savegame = NULL;
}
-
- /* Make sure the saving is completely cancelled.
- * Yes, we need to handle the save finish as well
- * as the next connection in this "loop" might
- * just be requesting the map and such. */
- WaitTillSaved();
- ProcessAsyncSaveFinish();
}
Packet *ServerNetworkGameSocketHandler::ReceivePacket()
@@ -622,8 +621,6 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::SendMap()
this->savegame->Destroy();
this->savegame = NULL;
- WaitTillSaved();
-
/* Set the status to DONE_MAP, no we will wait for the client
* to send it is ready (maybe that happens like never ;)) */
this->status = STATUS_DONE_MAP;