mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
Removed duplicated address storage. (#664)
* Removed duplicated address storage. * Removed the obsoletion as per vis' request.
This commit is contained in:
parent
c289ffb440
commit
595039865f
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user