mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
fix(NetworkManager): Move networkAddress check up in StartClient
- If we're going to abort for this, do it before setting anything up. - If/when the networkAddress is later set, we won't have issue with double initilization when StartClient is called again.
This commit is contained in:
parent
dfec9a713e
commit
11dc4a9f60
@ -404,6 +404,12 @@ public void StartClient()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (string.IsNullOrWhiteSpace(networkAddress))
|
||||||
|
{
|
||||||
|
Debug.LogError("Must set the Network Address field in the manager");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
mode = NetworkManagerMode.ClientOnly;
|
mode = NetworkManagerMode.ClientOnly;
|
||||||
|
|
||||||
SetupClient();
|
SetupClient();
|
||||||
@ -413,13 +419,6 @@ public void StartClient()
|
|||||||
|
|
||||||
RegisterClientMessages();
|
RegisterClientMessages();
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(networkAddress))
|
|
||||||
{
|
|
||||||
Debug.LogError("Must set the Network Address field in the manager");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// Debug.Log($"NetworkManager StartClient address:{networkAddress}");
|
|
||||||
|
|
||||||
NetworkClient.Connect(networkAddress);
|
NetworkClient.Connect(networkAddress);
|
||||||
|
|
||||||
OnStartClient();
|
OnStartClient();
|
||||||
|
Loading…
Reference in New Issue
Block a user