From a3c606c74dabbea7884d8649e624a115e0dbfd4b Mon Sep 17 00:00:00 2001 From: Mr_Goldberg Date: Sun, 13 Jun 2021 00:08:32 -0400 Subject: [PATCH] Send gameserver lobby callback even when the one set is invalid. --- dll/net.proto | 1 + dll/steam_matchmaking.h | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/dll/net.proto b/dll/net.proto index f85fe0a..cbe1e12 100644 --- a/dll/net.proto +++ b/dll/net.proto @@ -40,6 +40,7 @@ message Lobby { uint64 id = 1; uint32 ip = 2; uint32 port = 3; + uint32 num_update = 4; } Gameserver gameserver = 5; diff --git a/dll/steam_matchmaking.h b/dll/steam_matchmaking.h index 695d49c..5ebbf3e 100644 --- a/dll/steam_matchmaking.h +++ b/dll/steam_matchmaking.h @@ -993,6 +993,7 @@ void SetLobbyGameServer( CSteamID steamIDLobby, uint32 unGameServerIP, uint16 un lobby->mutable_gameserver()->set_id(steamIDGameServer.ConvertToUint64()); lobby->mutable_gameserver()->set_ip(unGameServerIP); lobby->mutable_gameserver()->set_port(unGameServerPort); + lobby->mutable_gameserver()->set_num_update(lobby->gameserver().num_update() + 1); send_gameservercreated_cb(lobby->room_id(), lobby->gameserver().id(), lobby->gameserver().ip(), lobby->gameserver().port()); trigger_lobby_dataupdate(steamIDLobby, steamIDLobby, true); @@ -1385,7 +1386,7 @@ void Callback(Common_Message *msg) } } - if (((joined) || (we_are_in_lobby && !protobuf_message_equal(lobby->gameserver(), msg->lobby().gameserver()))) && (CSteamID((uint64)msg->lobby().gameserver().id()).IsValid() || msg->lobby().gameserver().ip())) { + if ((joined && msg->lobby().gameserver().num_update()) || (we_are_in_lobby && (lobby->gameserver().num_update() != msg->lobby().gameserver().num_update()))) { send_gameservercreated_cb(lobby->room_id(), msg->lobby().gameserver().id(), msg->lobby().gameserver().ip(), msg->lobby().gameserver().port()); trigger_lobby_dataupdate((uint64)lobby->room_id(), (uint64)lobby->room_id(), true); }