Check for server protocol
This commit is contained in:
parent
ca8dacffdd
commit
31e9523347
@ -1159,6 +1159,13 @@ namespace party
|
|||||||
saved_info_response.host = target;
|
saved_info_response.host = target;
|
||||||
saved_info_response.info_string = info;
|
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)
|
if (info.get("challenge") != connect_state.challenge)
|
||||||
{
|
{
|
||||||
menu_error("Connection failed: Invalid challenge.");
|
menu_error("Connection failed: Invalid challenge.");
|
||||||
|
@ -316,6 +316,13 @@ namespace server_list
|
|||||||
|
|
||||||
void handle_info_response(const game::netadr_s& address, const utils::info_string& info)
|
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!
|
// Don't show servers that aren't dedicated!
|
||||||
const auto dedicated = std::atoi(info.get("dedicated").data());
|
const auto dedicated = std::atoi(info.get("dedicated").data());
|
||||||
if (!dedicated)
|
if (!dedicated)
|
||||||
|
Loading…
Reference in New Issue
Block a user