/// <summary> /// When the server is shut down /// </summary> /// <param name="connection"></param> public override void OnClientDisconnect(NetworkConnection connection) { ApplicationData.ServerClosed = true; NetworkGameManager NetManager = NetworkGameManager.GetInstance(); MatchInfo matchInfo = NetManager.matchInfo; NetManager.matchMaker.DropConnection(matchInfo.networkId, matchInfo.nodeId, 0, NetManager.OnDropConnection); NetManager.StopHost(); NetworkGameManager.Shutdown(); SceneManager.LoadScene(0); base.OnClientDisconnect(connection); }
/// <summary> /// Quits the application. /// </summary> public void Quit() { ApplicationData.ServerClosed = false; NetworkGameManager NetManager = NetworkGameManager.GetInstance(); MatchInfo matchInfo = NetManager.matchInfo; NetManager.matchMaker.DropConnection(matchInfo.networkId, matchInfo.nodeId, 0, NetManager.OnDropConnection); NetManager.StopHost(); NetworkGameManager.Shutdown(); SceneManager.LoadScene(0); //SceneManager.LoadScene(0); }