From 6ce4e637d91a8266bfdcc6868060ccf59825ee39 Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Wed, 6 Dec 2017 12:34:21 +0000 Subject: [PATCH] Enhanced AddScore description --- Facepunch.Steamworks/Client/Leaderboard.cs | 3 ++- Facepunch.Steamworks/Client/Lobby.cs | 16 ++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Facepunch.Steamworks/Client/Leaderboard.cs b/Facepunch.Steamworks/Client/Leaderboard.cs index 5b6c731..ff5b5e0 100644 --- a/Facepunch.Steamworks/Client/Leaderboard.cs +++ b/Facepunch.Steamworks/Client/Leaderboard.cs @@ -132,7 +132,8 @@ namespace Facepunch.Steamworks /// Subscores are totally optional, and can be used for other game defined data such as laps etc.. although /// they have no bearing on sorting at all /// If onlyIfBeatsOldScore is true, the score will only be updated if it beats the existing score, else it will always - /// be updated. + /// be updated. Beating the existing score is subjective - and depends on how your leaderboard was set up as to whether + /// that means higher or lower. /// public bool AddScore( bool onlyIfBeatsOldScore, int score, params int[] subscores ) { diff --git a/Facepunch.Steamworks/Client/Lobby.cs b/Facepunch.Steamworks/Client/Lobby.cs index 2dfa2ca..f0a4dcb 100644 --- a/Facepunch.Steamworks/Client/Lobby.cs +++ b/Facepunch.Steamworks/Client/Lobby.cs @@ -490,7 +490,11 @@ namespace Facepunch.Steamworks /// public void Leave() { - if (CurrentLobby != 0) { client.native.matchmaking.LeaveLobby(CurrentLobby); } + if (CurrentLobby != 0) + { + client.native.matchmaking.LeaveLobby(CurrentLobby); + } + CurrentLobby = 0; CurrentLobbyData = null; } @@ -508,7 +512,6 @@ namespace Facepunch.Steamworks /// Array of member SteamIDs public ulong[] GetMemberIDs() { - ulong[] memIDs = new ulong[NumMembers]; for (int i = 0; i < NumMembers; i++) { @@ -524,14 +527,15 @@ namespace Facepunch.Steamworks /// public bool UserIsInCurrentLobby(ulong steamID) { - if(CurrentLobby == 0) { return false; } + if ( CurrentLobby == 0 ) + return false; + ulong[] mems = GetMemberIDs(); + for (int i = 0; i < mems.Length; i++) { - if(mems[i] == steamID) - { + if ( mems[i] == steamID ) return true; - } } return false;