From 802d8bcc8fc33fed263b98590373a3bacaa19a9c Mon Sep 17 00:00:00 2001 From: Mr_Goldberg Date: Tue, 6 Sep 2022 13:30:20 -0400 Subject: [PATCH] More accurate SetLobbyData. --- dll/steam_matchmaking.h | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/dll/steam_matchmaking.h b/dll/steam_matchmaking.h index 66a268c..94bd026 100644 --- a/dll/steam_matchmaking.h +++ b/dll/steam_matchmaking.h @@ -809,17 +809,20 @@ bool SetLobbyData( CSteamID steamIDLobby, const char *pchKey, const char *pchVal std::lock_guard lock(global_mutex); Lobby *lobby = get_lobby(steamIDLobby); - if (!lobby || lobby->owner() != settings->get_local_steam_id().ConvertToUint64() || lobby->deleted()) { + if (!lobby || lobby->deleted()) { return false; } - auto result = caseinsensitive_find(lobby->values(), pchKey); bool changed = true; - if (result == lobby->values().end()) { - (*lobby->mutable_values())[pchKey] = pchValue; - } else { - if (result->second == std::string(pchValue)) changed = false; - (*lobby->mutable_values())[result->first] = pchValue; + //callback is always triggered when setlobbydata is called from non owner however no data is actually changed. + if (lobby->owner() == settings->get_local_steam_id().ConvertToUint64()) { + auto result = caseinsensitive_find(lobby->values(), pchKey); + if (result == lobby->values().end()) { + (*lobby->mutable_values())[pchKey] = pchValue; + } else { + if (result->second == std::string(pchValue)) changed = false; + (*lobby->mutable_values())[result->first] = pchValue; + } } if (changed)