summaryrefslogtreecommitdiff
path: root/src/network/network_internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/network_internal.h')
-rw-r--r--src/network/network_internal.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/network/network_internal.h b/src/network/network_internal.h
index 25240da5d..58c99867c 100644
--- a/src/network/network_internal.h
+++ b/src/network/network_internal.h
@@ -15,6 +15,8 @@
#include "core/tcp_game.h"
#include "../command_type.h"
+#include "../command_func.h"
+#include "../misc/endian_buffer.hpp"
#ifdef RANDOM_DEBUG
/**
@@ -104,19 +106,26 @@ void UpdateNetworkGameWindow();
/**
* Everything we need to know about a command to be able to execute it.
*/
-struct CommandPacket : CommandContainer {
+struct CommandPacket {
/** Make sure the pointer is nullptr. */
- CommandPacket() : next(nullptr), company(INVALID_COMPANY), frame(0), my_cmd(false) {}
+ CommandPacket() : next(nullptr), company(INVALID_COMPANY), frame(0), my_cmd(false), tile(0) {}
CommandPacket *next; ///< the next command packet (if in queue)
CompanyID company; ///< company that is executing the command
uint32 frame; ///< the frame in which this packet is executed
bool my_cmd; ///< did the command originate from "me"
+
+ Commands cmd; ///< command being executed.
+ StringID err_msg; ///< string ID of error message to use.
+ CommandCallback *callback; ///< any callback function executed upon successful completion of the command.
+ TileIndex tile; ///< location of the command (for e.g. error message or effect display).
+ CommandDataBuffer data; ///< command parameters.
};
void NetworkDistributeCommands();
void NetworkExecuteLocalCommandQueue();
void NetworkFreeLocalCommandQueue();
void NetworkSyncCommandQueue(NetworkClientSocket *cs);
+void NetworkReplaceCommandClientId(CommandPacket &cp, ClientID client_id);
void ShowNetworkError(StringID error_string);
void NetworkTextMessage(NetworkAction action, TextColour colour, bool self_send, const std::string &name, const std::string &str = "", int64 data = 0, const std::string &data_str = "");