mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
NetworkManager: SetupClient() for consistency with SetupServer()
This commit is contained in:
parent
d4b1239dc4
commit
4fbbc0cbc1
@ -304,6 +304,20 @@ public void StartServer()
|
||||
}
|
||||
}
|
||||
|
||||
void SetupClient()
|
||||
{
|
||||
InitializeSingleton();
|
||||
|
||||
if (runInBackground)
|
||||
Application.runInBackground = true;
|
||||
|
||||
if (authenticator != null)
|
||||
{
|
||||
authenticator.OnStartClient();
|
||||
authenticator.OnClientAuthenticated.AddListener(OnClientAuthenticated);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Starts the client, connects it to the server with networkAddress.</summary>
|
||||
public void StartClient()
|
||||
{
|
||||
@ -315,16 +329,7 @@ public void StartClient()
|
||||
|
||||
mode = NetworkManagerMode.ClientOnly;
|
||||
|
||||
InitializeSingleton();
|
||||
|
||||
if (runInBackground)
|
||||
Application.runInBackground = true;
|
||||
|
||||
if (authenticator != null)
|
||||
{
|
||||
authenticator.OnStartClient();
|
||||
authenticator.OnClientAuthenticated.AddListener(OnClientAuthenticated);
|
||||
}
|
||||
SetupClient();
|
||||
|
||||
// In case this is a headless client...
|
||||
ConfigureHeadlessFrameRate();
|
||||
@ -354,16 +359,7 @@ public void StartClient(Uri uri)
|
||||
|
||||
mode = NetworkManagerMode.ClientOnly;
|
||||
|
||||
InitializeSingleton();
|
||||
|
||||
if (runInBackground)
|
||||
Application.runInBackground = true;
|
||||
|
||||
if (authenticator != null)
|
||||
{
|
||||
authenticator.OnStartClient();
|
||||
authenticator.OnClientAuthenticated.AddListener(OnClientAuthenticated);
|
||||
}
|
||||
SetupClient();
|
||||
|
||||
RegisterClientMessages();
|
||||
|
||||
@ -486,11 +482,7 @@ void StartHostClient()
|
||||
{
|
||||
//Debug.Log("NetworkManager ConnectLocalClient");
|
||||
|
||||
if (authenticator != null)
|
||||
{
|
||||
authenticator.OnStartClient();
|
||||
authenticator.OnClientAuthenticated.AddListener(OnClientAuthenticated);
|
||||
}
|
||||
SetupClient();
|
||||
|
||||
networkAddress = "localhost";
|
||||
NetworkServer.ActivateHostScene();
|
||||
|
Loading…
Reference in New Issue
Block a user