From 1f79ca923172350ee53d01409d7e8a7d29846558 Mon Sep 17 00:00:00 2001 From: Mr_Goldberg Date: Thu, 30 May 2019 07:58:03 -0400 Subject: [PATCH] Basic IsUserInSource implementation for the main lobby. --- dll/steam_friends.h | 9 +++++++++ dll/steam_matchmaking.h | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/dll/steam_friends.h b/dll/steam_friends.h index 8448f13..e63f63d 100644 --- a/dll/steam_friends.h +++ b/dll/steam_friends.h @@ -462,6 +462,15 @@ CSteamID GetFriendFromSourceByIndex( CSteamID steamIDSource, int iFriend ) bool IsUserInSource( CSteamID steamIDUser, CSteamID steamIDSource ) { PRINT_DEBUG("Steam_Friends::IsUserInSource %llu %llu\n", steamIDUser.ConvertToUint64(), steamIDSource.ConvertToUint64()); + if (steamIDUser == settings->get_local_steam_id()) { + if (settings->get_lobby() == steamIDSource) { + return true; + } + } else { + Friend *f = find_friend(steamIDUser); + if (!f) return false; + if (f->lobby_id() == steamIDSource.ConvertToUint64()) return true; + } //TODO return false; } diff --git a/dll/steam_matchmaking.h b/dll/steam_matchmaking.h index b3e4372..1c65a27 100644 --- a/dll/steam_matchmaking.h +++ b/dll/steam_matchmaking.h @@ -623,7 +623,7 @@ SteamAPICall_t JoinLobby( CSteamID steamIDLobby ) data.m_EChatRoomEnterResponse = k_EChatRoomEnterResponseSuccess; auto api = callback_results->addCallResult(data.k_iCallback, &data, sizeof(data)); callbacks->addCBResult(data.k_iCallback, &data, sizeof(data)); - + return api; }