Call SetupLocalConnection after SetupServer to prepare for local connection removal, where a real connection can only connect to the server after it was started, not before.

This commit is contained in:
vis2k 2019-12-31 10:24:10 +01:00
parent 07a85309e0
commit 23b5b50155

View File

@ -400,6 +400,7 @@ public void StartClient(Uri uri)
public virtual void StartHost() public virtual void StartHost()
{ {
OnStartHost(); OnStartHost();
SetupServer();
// SetupLocalConnection needs to be called BEFORE SpawnObjects: // SetupLocalConnection needs to be called BEFORE SpawnObjects:
// https://github.com/vis2k/Mirror/pull/1249/ // https://github.com/vis2k/Mirror/pull/1249/
@ -427,8 +428,6 @@ public virtual void StartHost()
// isn't called in host mode! // isn't called in host mode!
NetworkClient.SetupLocalConnection(); NetworkClient.SetupLocalConnection();
SetupServer();
// scene change needed? then change scene and spawn afterwards. // scene change needed? then change scene and spawn afterwards.
if (IsServerOnlineSceneChangeNeeded()) if (IsServerOnlineSceneChangeNeeded())
{ {