summaryrefslogtreecommitdiff
path: root/src/network/core/packet.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-01-12 20:19:49 +0000
committerrubidium <rubidium@openttd.org>2007-01-12 20:19:49 +0000
commitf66b373b52b2daef69507c402577a1a02b65c40b (patch)
tree23bff1b129004614fd68cb0c30436a14bbe240e9 /src/network/core/packet.h
parentee1021d29c6baa6380faf17e270fd5194d2b330c (diff)
downloadopenttd-f66b373b52b2daef69507c402577a1a02b65c40b.tar.xz
(svn r8083) -Codechange: make a NetworkSocketHandler as base for all sockets and move a little of NetworkClientState functionality to the NetworkSocketHandler. Move the rest of the NetworkClientState to the new NetworkTCPSocketHandler class/struct, which is not yet implemented in an object oriented manner. The UDP socket handler now extends the NetworkSocketHandler instead of having a reference to a NetworkClientState.
Diffstat (limited to 'src/network/core/packet.h')
-rw-r--r--src/network/core/packet.h23
1 files changed, 6 insertions, 17 deletions
diff --git a/src/network/core/packet.h b/src/network/core/packet.h
index e42c65d5c..65ddec72c 100644
--- a/src/network/core/packet.h
+++ b/src/network/core/packet.h
@@ -6,23 +6,12 @@
#ifdef ENABLE_NETWORK
#include "config.h"
+#include "core.h"
/**
* @file packet.h Basic functions to create, fill and read packets.
*/
-typedef struct NetworkClientState NetworkClientState;
-
-/**
- * Queries the network client state struct to determine whether
- * the client has quit. It indirectly also queries whether the
- * packet is corrupt as the connection will be closed if it is
- * reading beyond the boundary of the received packet.
- * @param cs the state to query
- * @param true if the connection should be considered dropped
- */
-bool HasClientQuit(const NetworkClientState *cs);
-
typedef uint16 PacketSize; ///< Size of the whole packet.
typedef uint8 PacketType; ///< Identifier for the packet
@@ -58,11 +47,11 @@ void NetworkSend_uint64(Packet *packet, uint64 data);
void NetworkSend_string(Packet *packet, const char* data);
void NetworkRecv_ReadPacketSize(Packet *packet);
-uint8 NetworkRecv_uint8 (NetworkClientState *cs, Packet *packet);
-uint16 NetworkRecv_uint16(NetworkClientState *cs, Packet *packet);
-uint32 NetworkRecv_uint32(NetworkClientState *cs, Packet *packet);
-uint64 NetworkRecv_uint64(NetworkClientState *cs, Packet *packet);
-void NetworkRecv_string(NetworkClientState *cs, Packet *packet, char* buffer, size_t size);
+uint8 NetworkRecv_uint8 (NetworkSocketHandler *cs, Packet *packet);
+uint16 NetworkRecv_uint16(NetworkSocketHandler *cs, Packet *packet);
+uint32 NetworkRecv_uint32(NetworkSocketHandler *cs, Packet *packet);
+uint64 NetworkRecv_uint64(NetworkSocketHandler *cs, Packet *packet);
+void NetworkRecv_string(NetworkSocketHandler *cs, Packet *packet, char* buffer, size_t size);
#endif /* ENABLE_NETWORK */