diff --git a/source/LoginServer/Web/LoginWeb.cpp b/source/LoginServer/Web/LoginWeb.cpp index e1e26e3..787cc4d 100644 --- a/source/LoginServer/Web/LoginWeb.cpp +++ b/source/LoginServer/Web/LoginWeb.cpp @@ -52,11 +52,13 @@ void LWorldList::PopulateWorldList(http::response& res) { pt.put("world_name", world->GetName()); pt.put("status", (world->GetStatus() == 1) ? "online" : "offline"); pt.put("ip_addr", inet_ntoa(in)); - maintree.add_child("WorldServer", pt); + maintree.push_back(std::make_pair("", pt)); } } - boost::property_tree::write_json(oss, maintree); + boost::property_tree::ptree result; + result.add_child("WorldServers", maintree); + boost::property_tree::write_json(oss, result); std::string json = oss.str(); res.body() = json; res.prepare_payload(); diff --git a/source/WorldServer/Web/WorldWeb.cpp b/source/WorldServer/Web/WorldWeb.cpp index c8ff5ec..5c9440d 100644 --- a/source/WorldServer/Web/WorldWeb.cpp +++ b/source/WorldServer/Web/WorldWeb.cpp @@ -71,12 +71,14 @@ void ZoneList::PopulateClientList(http::response& res) { pt.put("is_linkdead", linkdead); pt.put("in_zone", cur->IsReadyForUpdates()); pt.put("zonename", (cur->GetPlayer() && cur->GetPlayer()->GetZone()) ? cur->GetPlayer()->GetZone()->GetZoneName() : "N/A"); - maintree.add_child("Client", pt); + maintree.push_back(std::make_pair("", pt)); } } MClientList.unlock(); - boost::property_tree::write_json(oss, maintree); + boost::property_tree::ptree result; + result.add_child("Clients", maintree); + boost::property_tree::write_json(oss, result); std::string json = oss.str(); res.body() = json; res.prepare_payload();