From 216e48cd07d96cabd0fd51b965a526350b47b552 Mon Sep 17 00:00:00 2001 From: rubidium Date: Sun, 5 Dec 2010 14:48:39 +0000 Subject: (svn r21399) -Change/Feature/Fix [FS#4284]: perform the compression of savegames to send to the client asynchroniously. This will reduce the lag of the other clients to the time it takes to make the memory dump and it will speed up downloading the map as the download starts earlier (possibly with a slightly lower bandwidth due to slow compression). This should also fix the lag message people get when the savegame compression takes more than a few seconds. --- src/network/network_server.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/network/network_server.h') diff --git a/src/network/network_server.h b/src/network/network_server.h index 3f6e51526..e44a04869 100644 --- a/src/network/network_server.h +++ b/src/network/network_server.h @@ -16,6 +16,7 @@ #include "network_internal.h" #include "core/tcp_listen.h" +#include "../thread/thread.h" class ServerNetworkGameSocketHandler; typedef ServerNetworkGameSocketHandler NetworkClientSocket; @@ -74,11 +75,13 @@ public: Packet *savegame_packets; ///< Packet queue of the savegame; send these "slowly" to the client. struct PacketWriter *savegame; ///< Writer used to write the savegame. + ThreadMutex *savegame_mutex; ///< Mutex for making threaded saving safe. ServerNetworkGameSocketHandler(SOCKET s); ~ServerNetworkGameSocketHandler(); virtual Packet *ReceivePacket(); + virtual void SendPacket(Packet *packet); NetworkRecvStatus CloseConnection(NetworkRecvStatus status); void GetClientName(char *client_name, size_t size) const; -- cgit v1.2.3-54-g00ecf