summaryrefslogtreecommitdiff
path: root/network.c
diff options
context:
space:
mode:
Diffstat (limited to 'network.c')
-rw-r--r--network.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/network.c b/network.c
index 69633b693..9e9b92fa6 100644
--- a/network.c
+++ b/network.c
@@ -4,6 +4,7 @@
#include "strings.h"
#include "map.h"
#include "network_data.h"
+#include "command.h"
#if defined(WITH_REV)
extern const char _openttd_revision[];
@@ -466,6 +467,9 @@ static NetworkClientState *NetworkAllocClient(SOCKET s)
cs->last_frame = 0;
cs->quited = false;
+ cs->last_frame = _frame_counter;
+ cs->last_frame_server = _frame_counter;
+
if (_network_server) {
ci = DEREF_CLIENT_INFO(cs);
memset(ci, 0, sizeof(*ci));
@@ -511,6 +515,12 @@ void NetworkCloseClient(NetworkClientState *cs)
SEND_COMMAND(PACKET_SERVER_ERROR_QUIT)(new_cs, cs->index, errorno);
}
}
+
+ /* When the client was PRE_ACTIVE, the server was in pause mode, so unpause */
+ if (cs->status == STATUS_PRE_ACTIVE && _network_pause_on_join) {
+ DoCommandP(0, 0, 0, NULL, CMD_PAUSE);
+ NetworkServer_HandleChat(NETWORK_ACTION_CHAT, DESTTYPE_BROADCAST, 0, "Game unpaused", NETWORK_SERVER_INDEX);
+ }
}
closesocket(cs->socket);