From 23b5b50155b0c6c88eb3796ce4917520cb3111d9 Mon Sep 17 00:00:00 2001 From: vis2k Date: Tue, 31 Dec 2019 10:24:10 +0100 Subject: [PATCH] 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. --- Assets/Mirror/Runtime/NetworkManager.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Assets/Mirror/Runtime/NetworkManager.cs b/Assets/Mirror/Runtime/NetworkManager.cs index 4461a5351..034349bbb 100644 --- a/Assets/Mirror/Runtime/NetworkManager.cs +++ b/Assets/Mirror/Runtime/NetworkManager.cs @@ -400,6 +400,7 @@ public void StartClient(Uri uri) public virtual void StartHost() { OnStartHost(); + SetupServer(); // SetupLocalConnection needs to be called BEFORE SpawnObjects: // https://github.com/vis2k/Mirror/pull/1249/ @@ -427,8 +428,6 @@ public virtual void StartHost() // isn't called in host mode! NetworkClient.SetupLocalConnection(); - SetupServer(); - // scene change needed? then change scene and spawn afterwards. if (IsServerOnlineSceneChangeNeeded()) {