NetworkServer - moved RemoveTransportHandlers up

This commit is contained in:
MrGadget1024 2023-01-02 09:42:46 -05:00
parent ed8baffc6c
commit ce7706b5a0

View File

@ -208,6 +208,15 @@ public static void Shutdown()
if (aoi != null) aoi.Reset();
}
static void RemoveTransportHandlers()
{
// -= so that other systems can also hook into it (i.e. statistics)
Transport.active.OnServerConnected -= OnTransportConnected;
Transport.active.OnServerDataReceived -= OnTransportData;
Transport.active.OnServerDisconnected -= OnTransportDisconnected;
Transport.active.OnServerError -= OnTransportError;
}
// Note: NetworkClient.DestroyAllClientObjects does the same on client.
static void CleanupSpawned()
{
@ -239,15 +248,6 @@ static void CleanupSpawned()
spawned.Clear();
}
static void RemoveTransportHandlers()
{
// -= so that other systems can also hook into it (i.e. statistics)
Transport.active.OnServerConnected -= OnTransportConnected;
Transport.active.OnServerDataReceived -= OnTransportData;
Transport.active.OnServerDisconnected -= OnTransportDisconnected;
Transport.active.OnServerError -= OnTransportError;
}
// calls OnStartClient for all SERVER objects in host mode once.
// client doesn't get spawn messages for those, so need to call manually.
// Deprecated 2022-12-12