Update client.cpp HandleEnterWorldPacket for UCS Local Address (#5020)

world/client.cpp's EnterWorld will correctly serve a LAN client the eqemu_config.json.world.localaddress based off IsLocalClient. It will then serve a non-LAN client the world.address value. This concept needs to be applied to UCS as that system also receives direct client connections. Inside world/client.cpp HandleEnterWorldPacket is where world sends the client info about UCS connection. This fix specifically handles the issue when you have a server on LAN and want to connect to it via another LAN computer + you have external clients.
This commit is contained in:
Jordan Conner 2025-10-23 01:37:37 -04:00 committed by GitHub
parent ecc0d4b5c0
commit eb4e7d694c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1019,8 +1019,16 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) {
break;
}
std::string ucs_addr = config->GetUCSHost();
if (cle && cle->IsLocalClient()) {
const char* local_addr = config->LocalAddress.c_str();
if (local_addr[0]) {
ucs_addr = local_addr;
}
}
buffer = fmt::format("{},{},{}.{},{}{:08X}",
config->GetUCSHost(),
ucs_addr,
config->GetUCSPort(),
config->ShortName,
GetCharName(),
@ -1046,7 +1054,7 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) {
}
buffer = fmt::format("{},{},{}.{},{}{:08X}",
config->GetUCSHost(),
ucs_addr,
config->GetUCSPort(),
config->ShortName,
GetCharName(),