mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
net_addr_comp_ip -> net_addr_comp_noport
This commit is contained in:
parent
f1867e0403
commit
2e137e6fc7
|
@ -997,9 +997,12 @@ int net_addr_comp(const NETADDR *a, const NETADDR *b)
|
|||
return mem_comp(a, b, sizeof(NETADDR));
|
||||
}
|
||||
|
||||
int net_addr_comp_ip(const NETADDR *a, const NETADDR *b)
|
||||
int net_addr_comp_noport(const NETADDR *a, const NETADDR *b)
|
||||
{
|
||||
return mem_comp(a->ip, b->ip, sizeof(a->ip));
|
||||
NETADDR ta = *a, tb = *b;
|
||||
ta.port = tb.port = 0;
|
||||
|
||||
return net_addr_comp(&ta, &tb);
|
||||
}
|
||||
|
||||
void net_addr_str(const NETADDR *addr, char *string, int max_length, int add_port)
|
||||
|
|
|
@ -673,8 +673,8 @@ int net_host_lookup(const char *hostname, NETADDR *addr, int types);
|
|||
int net_addr_comp(const NETADDR *a, const NETADDR *b);
|
||||
|
||||
/*
|
||||
Function: net_addr_comp_ip
|
||||
Compares two network addresses by ip.
|
||||
Function: net_addr_comp_noport
|
||||
Compares two network addresses ignoring port.
|
||||
|
||||
Parameters:
|
||||
a - Address to compare
|
||||
|
@ -685,7 +685,7 @@ int net_addr_comp(const NETADDR *a, const NETADDR *b);
|
|||
0 - Address a is equal to address b
|
||||
>0 - Address a is greater than address b
|
||||
*/
|
||||
int net_addr_comp_ip(const NETADDR *a, const NETADDR *b);
|
||||
int net_addr_comp_noport(const NETADDR *a, const NETADDR *b);
|
||||
|
||||
/*
|
||||
Function: net_addr_str
|
||||
|
|
|
@ -587,7 +587,7 @@ int CServer::DistinctClientCount()
|
|||
ClientCount++;
|
||||
for(int j = 0; j < MAX_CLIENTS; j++)
|
||||
{
|
||||
if(!net_addr_comp_ip(&aAddresses[i], &aAddresses[j]))
|
||||
if(!net_addr_comp_noport(&aAddresses[i], &aAddresses[j]))
|
||||
{
|
||||
ClientCount--;
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue