(svn r15947) -Codechange: replace uint32 client_ip with NetworkAddress client_address.

This commit is contained in:
rubidium
2009-04-04 00:48:48 +00:00
parent 2fd9f0fffa
commit c9ebf14ba5
7 changed files with 19 additions and 21 deletions

View File

@@ -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
}
}