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();
|
||||
}
|
||||
|
||||
// TODO why are there two connect host methods?
|
||||
// called from NetworkManager.FinishStartHost()
|
||||
public static void ConnectHost()
|
||||
// keep the local connections setup in one function.
|
||||
// makes host setup easier to follow.
|
||||
internal static void SetupHostConnections()
|
||||
{
|
||||
Initialize(true);
|
||||
|
||||
connectState = ConnectState.Connected;
|
||||
|
||||
// create local connections pair, both are connected
|
||||
Utils.CreateLocalConnections(
|
||||
out LocalConnectionToClient connectionToClient,
|
||||
@ -231,6 +227,15 @@ public static void ConnectHost()
|
||||
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>
|
||||
// called from NetworkManager.FinishStartHostClient
|
||||
// TODO why are there two connect host methods?
|
||||
|
Loading…
Reference in New Issue
Block a user