mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
NetworkManager.ConnectLocalClient moved higher near StartClient because it's similar
This commit is contained in:
parent
a472edd14c
commit
668d6a063d
@ -393,6 +393,25 @@ public void StartClient(Uri uri)
|
||||
OnStartClient();
|
||||
}
|
||||
|
||||
void ConnectLocalClient()
|
||||
{
|
||||
if (LogFilter.Debug) Debug.Log("NetworkManager StartHost");
|
||||
|
||||
if (authenticator != null)
|
||||
{
|
||||
authenticator.OnStartClient();
|
||||
authenticator.OnClientAuthenticated.AddListener(OnClientAuthenticated);
|
||||
}
|
||||
|
||||
networkAddress = "localhost";
|
||||
NetworkServer.ActivateLocalClientScene();
|
||||
RegisterClientMessages();
|
||||
|
||||
// ConnectLocalServer needs to be called AFTER RegisterClientMessages
|
||||
// (https://github.com/vis2k/Mirror/pull/1249/)
|
||||
NetworkClient.ConnectLocalServer();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This starts a network "host" - a server and client in the same application.
|
||||
/// <para>The client returned from StartHost() is a special "local" client that communicates to the in-process server using a message queue instead of the real network. But in almost all other cases, it can be treated as a normal client.</para>
|
||||
@ -601,25 +620,6 @@ void RegisterServerMessages()
|
||||
NetworkServer.RegisterHandler<ErrorMessage>(OnServerErrorInternal, false);
|
||||
}
|
||||
|
||||
void ConnectLocalClient()
|
||||
{
|
||||
if (LogFilter.Debug) Debug.Log("NetworkManager StartHost");
|
||||
|
||||
if (authenticator != null)
|
||||
{
|
||||
authenticator.OnStartClient();
|
||||
authenticator.OnClientAuthenticated.AddListener(OnClientAuthenticated);
|
||||
}
|
||||
|
||||
networkAddress = "localhost";
|
||||
NetworkServer.ActivateLocalClientScene();
|
||||
RegisterClientMessages();
|
||||
|
||||
// ConnectLocalServer needs to be called AFTER RegisterClientMessages
|
||||
// (https://github.com/vis2k/Mirror/pull/1249/)
|
||||
NetworkClient.ConnectLocalServer();
|
||||
}
|
||||
|
||||
void RegisterClientMessages()
|
||||
{
|
||||
NetworkClient.RegisterHandler<ConnectMessage>(OnClientConnectInternal, false);
|
||||
|
Loading…
Reference in New Issue
Block a user