mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-17 18:40:33 +00:00
fix: Cleanup after PR #3935
This commit is contained in:
parent
af133e6110
commit
f61524863e
@ -779,7 +779,7 @@ public virtual void OnDestroy()
|
|||||||
// don't use this anymore.
|
// don't use this anymore.
|
||||||
// fixes: https://github.com/MirrorNetworking/Mirror/issues/2802
|
// fixes: https://github.com/MirrorNetworking/Mirror/issues/2802
|
||||||
// DEPRECATED 2024-10-29
|
// DEPRECATED 2024-10-29
|
||||||
[Obsolete("Override OnDestroy instead of OnApplicationQuit. Fixes: https://github.com/MirrorNetworking/Mirror/issues/2802")]
|
[Obsolete("Override OnDestroy instead of OnApplicationQuit.")]
|
||||||
public virtual void OnApplicationQuit() {}
|
public virtual void OnApplicationQuit() {}
|
||||||
|
|
||||||
/// <summary>The name of the current network scene.</summary>
|
/// <summary>The name of the current network scene.</summary>
|
||||||
|
@ -196,8 +196,13 @@ public virtual void ServerLateUpdate() {}
|
|||||||
/// <summary>Shut down the transport, both as client and server</summary>
|
/// <summary>Shut down the transport, both as client and server</summary>
|
||||||
public abstract void Shutdown();
|
public abstract void Shutdown();
|
||||||
|
|
||||||
/// <summary>Called by Unity when quitting. Inheriting Transports should call base for proper Shutdown.</summary>
|
// [Obsolete] in case someone is inheriting it.
|
||||||
// use OnDestroy instead of OnApplicationQuit:
|
// don't use this anymore.
|
||||||
|
// fixes: https://github.com/MirrorNetworking/Mirror/issues/2802
|
||||||
|
// DEPRECATED 2024-10-29
|
||||||
|
[Obsolete("Override OnDestroy instead of OnApplicationQuit.")]
|
||||||
|
public virtual void OnApplicationQuit() {}
|
||||||
|
|
||||||
// fixes: https://github.com/MirrorNetworking/Mirror/issues/2802
|
// fixes: https://github.com/MirrorNetworking/Mirror/issues/2802
|
||||||
public virtual void OnDestroy()
|
public virtual void OnDestroy()
|
||||||
{
|
{
|
||||||
|
@ -323,7 +323,7 @@ public void SetServerLobbyParams(LobbyCreateRequest request)
|
|||||||
_request = request;
|
_request = request;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnDestroy()
|
public override void OnDestroy()
|
||||||
{
|
{
|
||||||
// attempt to clean up lobbies, if active
|
// attempt to clean up lobbies, if active
|
||||||
if (NetworkServer.active)
|
if (NetworkServer.active)
|
||||||
@ -340,6 +340,8 @@ private void OnDestroy()
|
|||||||
// sorry. this can go once the lobby service can timeout lobbies itself
|
// sorry. this can go once the lobby service can timeout lobbies itself
|
||||||
Thread.Sleep(300);
|
Thread.Sleep(300);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
base.OnDestroy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -197,11 +197,10 @@ void EnsureThread()
|
|||||||
Debug.Log($"ThreadedTransport: started worker thread!");
|
Debug.Log($"ThreadedTransport: started worker thread!");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void OnDestroy()
|
public override void OnDestroy()
|
||||||
{
|
{
|
||||||
// stop thread fully
|
// stop thread fully
|
||||||
Shutdown();
|
base.OnDestroy();
|
||||||
|
|
||||||
// TODO recycle writers.
|
// TODO recycle writers.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,14 +68,6 @@ public class #SCRIPTNAME# : NetworkManager
|
|||||||
base.ConfigureHeadlessFrameRate();
|
base.ConfigureHeadlessFrameRate();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// called when quitting the application by closing the window / pressing stop in the editor
|
|
||||||
/// </summary>
|
|
||||||
public override void OnApplicationQuit()
|
|
||||||
{
|
|
||||||
base.OnApplicationQuit();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Scene Management
|
#region Scene Management
|
||||||
|
@ -15,8 +15,6 @@ public class #SCRIPTNAME# : NetworkManager
|
|||||||
public event Action OnStartAction;
|
public event Action OnStartAction;
|
||||||
public event Action OnDestroyAction;
|
public event Action OnDestroyAction;
|
||||||
|
|
||||||
public event Action OnApplicationQuitAction;
|
|
||||||
|
|
||||||
public event Action<string> ServerChangeSceneAction;
|
public event Action<string> ServerChangeSceneAction;
|
||||||
public event Action<string> OnServerChangeSceneAction;
|
public event Action<string> OnServerChangeSceneAction;
|
||||||
public event Action<string> OnServerSceneChangedAction;
|
public event Action<string> OnServerSceneChangedAction;
|
||||||
@ -117,15 +115,6 @@ public class #SCRIPTNAME# : NetworkManager
|
|||||||
base.ConfigureHeadlessFrameRate();
|
base.ConfigureHeadlessFrameRate();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// called when quitting the application by closing the window / pressing stop in the editor
|
|
||||||
/// </summary>
|
|
||||||
public override void OnApplicationQuit()
|
|
||||||
{
|
|
||||||
OnApplicationQuitAction?.Invoke();
|
|
||||||
base.OnApplicationQuit();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Scene Management
|
#region Scene Management
|
||||||
|
Loading…
Reference in New Issue
Block a user