diff --git a/source/WorldServer/Web/HTTPSClientPool.cpp b/source/WorldServer/Web/HTTPSClientPool.cpp index 53fb94d..f9daec4 100644 --- a/source/WorldServer/Web/HTTPSClientPool.cpp +++ b/source/WorldServer/Web/HTTPSClientPool.cpp @@ -525,6 +525,9 @@ void HTTPSClientPool::pollPeerHealth(const std::string& server, const std::strin std::string online_status; int16 peer_priority = 65535; bool peer_primary = false; + + std::string worldAddr(""), internalWorldAddr(""), clientIP(""); + int16 worldPort = 0; if (auto status = json_tree.get_optional("world_status")) { online_status = status.get(); } @@ -534,6 +537,18 @@ void HTTPSClientPool::pollPeerHealth(const std::string& server, const std::strin if (auto isprimary = json_tree.get_optional("peer_primary")) { peer_primary = isprimary.get(); } + if (auto peerclientaddr = tree.get_optional("peer_client_address")) { + worldAddr = peerclientaddr.get(); + } + if (auto peerclient_internaladdr = tree.get_optional("peer_client_internal_address")) { + internalWorldAddr = peerclient_internaladdr.get(); + } + if (auto peerclientport = tree.get_optional("peer_client_port")) { + worldPort = peerclientport.get(); + } + if(worldAddr.size() > 0 && worldPort > 0) { + peer_manager.updatePeer(server, web_worldport, worldAddr, internalWorldAddr, worldPort, peer_primary); + } peer_manager.updatePriority(id, peer_priority); if (peer_primary && net.is_primary) { diff --git a/source/WorldServer/Web/WorldWeb.cpp b/source/WorldServer/Web/WorldWeb.cpp index f9d029e..7b2c07c 100644 --- a/source/WorldServer/Web/WorldWeb.cpp +++ b/source/WorldServer/Web/WorldWeb.cpp @@ -66,6 +66,9 @@ void World::Web_worldhandle_status(const http::request& req, pt.put("world_reloading", world.IsReloadingSubsystems() ? "yes" : "no"); pt.put("peer_primary", net.is_primary); pt.put("peer_priority", net.GetPeerPriority()); + pt.put("peer_client_address", std::string(net.GetWorldAddress())); + pt.put("peer_client_internal_address", std::string(net.GetInternalWorldAddress())); + pt.put("peer_client_port", std::to_string(net.GetWorldPort())); std::ostringstream oss; boost::property_tree::write_json(oss, pt);