浏览代码

Quick Join errors updated to latest error handling, added unique rate limiter to quick join in accordance with SDK Spec (10 seconds)

/main/staging/lobby_quick_join
当前提交
1b9c4895
共有 4 个文件被更改,包括 65 次插入46 次删除
  1. 2
      Assets/Prefabs/UI/JoinContent.prefab
  2. 94
      Assets/Scenes/mainScene.unity
  3. 2
      Assets/Scripts/Lobby/LobbyAPIInterface.cs
  4. 13
      Assets/Scripts/Lobby/LobbyAsyncRequests.cs

2
Assets/Prefabs/UI/JoinContent.prefab


m_EditorClassIdentifier:
m_target: {fileID: 1530269145881494601}
m_alphaWhenHidden: 0.5
m_requestType: 0
m_requestType: 2
--- !u!1 &2785142534214339697
GameObject:
m_ObjectHideFlags: 0

94
Assets/Scenes/mainScene.unity


m_EditorClassIdentifier:
m_editorLogVerbosity: 0
m_popUp: {fileID: 1228229694}
m_errorReaction:
m_logMessageCallback:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1095306255}
m_TargetAssemblyTypeName: LobbyRelaySample.LogHandlerSettings, LobbyRelaySample
m_MethodName: SpawnErrorPopup
m_Mode: 0
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!224 &1095306259
RectTransform:
m_ObjectHideFlags: 0

objectReference: {fileID: 0}
- target: {fileID: 326167899787007624, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_AnchorMax.y
value: 1
value: 0
value: 1
value: 0
value: 50
value: 0
value: 50
value: 0
value: 67.125
value: 0
value: -27.5
value: 0
value: 1
value: 0
value: 1
value: 0
value: 50
value: 0
value: 50
value: 0
value: 117.125
value: 0
value: -27.5
value: 0
objectReference: {fileID: 0}
- target: {fileID: 383981310721364277, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_fontSize

propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1520381946519648391, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1520381946519648391, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1520381946519648391, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1520381946519648391, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1520381946519648391, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1520381946519648391, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1533286284285053728, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_AnchoredPosition.y
value: -0.5

objectReference: {fileID: 0}
- target: {fileID: 2637199316291327119, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_AnchoredPosition.y
value: -12.5
value: -12.499985
objectReference: {fileID: 0}
- target: {fileID: 2637199316850714327, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_PresetInfoIsWorld

objectReference: {fileID: 0}
- target: {fileID: 3650619398323029537, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_AnchorMax.y
value: 1
value: 0
value: 1
value: 0
value: 50
value: 0
value: 50
value: 0
value: 167.125
value: 0
value: -27.5
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3702807454233794544, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_AnchorMax.y

objectReference: {fileID: 0}
- target: {fileID: 4822032080772604407, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_AnchoredPosition.x
value: -0.00006490946
value: -0.000030517578
value: 0.0000053048134
value: 0.000030517578
objectReference: {fileID: 0}
- target: {fileID: 4824240073023402834, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_AnchorMax.y

objectReference: {fileID: 0}
- target: {fileID: 8392415084811609826, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_AnchorMax.y
value: 1
value: 0
value: 1
value: 0
value: 50
value: 0
value: 50
value: 0
value: 217.125
value: 0
value: -27.5
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8397947723339444263, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_fontSize

2
Assets/Scripts/Lobby/LobbyAPIInterface.cs


};
var task = Lobbies.Instance.QuickJoinLobbyAsync(joinRequest);
AsyncRequest.DoRequest(task, onComplete);
AsyncRequestLobby.Instance.DoRequest(task, onComplete);
}
public static void LeaveLobbyAsync(string requesterUASId, string lobbyId, Action onComplete)

13
Assets/Scripts/Lobby/LobbyAsyncRequests.cs


public enum RequestType
{
Query = 0,
Join
Join,
QuickJoin
}
public RateLimitCooldown GetRateLimit(RequestType type)

else if (type == RequestType.QuickJoin)
return m_rateLimitQuickJoin;
private RateLimitCooldown m_rateLimitQuickJoin = new RateLimitCooldown(10f);
// TODO: Shift to using this to do rate limiting for all API calls? E.g. the lobby data pushing is on its own loop.

public void QuickJoinLobbyAsync(LobbyUser localUser, LobbyColor limitToColor = LobbyColor.None, Action<Lobby> onSuccess = null, Action onFailure = null)
{
if (!m_rateLimitQuickJoin.CanCall())
{
onFailure?.Invoke();
m_rateLimitQuery.EnqueuePendingOperation(() => { QuickJoinLobbyAsync(localUser, limitToColor, onSuccess, onFailure); });
return;
}
var filters = LobbyColorToFilters(limitToColor);
string uasId = AuthenticationService.Instance.PlayerId;
LobbyAPIInterface.QuickJoinLobbyAsync(uasId, filters, CreateInitialPlayerData(localUser), OnLobbyJoined);

正在加载...
取消
保存