[Download] Change json

This commit is contained in:
/dev/root 2018-12-03 21:48:12 +01:00
parent 3f9f58d5f6
commit 70a60517ee
3 changed files with 7 additions and 5 deletions

View File

@ -475,13 +475,9 @@ namespace Components
// Build server list
for (auto& node : Node::GetNodes())
{
std::map<std::string, json11::Json> serverInfo;
serverInfo["address"] = "127.0.0.1:28960";
if (node.isValid())
{
serverInfo["address"] = node.address.getCString();
servers.push_back(serverInfo);
servers.push_back(json11::Json{ node });
}
}

View File

@ -50,6 +50,11 @@ namespace Components
this->lastRequest.reset();
}
json11::Json Node::Entry::to_json() const
{
return this->address.getString();
}
void Node::LoadNodeRemotePreset()
{
std::string nodes = Utils::Cache::GetFile("/iw4/nodes.txt");

View File

@ -35,6 +35,7 @@ namespace Components
void sendRequest();
void reset();
json11::Json to_json() const;
};
Node();