예제 #1
0
파일: Vars.cs 프로젝트: fuzzbuck/Casanova
        public static void Reload()
        {
            Interface.LabelGroup.Clear();
            Interface.CardsGroup.Clear();
            Interface.ButtonGroup.Clear();

            if (Client.IsConnected)
            {
                Client.Disconnect();
            }

            if (Server.IsHosting)
            {
                Server.Stop();
            }

            PlayerController.LocalPlayer = null;
            PlayerController.LocalUnit   = null;

            Client.IsConnected        = false;
            NetworkManager.HostPlayer = new Player(0, "server", true);

            NetworkManager.PlayersGroup.Clear();
            NetworkManager.UnitsGroup.Clear();

            World.rules = null;

            CurrentState = State.Menu;
            Interface.tree.ChangeScene(path_frags + "/Menu.tscn");
        }
예제 #2
0
        public static void DisconnectToMenu()
        {
            Client.Disconnect();
            ThreadManager.ExecuteOnMainThread(() =>
            {
                if (Server.IsHosting)
                {
                    Server.Stop();
                }
            });

            Reload();
        }