Exemple #1
0
    private static void CommandSwitch(string[] args)
    {
        switch (args[0])
        {
        case "aso":
            switch (args[1])
            {
            case "damage":
                Commands.ASODamage();
                break;

            case "kdr":
                Commands.ASOKDR();
                break;

            case "racing":
                Commands.ASORacing();
                break;

            default:
                string[] err = { "Invalid command. Possibles:", "\n/aso kdr", " - preserves players KDR's from disconnects.", "\n/aso racing", " -  .", "\n/aso damage", " - sets ASO Damage settings." };
                SystemMessageLocal(err);
                break;
            }
            break;

        case "ban":
            Commands.Ban(args[1]);
            break;

        case "unban":
            Commands.Unban(args[1]);
            break;

        case "banlist":
            Commands.BanList();
            break;

        case "clear":
        case "clean":
            Commands.ClearChat();
            break;

        case "/clean":
        case "/clear":
            Commands.ClearChat(false);
            break;

        case "kick":
            Commands.Kick(args[1]);
            return;

        case "mute":
            Commands.Mute(PhotonPlayer.Find(Convert.ToInt32(args[1])));
            return;

        case "unmute":
            Commands.Unmute(PhotonPlayer.Find(Convert.ToInt32(args[1])));
            return;

        case "mutelist":
            Commands.MuteList();
            return;

        case "pause":
            FengGameManagerMKII.FGM.SetPause(true);
            break;

        case "unpause":
            FengGameManagerMKII.FGM.SetPause(false);
            break;

        case "pm":
            Commands.PM(args);
            break;

        case "reconnect":
            Commands.Reconnect();
            break;

        case "resetkd":
            Commands.ResetKD();
            break;

        case "resetkdall":
            Commands.ResetKD(global: true);
            break;

        case "restart":
            Commands.Restart();
            return;

        case "revive":
            Commands.Revive(args[1]);
            break;

        case "reviveall":
            Commands.Revive(all: true);
            break;

        case "room":
            switch (args[1])
            {
            case "open":
                Commands.RoomClose(false);
                break;

            case "close":
                Commands.RoomClose(true);
                break;

            case "hide":
                Commands.RoomHide(true);
                break;

            case "show":
                Commands.RoomHide(false);
                break;

            case "slots":
                Commands.SetSlots(int.Parse(args[2]));
                break;

            case "time":
                Commands.SetTime(int.Parse(args[2]));
                break;

            default:
                string[] err = { "Invalid command. Possibles:", "\n/room open", " - opens the room.", "\n/room close", " - closes the room.", "\n/room hide", " - hides the room from the server list.", "\n/room show", " - show the room on the server list.", "\n/room slots", " - sets room slots.", "\n/room time", " - sets room time." };
                SystemMessageLocal(err);
                break;
            }
            break;

        case "rules":
            Commands.Rules();
            break;

        case "spectate":
            Commands.Spectate(args[1]);
            break;

        case "specmode":
            Commands.SpectatorMode();
            break;

        case "team":
            Commands.SwitchTeam(args[1]);
            break;

        case "tp":
            Commands.Teleport(Convert.ToInt32(args[1]));
            break;

        default:
            SystemMessageLocal("Unknown command.");
            break;
        }
    }