diff options
author | rubidium <rubidium@openttd.org> | 2009-04-04 00:48:48 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-04-04 00:48:48 +0000 |
commit | c9ebf14ba5a4461edd8790a96f13f0d1e87d60e1 (patch) | |
tree | 139eee3645f1e8b816308de3439f855da228f89b /src/network/network.cpp | |
parent | 2fd9f0fffa0d7e13d098f29fc04b8028adce8acf (diff) | |
download | openttd-c9ebf14ba5a4461edd8790a96f13f0d1e87d60e1.tar.xz |
(svn r15947) -Codechange: replace uint32 client_ip with NetworkAddress client_address.
Diffstat (limited to 'src/network/network.cpp')
-rw-r--r-- | src/network/network.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/network/network.cpp b/src/network/network.cpp index 9dee049f5..5cc15bf69 100644 --- a/src/network/network.cpp +++ b/src/network/network.cpp @@ -123,10 +123,12 @@ NetworkClientInfo *NetworkFindClientInfoFromClientID(ClientID client_id) NetworkClientInfo *NetworkFindClientInfoFromIP(const char *ip) { NetworkClientInfo *ci; - uint32 ip_number = inet_addr(ip); + NetworkAddress address(ip); + + if (address.GetAddressLength() == 0) return NULL; FOR_ALL_CLIENT_INFOS(ci) { - if (ci->client_ip == ip_number) return ci; + if (ci->client_address == address) return ci; } return NULL; @@ -526,7 +528,7 @@ static void NetworkAcceptClients() * the client stays inactive */ cs->status = STATUS_INACTIVE; - cs->GetInfo()->client_ip = ((sockaddr_in*)&sin)->sin_addr.s_addr; // Save the IP of the client + cs->GetInfo()->client_address = address; // Save the IP of the client } } |