From fa64fa077fc5b2fc181115ae28240c3c059ecf6a Mon Sep 17 00:00:00 2001 From: vis2k Date: Fri, 5 Apr 2019 21:43:17 +0200 Subject: [PATCH] NetworkServer: move UpdateServerObjects into Update --- Assets/Mirror/Runtime/NetworkServer.cs | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/Assets/Mirror/Runtime/NetworkServer.cs b/Assets/Mirror/Runtime/NetworkServer.cs index 3697269cf..f78e655f3 100644 --- a/Assets/Mirror/Runtime/NetworkServer.cs +++ b/Assets/Mirror/Runtime/NetworkServer.cs @@ -305,8 +305,13 @@ public static void DisconnectAllConnections() connections.Clear(); } - static void UpdateServerObjects() + // The user should never need to pump the update loop manually + internal static void Update() { + if (!active) + return; + + // update all server objects foreach (KeyValuePair kvp in NetworkIdentity.spawned) { if (kvp.Value != null && kvp.Value.gameObject != null) @@ -322,15 +327,6 @@ static void UpdateServerObjects() } } - // The user should never need to pump the update loop manually - internal static void Update() - { - if (active) - { - UpdateServerObjects(); - } - } - static void OnConnected(int connectionId) { if (LogFilter.Debug) Debug.Log("Server accepted client:" + connectionId);