Beispiel #1
0
        public void CommandStop(MiNET.Player player, params string[] args)
        {
            if (!(player is SkyPlayer skyPlayer) || !skyPlayer.PlayerGroup.IsAtLeast(PlayerGroup.Admin))
            {
                player.SendMessage("§c§l(!)§r §cYou do not have permission for this command.");
                return;
            }

            if (args.Length > 0)
            {
                if (args[0].Equals("now"))
                {
                    player.SendMessage("§cRebooting Server...");
                    RestartHandler.TriggerReboot(true);
                    return;
                }
                if (args[0].Equals("queue"))
                {
                    player.SendMessage("§cQueueing reboot...");
                    player.SendMessage("§7* Server should reboot after all games have finished their games.");
                    RestartHandler.TriggerReboot(false);
                    return;
                }
            }

            player.SendMessage("§c/stop now (Immediately stops the server)");
            player.SendMessage("§c/stop queue (Queues a reboot once all games are free to reboot)");
        }