Fixes issue where Lobby Owner was being imporperly cached and not updating with the Lobby state.

This commit is contained in:
Kyle Kukshtel 2017-08-16 22:26:37 -07:00
parent fd14512e28
commit d614b1544b

View File

@ -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;
/// <summary>
/// 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;
}