NetworkServer: move UpdateServerObjects into Update

This commit is contained in:
vis2k 2019-04-05 21:43:17 +02:00
parent 2048addde4
commit fa64fa077f

View File

@ -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<uint, NetworkIdentity> 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);