浏览代码

Addressing remaining TODOs (which are all either outdated, handled in other changesets, or captured as a work item). Also addressing a couple compiler warnings -- one to suppress when DTLS isn't available and one for a deprecated Relay API.

/main/staging/ngo_more_cleanup
nathaniel.buck@unity3d.com 3 年前
当前提交
d3a2da52
共有 5 个文件被更改,包括 6 次插入9 次删除
  1. 2
      Assets/Scripts/Lobby/LobbyAsyncRequests.cs
  2. 3
      Assets/Scripts/Netcode/Scorer.cs
  3. 2
      Assets/Scripts/Netcode/SequenceSelector.cs
  4. 4
      Assets/Scripts/Relay/RelayUtpSetup.cs
  5. 4
      Assets/Scripts/Tests/PlayMode/UtpTests.cs

2
Assets/Scripts/Lobby/LobbyAsyncRequests.cs


private RateLimitCooldown m_rateLimitQuickJoin = new RateLimitCooldown(10f);
private RateLimitCooldown m_rateLimitHost = new RateLimitCooldown(3f);
// TODO: Shift to using this to do rate limiting for all API calls? E.g. the lobby data pushing is on its own loop.
#endregion
private static Dictionary<string, PlayerDataObject> CreateInitialPlayerData(LobbyUser player)

3
Assets/Scripts/Netcode/Scorer.cs


namespace LobbyRelaySample.ngo
{
// TODO: I'm using host and server interchangeably...which in part I have to since it's ServerRpc but I think IsHost vs. IsServer yield different results in some places?
// TODO: Most of the ints could be bytes?
[SerializeField] private NetworkedDataStore m_dataStore = default;
private ulong m_localId;
[SerializeField] private TMP_Text m_scoreOutputText = default;

2
Assets/Scripts/Netcode/SequenceSelector.cs


[SerializeField] private SymbolData m_symbolData = default;
[SerializeField] private Image[] m_targetSequenceOutput = default;
public const int k_symbolCount = 200;
private bool m_hasReceivedTargetSequence = false; // TODO: Perhaps split up members by client vs. host?
private bool m_hasReceivedTargetSequence = false;
private ulong m_localId;
private bool m_canAnimateTargets = false;

4
Assets/Scripts/Relay/RelayUtpSetup.cs


var relayServerData = new RelayServerData(ref serverEndpoint, 0, ref allocationId, ref connectionData, ref hostConnectionData, ref key, isSecure);
relayServerData.ComputeNewNonce(); // For security, the nonce value sent when authenticating the allocation must be increased.
var relayNetworkParameter = new RelayNetworkParameter { ServerData = relayServerData };
var networkSettings = new NetworkSettings();
m_networkDriver = NetworkDriver.Create(new INetworkParameter[] { relayNetworkParameter });
m_networkDriver = NetworkDriver.Create(networkSettings.WithRelayParameters(ref relayServerData));
m_connections = new List<NetworkConnection>(connectionCapacity);
if (m_networkDriver.Bind(NetworkEndPoint.AnyIpv4) != 0)

4
Assets/Scripts/Tests/PlayMode/UtpTests.cs


}
private LobbyRelaySample.Auth.SubIdentity_Authentication m_auth;
GameObject m_dummy;
#pragma warning disable CS0414 // This is the "assigned but its value is never used" warning, which will otherwise appear when DTLS is unavailable.
GameObject m_dummy;
#pragma warning restore CS0414
[OneTimeSetUp]
public void Setup()

正在加载...
取消
保存