From c9ebf14ba5a4461edd8790a96f13f0d1e87d60e1 Mon Sep 17 00:00:00 2001 From: rubidium Date: Sat, 4 Apr 2009 00:48:48 +0000 Subject: (svn r15947) -Codechange: replace uint32 client_ip with NetworkAddress client_address. --- src/network/network.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/network/network.cpp') 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 } } -- cgit v1.2.3-70-g09d2