From 97434f0e06d2191b332a876e3171c5f3d1166d79 Mon Sep 17 00:00:00 2001 From: rubidium Date: Sun, 5 Dec 2010 14:34:19 +0000 Subject: (svn r21392) -Change: prepare the network protocol for getting the file size later in the download process --- src/network/core/tcp_game.cpp | 2 ++ src/network/core/tcp_game.h | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'src/network/core') 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,10 +273,15 @@ 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). -- cgit v1.2.3-70-g09d2