From fd14512e2889971ae88edb5e941b03b16817078b Mon Sep 17 00:00:00 2001 From: Kyle Kukshtel Date: Wed, 16 Aug 2017 19:45:35 -0700 Subject: [PATCH 1/2] fixes bug where Lobby Owner was unable to be set --- Facepunch.Steamworks.Test/Facepunch.Steamworks.Test.csproj | 1 + Facepunch.Steamworks/Client/Lobby.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Facepunch.Steamworks.Test/Facepunch.Steamworks.Test.csproj b/Facepunch.Steamworks.Test/Facepunch.Steamworks.Test.csproj index 891970f..d60fc27 100644 --- a/Facepunch.Steamworks.Test/Facepunch.Steamworks.Test.csproj +++ b/Facepunch.Steamworks.Test/Facepunch.Steamworks.Test.csproj @@ -94,6 +94,7 @@ + diff --git a/Facepunch.Steamworks/Client/Lobby.cs b/Facepunch.Steamworks/Client/Lobby.cs index 1d20130..4dd2725 100644 --- a/Facepunch.Steamworks/Client/Lobby.cs +++ b/Facepunch.Steamworks/Client/Lobby.cs @@ -421,7 +421,7 @@ public ulong Owner } return _owner; } - private set + set { if (_owner == value) return; if (client.native.matchmaking.SetLobbyOwner(CurrentLobby, value)) { _owner = value; } From d614b1544b1f956cc461e630cea3f6e7817d788b Mon Sep 17 00:00:00 2001 From: Kyle Kukshtel Date: Wed, 16 Aug 2017 22:26:37 -0700 Subject: [PATCH 2/2] Fixes issue where Lobby Owner was being imporperly cached and not updating with the Lobby state. --- Facepunch.Steamworks/Client/Lobby.cs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Facepunch.Steamworks/Client/Lobby.cs b/Facepunch.Steamworks/Client/Lobby.cs index 4dd2725..8f7e09e 100644 --- a/Facepunch.Steamworks/Client/Lobby.cs +++ b/Facepunch.Steamworks/Client/Lobby.cs @@ -415,19 +415,18 @@ public ulong Owner { get { - if (_owner == 0 && IsValid) + if (IsValid) { - _owner = client.native.matchmaking.GetLobbyOwner(CurrentLobby); + return client.native.matchmaking.GetLobbyOwner(CurrentLobby); } - return _owner; + return 0; } set { - if (_owner == value) return; - if (client.native.matchmaking.SetLobbyOwner(CurrentLobby, value)) { _owner = value; } + if (Owner == value) return; + client.native.matchmaking.SetLobbyOwner(CurrentLobby, value); } } - ulong _owner = 0; /// /// Is the Lobby joinable by other people? Defaults to true; @@ -490,7 +489,6 @@ public void Leave() { if (CurrentLobby != 0) { client.native.matchmaking.LeaveLobby(CurrentLobby); } CurrentLobby = 0; - _owner = 0; CurrentLobbyData = null; }