Send gameserver lobby callback even when the one set is invalid.

This commit is contained in:
Mr_Goldberg 2021-06-13 00:08:32 -04:00
parent 7350397f9d
commit a3c606c74d
No known key found for this signature in database
GPG Key ID: 8597D87419DEF278
2 changed files with 3 additions and 1 deletions

View File

@ -40,6 +40,7 @@ message Lobby {
uint64 id = 1;
uint32 ip = 2;
uint32 port = 3;
uint32 num_update = 4;
}
Gameserver gameserver = 5;

View File

@ -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);
}