summaryrefslogtreecommitdiff
path: root/src/network/core
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-12-05 14:34:19 +0000
committerrubidium <rubidium@openttd.org>2010-12-05 14:34:19 +0000
commit97434f0e06d2191b332a876e3171c5f3d1166d79 (patch)
tree8cbd35f8b6a5c9bb190d51b465dc22d9aa8dfd9c /src/network/core
parentc8e8b0e0a01e097320220ec05f2d0e27f82d3dc7 (diff)
downloadopenttd-97434f0e06d2191b332a876e3171c5f3d1166d79.tar.xz
(svn r21392) -Change: prepare the network protocol for getting the file size later in the download process
Diffstat (limited to 'src/network/core')
-rw-r--r--src/network/core/tcp_game.cpp2
-rw-r--r--src/network/core/tcp_game.h8
2 files changed, 9 insertions, 1 deletions
diff --git a/src/network/core/tcp_game.cpp b/src/network/core/tcp_game.cpp
index 6c68217fc..73fece057 100644
--- a/src/network/core/tcp_game.cpp
+++ b/src/network/core/tcp_game.cpp
@@ -89,6 +89,7 @@ NetworkRecvStatus NetworkGameSocketHandler::HandlePacket(Packet *p)
GAME_COMMAND(PACKET_CLIENT_GETMAP)
GAME_COMMAND(PACKET_SERVER_WAIT)
GAME_COMMAND(PACKET_SERVER_MAP_BEGIN)
+ GAME_COMMAND(PACKET_SERVER_MAP_SIZE)
GAME_COMMAND(PACKET_SERVER_MAP_DATA)
GAME_COMMAND(PACKET_SERVER_MAP_DONE)
GAME_COMMAND(PACKET_CLIENT_MAP_OK)
@@ -177,6 +178,7 @@ DEFINE_UNAVAILABLE_GAME_RECEIVE_COMMAND(PACKET_SERVER_WELCOME)
DEFINE_UNAVAILABLE_GAME_RECEIVE_COMMAND(PACKET_CLIENT_GETMAP)
DEFINE_UNAVAILABLE_GAME_RECEIVE_COMMAND(PACKET_SERVER_WAIT)
DEFINE_UNAVAILABLE_GAME_RECEIVE_COMMAND(PACKET_SERVER_MAP_BEGIN)
+DEFINE_UNAVAILABLE_GAME_RECEIVE_COMMAND(PACKET_SERVER_MAP_SIZE)
DEFINE_UNAVAILABLE_GAME_RECEIVE_COMMAND(PACKET_SERVER_MAP_DATA)
DEFINE_UNAVAILABLE_GAME_RECEIVE_COMMAND(PACKET_SERVER_MAP_DONE)
DEFINE_UNAVAILABLE_GAME_RECEIVE_COMMAND(PACKET_CLIENT_MAP_OK)
diff --git a/src/network/core/tcp_game.h b/src/network/core/tcp_game.h
index 24adf6acd..40ffdb1d4 100644
--- a/src/network/core/tcp_game.h
+++ b/src/network/core/tcp_game.h
@@ -73,6 +73,7 @@ enum PacketGameType {
PACKET_CLIENT_GETMAP, ///< Client requests the actual map.
PACKET_SERVER_WAIT, ///< Server tells the client there are some people waiting for the map as well.
PACKET_SERVER_MAP_BEGIN, ///< Server tells the client that it is beginning to send the map.
+ PACKET_SERVER_MAP_SIZE, ///< Server tells the client what the (compressed) size of the map is.
PACKET_SERVER_MAP_DATA, ///< Server sends bits of the map to the client.
PACKET_SERVER_MAP_DONE, ///< Server tells it has just sent the last bits of the map to the client.
PACKET_CLIENT_MAP_OK, ///< Client tells the server that it received the whole map.
@@ -272,11 +273,16 @@ protected:
/**
* Sends that the server will begin with sending the map to the client:
* uint32 Current frame.
- * uint32 Size of the map (in bytes).
*/
DECLARE_GAME_RECEIVE_COMMAND(PACKET_SERVER_MAP_BEGIN);
/**
+ * Sends the size of the map to the client.
+ * uint32 Size of the (compressed) map (in bytes).
+ */
+ DECLARE_GAME_RECEIVE_COMMAND(PACKET_SERVER_MAP_SIZE);
+
+ /**
* Sends the data of the map to the client:
* Contains a part of the map (until max size of packet).
*/