mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
NetworkClient.ConnectHost: local connection setup moved into a separate function
This commit is contained in:
parent
1b7906c1ed
commit
e0ffc66be8
@ -212,14 +212,10 @@ public static void Connect(Uri uri)
|
|||||||
connection = new NetworkConnectionToServer();
|
connection = new NetworkConnectionToServer();
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO why are there two connect host methods?
|
// keep the local connections setup in one function.
|
||||||
// called from NetworkManager.FinishStartHost()
|
// makes host setup easier to follow.
|
||||||
public static void ConnectHost()
|
internal static void SetupHostConnections()
|
||||||
{
|
{
|
||||||
Initialize(true);
|
|
||||||
|
|
||||||
connectState = ConnectState.Connected;
|
|
||||||
|
|
||||||
// create local connections pair, both are connected
|
// create local connections pair, both are connected
|
||||||
Utils.CreateLocalConnections(
|
Utils.CreateLocalConnections(
|
||||||
out LocalConnectionToClient connectionToClient,
|
out LocalConnectionToClient connectionToClient,
|
||||||
@ -231,6 +227,15 @@ public static void ConnectHost()
|
|||||||
NetworkServer.SetLocalConnection(connectionToClient);
|
NetworkServer.SetLocalConnection(connectionToClient);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO why are there two connect host methods?
|
||||||
|
// called from NetworkManager.FinishStartHost()
|
||||||
|
public static void ConnectHost()
|
||||||
|
{
|
||||||
|
Initialize(true);
|
||||||
|
connectState = ConnectState.Connected;
|
||||||
|
SetupHostConnections();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>Connect host mode</summary>
|
/// <summary>Connect host mode</summary>
|
||||||
// called from NetworkManager.FinishStartHostClient
|
// called from NetworkManager.FinishStartHostClient
|
||||||
// TODO why are there two connect host methods?
|
// TODO why are there two connect host methods?
|
||||||
|
Loading…
Reference in New Issue
Block a user