浏览代码

Bugs: Setting LogHandler severity in-editor changes it at runtime. Handling some minor TODOs. Fixing an issue with getting some Vivor errors if disconnecting from a lobby before the Vivox connection completes.

/main/staging/bugs_various
nathaniel.buck@unity3d.com 3 年前
当前提交
3b9ddfce
共有 4 个文件被更改,包括 28 次插入12 次删除
  1. 6
      Assets/Scripts/Game/LocalLobby.cs
  2. 8
      Assets/Scripts/Infrastructure/LogHandlerSettings.cs
  3. 9
      Assets/Scripts/Lobby/LobbyAsyncRequests.cs
  4. 17
      Assets/Scripts/Vivox/VivoxUserHandler.cs

6
Assets/Scripts/Game/LocalLobby.cs


get => m_data.Color;
set
{
m_data.Color = value;
OnChanged(this);
if (m_data.Color != value)
{ m_data.Color = value;
OnChanged(this);
}
}
}

8
Assets/Scripts/Infrastructure/LogHandlerSettings.cs


Locator.Get.Messenger.Unsubscribe(this);
}
/// <summary>
/// For convenience while in the Editor, update the log verbosity when its value is changed in the Inspector.
/// </summary>
public void OnValidate()
{
LogHandler.Get().mode = m_editorLogVerbosity;
}
public void OnReceiveMessage(MessageType type, object msg)
{
if (type == MessageType.DisplayErrorPopup && msg != null)

9
Assets/Scripts/Lobby/LobbyAsyncRequests.cs


#region Lobby API calls are rate limited, and some other operations might want an alert when the rate limits have passed.
// Note that some APIs limit to 1 call per N seconds, while others limit to M calls per N seconds. We'll treat all APIs as though they limited to 1 call per N seconds.
// Also, this is serialized by some MonoBehaviours, so don't reorder the values unless you know what that will affect.
// Also, this is seralized, so don't reorder the values unless you know what that will affect.
public enum RequestType
{
Query = 0,

if (!m_rateLimitHost.CanCall())
{
onFailure?.Invoke();
UnityEngine.Debug.LogWarning("Create Lobby hit the rate limit.");
return;
}

(lobbyId == null && lobbyCode == null))
{
onFailure?.Invoke();
// TODO: Emit some failure message.
UnityEngine.Debug.LogWarning("Join Lobby hit the rate limit.");
return;
}

if (!m_rateLimitQuickJoin.CanCall())
{
onFailure?.Invoke();
UnityEngine.Debug.LogWarning("Quick Join Lobby hit the rate limit.");
return;
}

{
onListRetrieved?.Invoke(null);
m_rateLimitQuery.EnqueuePendingOperation(() => { RetrieveLobbyListAsync(onListRetrieved, onError, limitToColor); });
UnityEngine.Debug.LogWarning("Retrieve Lobby list hit the rate limit. Will try again soon...");
return;
}

if (!m_rateLimitQuery.CanCall())
{
onComplete?.Invoke(null);
UnityEngine.Debug.LogWarning("Retrieve Lobby hit the rate limit.");
return;
}
LobbyAPIInterface.GetLobbyAsync(lobbyId, OnGet);

17
Assets/Scripts/Vivox/VivoxUserHandler.cs


}
}
public void OnChannelJoined(IChannelSession channelSession)
public void OnChannelJoined(IChannelSession channelSession) // Called after a connection is established, which begins once a lobby is joined.
{
m_channelSession = channelSession;
m_channelSession.Participants.AfterKeyAdded += OnParticipantAdded;

public void OnChannelLeft()
public void OnChannelLeft() // Called when we leave the lobby.
m_channelSession.Participants.AfterKeyAdded -= OnParticipantAdded;
m_channelSession.Participants.BeforeKeyRemoved -= BeforeParticipantRemoved;
m_channelSession.Participants.AfterValueUpdated -= OnParticipantValueUpdated;
m_channelSession = null;
if (m_channelSession != null) // It's possible we'll attempt to leave a channel that isn't joined, if we leave the lobby while Vivox is connecting.
{
m_channelSession.Participants.AfterKeyAdded -= OnParticipantAdded;
m_channelSession.Participants.BeforeKeyRemoved -= BeforeParticipantRemoved;
m_channelSession.Participants.AfterValueUpdated -= OnParticipantValueUpdated;
m_channelSession = null;
}
}
/// <summary>

}
else
{ m_lobbyUserVolumeUI.EnableVoice(false);
participant.SetIsMuteForAll(m_vivoxId, false, null);
participant.SetIsMuteForAll(m_vivoxId, false, null); // Also note: This call is asynchronous, so it's possible to exit the lobby before this completes, resulting in a Vivox error.
}
}
else if (property == "IsMutedForAll")

正在加载...
取消
保存