From eb4e7d694c8c89ebcf1f8b0489e0f311206546e8 Mon Sep 17 00:00:00 2001 From: Jordan Conner <321j.con@gmail.com> Date: Thu, 23 Oct 2025 01:37:37 -0400 Subject: [PATCH] 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. --- world/client.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/world/client.cpp b/world/client.cpp index a2d35a485..674d09639 100644 --- a/world/client.cpp +++ b/world/client.cpp @@ -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(),