summaryrefslogtreecommitdiff
path: root/src/network/network_server.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-12-05 14:48:39 +0000
committerrubidium <rubidium@openttd.org>2010-12-05 14:48:39 +0000
commit216e48cd07d96cabd0fd51b965a526350b47b552 (patch)
treec1b076e6c24953e30171e3a3daf6ab4e6153d3a7 /src/network/network_server.h
parent02b3bc57d5cf6336343fd9dda09469221275bb35 (diff)
downloadopenttd-216e48cd07d96cabd0fd51b965a526350b47b552.tar.xz
(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.
Diffstat (limited to 'src/network/network_server.h')
-rw-r--r--src/network/network_server.h3
1 files changed, 3 insertions, 0 deletions
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;