mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 05:21:29 +00:00
Fix for not having address/localaddress set from not localhost
This commit is contained in:
parent
c8f6b098c2
commit
87d42931aa
@ -1224,21 +1224,34 @@ void Client::Clearance(int8 response)
|
||||
const char *zs_addr = nullptr;
|
||||
if(cle && cle->IsLocalClient()) {
|
||||
const char *local_addr = zs->GetCLocalAddress();
|
||||
|
||||
if(local_addr[0]) {
|
||||
zs_addr = local_addr;
|
||||
} else {
|
||||
struct in_addr in;
|
||||
in.s_addr = zs->GetIP();
|
||||
zs_addr = inet_ntoa(in);
|
||||
if(strcmp(local_addr, "127.0.0.1") == 0)
|
||||
{
|
||||
zs_addr = WorldConfig::get()->LocalAddress.c_str();
|
||||
} else {
|
||||
struct in_addr in;
|
||||
in.s_addr = zs->GetIP();
|
||||
zs_addr = inet_ntoa(in);
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
const char *addr = zs->GetCAddress();
|
||||
if(addr[0]) {
|
||||
zs_addr = addr;
|
||||
} else {
|
||||
struct in_addr in;
|
||||
in.s_addr = zs->GetIP();
|
||||
zs_addr = inet_ntoa(in);
|
||||
if(strcmp(addr, "127.0.0.1") == 0)
|
||||
{
|
||||
zs_addr = WorldConfig::get()->WorldAddress.c_str();
|
||||
}
|
||||
else {
|
||||
struct in_addr in;
|
||||
in.s_addr = zs->GetIP();
|
||||
zs_addr = inet_ntoa(in);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user