[Party] Remove doubly added backslash (#537)
* [Party] Remove doubly added backslash * [ServerInfo] Add version to the info endpoint
This commit is contained in:
parent
634a4da2d7
commit
83e924201c
@ -743,10 +743,8 @@ namespace Components
|
||||
// Only handle http requests
|
||||
if (ev != MG_EV_HTTP_REQUEST) return;
|
||||
|
||||
//if (!Download::VerifyPassword(nc, reinterpret_cast<http_message*>(ev_data))) return;
|
||||
|
||||
Utils::InfoString status = ServerInfo::GetInfo();
|
||||
Utils::InfoString host = ServerInfo::GetHostInfo();
|
||||
const auto status = ServerInfo::GetInfo();
|
||||
const auto host = ServerInfo::GetHostInfo();
|
||||
|
||||
std::map<std::string, nlohmann::json> info;
|
||||
info["status"] = status.to_json();
|
||||
|
@ -397,7 +397,7 @@ namespace Components
|
||||
info.set("wwwDownload", (Dvar::Var("sv_wwwDownload").get<bool>() ? "1" : "0"));
|
||||
info.set("wwwUrl", Dvar::Var("sv_wwwBaseUrl").get<std::string>());
|
||||
|
||||
Network::SendCommand(address, "infoResponse", "\\" + info.build());
|
||||
Network::SendCommand(address, "infoResponse", info.build());
|
||||
});
|
||||
|
||||
Network::OnClientPacket("infoResponse", [](const Network::Address& address, [[maybe_unused]] const std::string& data)
|
||||
|
@ -141,6 +141,7 @@ namespace Components
|
||||
info.set("sv_maxclients", Utils::String::VA("%i", maxClientCount));
|
||||
info.set("protocol", Utils::String::VA("%i", PROTOCOL));
|
||||
info.set("shortversion", SHORTVERSION);
|
||||
info.set("version", (*Game::version)->current.string);
|
||||
info.set("mapname", (*Game::sv_mapname)->current.string);
|
||||
info.set("isPrivate", (Dvar::Var("g_password").get<std::string>().empty() ? "0" : "1"));
|
||||
info.set("checksum", Utils::String::VA("%X", Utils::Cryptography::JenkinsOneAtATime::Compute(Utils::String::VA("%u", Game::Sys_Milliseconds()))));
|
||||
@ -226,7 +227,7 @@ namespace Components
|
||||
playerList.append(Utils::String::VA("%i %i \"%s\"\n", score, ping, name.data()));
|
||||
}
|
||||
|
||||
Network::SendCommand(address, "statusResponse", "\\" + info.build() + "\n" + playerList + "\n");
|
||||
Network::SendCommand(address, "statusResponse", info.build() + "\n" + playerList + "\n");
|
||||
});
|
||||
|
||||
Network::OnClientPacket("statusResponse", [](const Network::Address& address, [[maybe_unused]] const std::string& data)
|
||||
|
Loading…
Reference in New Issue
Block a user