浏览代码

Added Logic for locking the lobby in the service when the lobby is counting down or in-game.

/main/staging/december_UI_bugs
当前提交
d1e6b9c7
共有 2 个文件被更改,包括 8 次插入5 次删除
  1. 4
      Assets/Scripts/Lobby/LobbyAPIInterface.cs
  2. 9
      Assets/Scripts/Lobby/LobbyAsyncRequests.cs

4
Assets/Scripts/Lobby/LobbyAPIInterface.cs


AsyncRequestLobby.Instance.DoRequest(task, onComplete);
}
public static void UpdateLobbyAsync(string lobbyId, Dictionary<string, DataObject> data, Action<Lobby> onComplete)
public static void UpdateLobbyAsync(string lobbyId, Dictionary<string, DataObject> data, bool shouldLock, Action<Lobby> onComplete)
UpdateLobbyOptions updateOptions = new UpdateLobbyOptions { Data = data };
UpdateLobbyOptions updateOptions = new UpdateLobbyOptions { Data = data , IsLocked = shouldLock};
var task = Lobbies.Instance.UpdateLobbyAsync(lobbyId, updateOptions);
AsyncRequestLobby.Instance.DoRequest(task, onComplete);
}

9
Assets/Scripts/Lobby/LobbyAsyncRequests.cs


else
dataCurr.Add(dataNew.Key, dataObj);
}
LobbyAPIInterface.UpdateLobbyAsync(lobby.Id, dataCurr, (result) => {
//Special Use: Get the state of the Local Lobby so we can lock it from appearing in queries if it's not in the "Lobby" State
Enum.TryParse(data["State"], out LobbyState lobbyState);
LobbyAPIInterface.UpdateLobbyAsync(lobby.Id, dataCurr,lobbyState!=LobbyState.Lobby ,(result) =>
{
if (result != null)
m_lastKnownLobby = result;
onComplete?.Invoke();

}
public override void CopyObserved(RateLimitCooldown oldObserved){/* This behavior isn't needed; we're just here for the OnChanged event management. */}
}
}
正在加载...
取消
保存