浏览代码

Small PR fix on locking state in the data loop.

/main/staging/december_UI_bugs
当前提交
8a53acf9
共有 1 个文件被更改,包括 16 次插入6 次删除
  1. 22
      Assets/Scripts/Lobby/LobbyAsyncRequests.cs

22
Assets/Scripts/Lobby/LobbyAsyncRequests.cs


Lobby lobby = m_lastKnownLobby;
Dictionary<string, DataObject> dataCurr = lobby.Data ?? new Dictionary<string, DataObject>();
var shouldLock = false;
foreach (var dataNew in data)
{
// Special case: We want to be able to filter on our color data, so we need to supply an arbitrary index to retrieve later. Uses N# for numerics, instead of S# for strings.

dataCurr[dataNew.Key] = dataObj;
else
dataCurr.Add(dataNew.Key, dataObj);
}
//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) =>
//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
if (dataNew.Key == "State")
{
Enum.TryParse(dataNew.Value, out LobbyState lobbyState);
shouldLock = lobbyState != LobbyState.Lobby;
}
}
LobbyAPIInterface.UpdateLobbyAsync(lobby.Id, dataCurr, shouldLock, (result) =>
{
if (result != null)
m_lastKnownLobby = result;

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