Check for server protocol

This commit is contained in:
quaK 2023-07-01 02:02:04 +03:00
parent ca8dacffdd
commit 31e9523347
2 changed files with 14 additions and 0 deletions

View File

@ -1159,6 +1159,13 @@ namespace party
saved_info_response.host = target;
saved_info_response.info_string = info;
const auto protocl = info.get("protocol");
if (std::atoi(protocl.data()) != PROTOCOL)
{
menu_error("Connection failed: Invalid protocol.");
return;
}
if (info.get("challenge") != connect_state.challenge)
{
menu_error("Connection failed: Invalid challenge.");

View File

@ -316,6 +316,13 @@ namespace server_list
void handle_info_response(const game::netadr_s& address, const utils::info_string& info)
{
// Don't show servers that aren't using the same protocol!
const auto protocol = std::atoi(info.get("protocol").data());
if (protocol != PROTOCOL)
{
return;
}
// Don't show servers that aren't dedicated!
const auto dedicated = std::atoi(info.get("dedicated").data());
if (!dedicated)