summaryrefslogtreecommitdiff
path: root/src/network/core
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-12-23 08:39:30 +0000
committerrubidium <rubidium@openttd.org>2008-12-23 08:39:30 +0000
commit9a965577636e5369dd99ac00c2d68cf41ad19697 (patch)
tree195e0e3d8e52be7e4c308d394d03d4468a967c67 /src/network/core
parentbdd92008cf1506823baba4d83d4d59b185b3decf (diff)
downloadopenttd-9a965577636e5369dd99ac00c2d68cf41ad19697.tar.xz
(svn r14719) -Codechange: replace DEREF_CLIENT with an instance function and replace looping socket structs with info structs when the loop is only interested in the info structs (i.e. not derefing the info from sockets when one can loop info directly and the socket isn't used)
Diffstat (limited to 'src/network/core')
-rw-r--r--src/network/core/tcp.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/network/core/tcp.h b/src/network/core/tcp.h
index 1bafbf26e..f956aa105 100644
--- a/src/network/core/tcp.h
+++ b/src/network/core/tcp.h
@@ -110,6 +110,13 @@ public:
bool IsPacketQueueEmpty();
Packet *Recv_Packet(NetworkRecvStatus *status);
+
+ inline NetworkClientInfo *GetInfo() const
+ {
+ extern NetworkClientInfo _network_client_info[MAX_CLIENT_INFO];
+ extern NetworkTCPSocketHandler _clients[MAX_CLIENTS];
+ return &_network_client_info[this - _clients];
+ }
};
#endif /* ENABLE_NETWORK */