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;
LobbyQueryState m_CurrentState = LobbyQueryState.Empty;
public long lastErrorCode;
public LobbyQueryState State
get { return m_CurrentState; }
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>
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)