From f78e0ed750ed03914082873b02ad7a9843f11c3b Mon Sep 17 00:00:00 2001 From: cxxpxr <60411087+cxxpxr@users.noreply.github.com> Date: Sun, 4 Apr 2021 10:17:23 -0400 Subject: [PATCH] Update LightReflectiveMirrorTransport.cs --- UnityTransport/LightReflectiveMirrorTransport.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/UnityTransport/LightReflectiveMirrorTransport.cs b/UnityTransport/LightReflectiveMirrorTransport.cs index 09410fa..e7ea5d9 100644 --- a/UnityTransport/LightReflectiveMirrorTransport.cs +++ b/UnityTransport/LightReflectiveMirrorTransport.cs @@ -49,8 +49,6 @@ namespace LightReflectiveMirror private int _currentMemberId; private bool _callbacksInitialized = false; private int _cachedHostID; - private BiDictionary _connectedRelayClients = new BiDictionary(); - private BiDictionary _connectedDirectClients = new BiDictionary(); private UdpClient _NATPuncher; private IPEndPoint _NATIP; private IPEndPoint _relayPuncherIP; @@ -58,7 +56,9 @@ namespace LightReflectiveMirror private IPEndPoint _directConnectEndpoint; private SocketProxy _clientProxy; private BiDictionary _serverProxies = new BiDictionary(); - + private BiDictionary _connectedRelayClients = new BiDictionary(); + private BiDictionary _connectedDirectClients = new BiDictionary(); + public override bool ClientConnected() => _isClient; private void OnConnectedToRelay() => _connectedToRelay = true; public bool IsAuthenticated() => _isAuthenticated; @@ -66,7 +66,9 @@ namespace LightReflectiveMirror public override bool Available() => _connectedToRelay; public override void ClientConnect(Uri uri) => ClientConnect(uri.Host); public override int GetMaxPacketSize(int channelId = 0) => clientToServerTransport.GetMaxPacketSize(channelId); - public override string ServerGetClientAddress(int connectionId) { + + public override string ServerGetClientAddress(int connectionId) + { if (_connectedRelayClients.TryGetBySecond(connectionId, out int relayId)) return relayId.ToString();