This commit is contained in:
vis2k 2022-02-01 21:37:18 +08:00
parent 0680506ed1
commit 87dfaccfee

View File

@ -99,7 +99,11 @@ public static Action<NetworkConnection, Exception> OnErrorEvent
/// <summary>Shuts down the server and disconnects all clients</summary> /// <summary>Shuts down the server and disconnects all clients</summary>
// RuntimeInitializeOnLoadMethod -> fast playmode without domain reload // RuntimeInitializeOnLoadMethod -> fast playmode without domain reload
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)] [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
public static void Shutdown() => NetworkServerComponent.singleton.Shutdown(); public static void Shutdown()
{
if (NetworkServerComponent.singleton != null)
NetworkServerComponent.singleton.Shutdown();
}
// connections ///////////////////////////////////////////////////////// // connections /////////////////////////////////////////////////////////
/// <summary>Add a connection and setup callbacks. Returns true if not added yet.</summary> /// <summary>Add a connection and setup callbacks. Returns true if not added yet.</summary>