summaryrefslogtreecommitdiff
path: root/src/network/core/tcp_game.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-10-15 13:22:00 +0000
committerrubidium <rubidium@openttd.org>2010-10-15 13:22:00 +0000
commit8eb07d097e2ab53f0b41a6b7af541c4937732e0b (patch)
tree6722210c26413da2881daeff5f1a8d387814c450 /src/network/core/tcp_game.h
parent951b725b8c001003b38f0b009b6d6df55cb6ec02 (diff)
downloadopenttd-8eb07d097e2ab53f0b41a6b7af541c4937732e0b.tar.xz
(svn r20923) -Codechange: prepare creating sub-classes of NetworkClientSocket for server and client side
Diffstat (limited to 'src/network/core/tcp_game.h')
-rw-r--r--src/network/core/tcp_game.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/network/core/tcp_game.h b/src/network/core/tcp_game.h
index acbd47ed8..77da6218c 100644
--- a/src/network/core/tcp_game.h
+++ b/src/network/core/tcp_game.h
@@ -108,15 +108,18 @@ enum ClientStatus {
STATUS_END ///< Must ALWAYS be on the end of this list!! (period)
};
-class NetworkClientSocket;
+class NetworkGameSocketHandler;
+typedef NetworkGameSocketHandler NetworkClientSocket;
typedef Pool<NetworkClientSocket, ClientIndex, 8, MAX_CLIENT_SLOTS> NetworkClientSocketPool;
extern NetworkClientSocketPool _networkclientsocket_pool;
/** Base socket handler for all TCP sockets */
-class NetworkClientSocket : public NetworkClientSocketPool::PoolItem<&_networkclientsocket_pool>, public NetworkTCPSocketHandler {
+class NetworkGameSocketHandler : public NetworkClientSocketPool::PoolItem<&_networkclientsocket_pool>, public NetworkTCPSocketHandler {
/* TODO: rewrite into a proper class */
private:
NetworkClientInfo *info; ///< Client info related to this socket
+protected:
+ NetworkGameSocketHandler(SOCKET s);
public:
ClientID client_id; ///< Client identifier
uint32 last_frame; ///< Last frame we have executed
@@ -129,9 +132,7 @@ public:
CommandQueue outgoing_queue; ///< The command-queue awaiting delivery
NetworkRecvStatus CloseConnection(bool error = true);
-
- NetworkClientSocket(ClientID client_id = INVALID_CLIENT_ID);
- ~NetworkClientSocket();
+ virtual ~NetworkGameSocketHandler() {}
inline void SetInfo(NetworkClientInfo *info) { assert(info != NULL && this->info == NULL); this->info = info; }
inline NetworkClientInfo *GetInfo() const { return this->info; }