diff options
author | rubidium <rubidium@openttd.org> | 2008-12-23 08:39:30 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-12-23 08:39:30 +0000 |
commit | b4734ee9a4d352785f1332f59c363186abe29695 (patch) | |
tree | 195e0e3d8e52be7e4c308d394d03d4468a967c67 /src/network/core | |
parent | 94e7f41a9d54a6c1015778f2a84815c28f8b8461 (diff) | |
download | openttd-b4734ee9a4d352785f1332f59c363186abe29695.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.h | 7 |
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 */ |