From 595039865f3b7807b0f46498c4201527eae87d8f Mon Sep 17 00:00:00 2001 From: rodolphito Date: Wed, 27 Mar 2019 02:27:41 -0700 Subject: [PATCH] Removed duplicated address storage. (#664) * Removed duplicated address storage. * Removed the obsoletion as per vis' request. --- Assets/Mirror/Runtime/NetworkClient.cs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Assets/Mirror/Runtime/NetworkClient.cs b/Assets/Mirror/Runtime/NetworkClient.cs index b057baa52..2f25cfe43 100644 --- a/Assets/Mirror/Runtime/NetworkClient.cs +++ b/Assets/Mirror/Runtime/NetworkClient.cs @@ -27,7 +27,7 @@ public class NetworkClient internal static ConnectState connectState = ConnectState.None; - public static string serverIp { get; internal set; } = ""; + public static string serverIp => connection.address; // active is true while a client is connecting/connected // (= while the network is active) @@ -49,22 +49,20 @@ internal static void SetHandlers(NetworkConnection conn) } // connect remote - public static void Connect(string ip) + public static void Connect(string address) { - if (LogFilter.Debug) Debug.Log("Client Connect: " + ip); + if (LogFilter.Debug) Debug.Log("Client Connect: " + address); active = true; RegisterSystemHandlers(false); Transport.activeTransport.enabled = true; InitializeTransportHandlers(); - serverIp = ip; - connectState = ConnectState.Connecting; - Transport.activeTransport.ClientConnect(ip); + Transport.activeTransport.ClientConnect(address); // setup all the handlers - connection = new NetworkConnection(serverIp, 0); + connection = new NetworkConnection(address, 0); connection.SetHandlers(handlers); }