浏览代码

Validated a couple notes from the previous changeset. Removed error code from the lobby list query since we no longer are provided the HTTP error code directly.

/main/staging/Open_beta_Update
nathaniel.buck@unity3d.com 3 年前
当前提交
899c1d93
共有 4 个文件被更改,包括 5 次插入22 次删除
  1. 10
      Assets/Scripts/Game/GameManager.cs
  2. 1
      Assets/Scripts/Game/LobbyServiceData.cs
  3. 4
      Assets/Scripts/Lobby/LobbyAsyncRequests.cs
  4. 12
      Assets/Scripts/UI/SpinnerUI.cs

10
Assets/Scripts/Game/GameManager.cs


m_lobbyServiceData.State = LobbyQueryState.Fetching;
LobbyAsyncRequests.Instance.RetrieveLobbyListAsync(
qr =>
{
if (qr != null)
{ if (qr != null)
{
long errorLong = 0;
OnLobbyQueryFailed(errorLong); // TODO: What to supply here?
{ OnLobbyQueryFailed();
},
m_lobbyColorFilter);
}

m_lobbyServiceData.CurrentLobbies = newLobbyDict;
}
private void OnLobbyQueryFailed(long errorCode)
private void OnLobbyQueryFailed()
m_lobbyServiceData.lastErrorCode = errorCode;
m_lobbyServiceData.State = LobbyQueryState.Error;
}

1
Assets/Scripts/Game/LobbyServiceData.cs


{
LobbyQueryState m_CurrentState = LobbyQueryState.Empty;
public long lastErrorCode;
public LobbyQueryState State
{
get { return m_CurrentState; }

4
Assets/Scripts/Lobby/LobbyAsyncRequests.cs


string uasId = AuthenticationService.Instance.PlayerId;
LobbyAPIInterface.CreateLobbyAsync(uasId, lobbyName, maxPlayers, isPrivate, CreateInitialPlayerData(localUser), OnLobbyCreated);
// TODO: What about errors?
void OnLobbyCreated(Lobby response)
{
if (response == null)

if (response != null)
onListRetrieved?.Invoke(response);
else
onError?.Invoke(response); // TODO: Hmm...how do we know if there was a failure?
onError?.Invoke(response);
}
}
/// <param name="onComplete">If no lobby is retrieved, this is given null.</param>

12
Assets/Scripts/UI/SpinnerUI.cs


{
spinnerImage.Hide();
errorTextVisibility.Show();
var errorString = new StringBuilder();
errorString.Append("Error");
errorString.Append(": ");
if (observed.lastErrorCode > 0)
{
errorString.Append(observed.lastErrorCode);
errorString.Append(", ");
}
errorString.Append("Check Unity Console Log for Details.");
errorText.SetText(errorString.ToString());
errorText.SetText("Error. See Unity Console log for details.");
}
else if (observed.State == LobbyQueryState.Fetched)
{

正在加载...
取消
保存