summaryrefslogtreecommitdiff
path: root/src/network/network_internal.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-01-08 14:40:18 +0000
committerrubidium <rubidium@openttd.org>2009-01-08 14:40:18 +0000
commit427e2d30c538e2edc1e9a570a2bf349b36dc5d75 (patch)
treeaaad012b34556fa555a78f97f1b9ff51be515025 /src/network/network_internal.h
parent38bd396f9022748b8768a543be5234c46c7d68fa (diff)
downloadopenttd-427e2d30c538e2edc1e9a570a2bf349b36dc5d75.tar.xz
(svn r14915) -Codechange: unify the receiving and sending of commands, and thus unifying most of the validity checking too.
Diffstat (limited to 'src/network/network_internal.h')
-rw-r--r--src/network/network_internal.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/network/network_internal.h b/src/network/network_internal.h
index 5512528c3..d3bb63584 100644
--- a/src/network/network_internal.h
+++ b/src/network/network_internal.h
@@ -16,6 +16,8 @@
#include "core/packet.h"
#include "core/tcp.h"
+#include "../command_type.h"
+
/**
* If this line is enable, every frame will have a sync test
* this is not needed in normal games. Normal is like 1 sync in 100
@@ -129,6 +131,16 @@ void UpdateNetworkGameWindow(bool unselect);
bool IsNetworkCompatibleVersion(const char *version);
/* From network_command.cpp */
+/**
+ * Everything we need to know about a command to be able to execute it.
+ */
+struct CommandPacket : CommandContainer {
+ CommandPacket *next; ///< the next command packet (if in queue)
+ CompanyByte 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"
+};
+
void NetworkAddCommandQueue(CommandPacket cp, NetworkClientSocket *cs = NULL);
void NetworkExecuteLocalCommandQueue();
void NetworkFreeLocalCommandQueue();