mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
syntax: CheckForInactiveConnections moved above NetworkServer.Update
This commit is contained in:
parent
6cedb5b404
commit
6b83411593
@ -472,6 +472,21 @@ struct Serialization
|
||||
static Dictionary<NetworkIdentity, Serialization> serializations =
|
||||
new Dictionary<NetworkIdentity, Serialization>();
|
||||
|
||||
static void CheckForInactiveConnections()
|
||||
{
|
||||
if (!disconnectInactiveConnections)
|
||||
return;
|
||||
|
||||
foreach (NetworkConnectionToClient conn in connections.Values)
|
||||
{
|
||||
if (!conn.IsAlive(disconnectInactiveTimeout))
|
||||
{
|
||||
Debug.LogWarning($"Disconnecting {conn} for inactivity!");
|
||||
conn.Disconnect();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// NetworkLateUpdate called after any Update/FixedUpdate/LateUpdate
|
||||
// (we add this to the UnityEngine in NetworkLoop)
|
||||
internal static void NetworkLateUpdate()
|
||||
@ -628,21 +643,6 @@ internal static void NetworkLateUpdate()
|
||||
[Obsolete("NetworkServer.Update is now called internally from our custom update loop. No need to call Update manually anymore.")]
|
||||
public static void Update() => NetworkLateUpdate();
|
||||
|
||||
static void CheckForInactiveConnections()
|
||||
{
|
||||
if (!disconnectInactiveConnections)
|
||||
return;
|
||||
|
||||
foreach (NetworkConnectionToClient conn in connections.Values)
|
||||
{
|
||||
if (!conn.IsAlive(disconnectInactiveTimeout))
|
||||
{
|
||||
Debug.LogWarning($"Disconnecting {conn} for inactivity!");
|
||||
conn.Disconnect();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void AddTransportHandlers()
|
||||
{
|
||||
Transport.activeTransport.OnServerConnected = OnConnected;
|
||||
|
Loading…
Reference in New Issue
Block a user