summaryrefslogtreecommitdiff
path: root/src/network/core/tcp_game.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-10-24 20:03:33 +0000
committerrubidium <rubidium@openttd.org>2010-10-24 20:03:33 +0000
commit2cd67a51acc71b08e52c94fefa44fe665977396f (patch)
tree837c257316c331c6bcc3c390a3bd0828649c3a18 /src/network/core/tcp_game.h
parentfc15063838e6d802af0ae0de178d218dbf786c17 (diff)
downloadopenttd-2cd67a51acc71b08e52c94fefa44fe665977396f.tar.xz
(svn r21029) -Codechange: split the map downloading packet + 3-state enum into 3 separate packets
Diffstat (limited to 'src/network/core/tcp_game.h')
-rw-r--r--src/network/core/tcp_game.h29
1 files changed, 18 insertions, 11 deletions
diff --git a/src/network/core/tcp_game.h b/src/network/core/tcp_game.h
index b312a447c..6fd5649c1 100644
--- a/src/network/core/tcp_game.h
+++ b/src/network/core/tcp_game.h
@@ -72,7 +72,9 @@ enum PacketGameType {
/* Getting the savegame/map. */
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, ///< Server sends bits of the map to the client.
+ PACKET_SERVER_MAP_BEGIN, ///< Server tells the client that it is beginning to send the map.
+ 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.
PACKET_SERVER_JOIN, ///< Tells clients that a new client has joined.
@@ -283,17 +285,22 @@ protected:
DECLARE_GAME_RECEIVE_COMMAND(PACKET_SERVER_WAIT);
/**
- * Sends parts of the map to the client:
- * uint8 packet type (MAP_PACKET_START, MAP_PACKET_NORMAL, MAP_PACKET_END).
- * If MAP_PACKET_START:
- * uint32 Current frame.
- * uint32 Size of the map (in bytes).
- * If MAP_PACKET_NORMAL:
- * Part of the map (until max size of packet).
- * If MAP_PACKET_END:
- * No further data sent.
+ * 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);
+ DECLARE_GAME_RECEIVE_COMMAND(PACKET_SERVER_MAP_BEGIN);
+
+ /**
+ * Sends the data of the map to the client:
+ * Contains a part of the map (until max size of packet).
+ */
+ DECLARE_GAME_RECEIVE_COMMAND(PACKET_SERVER_MAP_DATA);
+
+ /**
+ * Sends that all data of the map are sent to the client:
+ */
+ DECLARE_GAME_RECEIVE_COMMAND(PACKET_SERVER_MAP_DONE);
/**
* Tell the server that we are done receiving/loading the map.