void tas_Said(object sender, TasSayEventArgs e) { // check if it's command if (e.Origin == TasSayEventArgs.Origins.Player && !e.IsEmote && e.Text.StartsWith("!")) { string[] allwords = e.Text.Substring(1).Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); string com = allwords[0]; // remove first word (command) string[] words = Utils.ShiftArray(allwords, -1); if (!HasRights(com, e)) { return; } switch (com) { case "listmaps": ComListMaps(e, words); break; case "listmods": ComListMods(e, words); break; case "help": ComHelp(e, words); break; case "map": ComMap(e, words); break; case "admins": ComAdmins(e, words); break; case "start": ComStart(e, words); break; case "forcestart": ComForceStart(e, words); break; case "force": ComForce(e, words); break; case "split": ComSplit(e, words); break; case "corners": ComCorners(e, words); break; case "maplink": mapLinker.SayResults(Utils.Glue(words), tas, e); break; case "ring": ComRing(e, words); break; case "kick": ComKick(e, words); break; case "exit": ComExit(e, words); break; case "lock": tas.ChangeLock(true); break; case "unlock": tas.ChangeLock(false); break; case "vote": RegisterVote(e, words); break; case "votemap": StartVote(new VoteMap(tas, spring, this), e, words); break; case "votekick": StartVote(new VoteKick(tas, spring, this), e, words); break; case "voteforcestart": StartVote(new VoteForceStart(tas, spring, this), e, words); break; case "voteforce": StartVote(new VoteForce(tas, spring, this), e, words); break; case "voteexit": StartVote(new VoteExit(tas, spring, this), e, words); break; case "fix": ComFix(e, words); break; case "rehost": ComRehost(e, words); break; case "voterehost": StartVote(new VoteRehost(tas, spring, this), e, words); break; case "random": ComRandom(e, words); break; case "balance": ComBalance(e, words); break; case "setlevel": ComSetLevel(e, words); break; case "say": ComSay(e, words); break; case "dlmap": ComDlMap(e, words); break; case "reload": Respond(e, "reloading mod and map list"); spring.Reload(true, true); Respond(e, "reload finished"); break; case "team": ComTeam(e, words); break; case "ally": ComAlly(e, words); break; case "helpall": ComHelpAll(e, words); break; } } }
void tas_Said(object sender, TasSayEventArgs e) { // check if it's command if (e.Origin == TasSayEventArgs.Origins.Player && !e.IsEmote && e.Text.StartsWith("!")) { if (e.Text.Length < 2) { return; } string[] allwords = e.Text.Substring(1).Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); if (allwords.Length < 1) { return; } string com = allwords[0]; // remove first word (command) string[] words = Utils.ShiftArray(allwords, -1); if (!HasRights(com, e)) { return; } switch (com) { case "listmaps": ComListMaps(e, words); break; case "listmods": ComListMods(e, words); break; case "help": ComHelp(e, words); break; case "map": ComMap(e, words); break; case "admins": ComAdmins(e, words); break; case "start": ComStart(e, words); break; case "forcestart": ComForceStart(e, words); break; case "force": ComForce(e, words); break; case "split": ComSplit(e, words); break; case "corners": ComCorners(e, words); break; case "maplink": mapLinker.SayResults(Utils.Glue(words), tas, e); break; case "ring": ComRing(e, words); break; case "kick": ComKick(e, words); break; case "exit": ComExit(e, words); break; case "lock": tas.ChangeLock(true); break; case "unlock": tas.ChangeLock(false); break; case "vote": RegisterVote(e, words); break; case "votemap": StartVote(new VoteMap(tas, spring, this), e, words); break; case "votekick": StartVote(new VoteKick(tas, spring, this), e, words); break; case "voteforcestart": StartVote(new VoteForceStart(tas, spring, this), e, words); break; case "voteforce": StartVote(new VoteForce(tas, spring, this), e, words); break; case "voteexit": StartVote(new VoteExit(tas, spring, this), e, words); break; case "votepreset": StartVote(new VotePreset(tas, spring, this), e, words); break; case "fix": ComFix(e, words); break; case "rehost": ComRehost(e, words); break; case "voterehost": StartVote(new VoteRehost(tas, spring, this), e, words); break; case "random": ComRandom(e, words); break; case "balance": ComBalance(e, words); break; case "setlevel": ComSetLevel(e, words); break; case "say": ComSay(e, words); break; case "dlmap": ComDlMap(e, words); break; case "reload": Respond(e, "reloading mod and map list"); spring.Reload(true, true); Respond(e, "reload finished"); break; case "team": ComTeam(e, words); break; case "ally": ComAlly(e, words); break; case "helpall": ComHelpAll(e, words); break; case "fixcolors": ComFixColors(e, words); break; case "springie": ComSpringie(e, words); break; case "endvote": StopVote(); tas.Say(TasClient.SayPlace.Battle, "", "poll cancelled", true); break; case "addbox": ComAddBox(e, words); break; case "clearbox": ComClearBox(e, words); break; case "listpresets": ComListPresets(e, words); break; case "presetdetails": ComPresetDetails(e, words); break; case "preset": ComPreset(e, words); break; case "cbalance": ComCBalance(e, words); break; case "listbans": banList.ComListBans(e, words); break; case "ban": banList.ComBan(e, words); break; case "unban": banList.ComUnban(e, words); break; case "smurfs": RemoteCommand(Stats.smurfScript, e, words); break; case "stats": RemoteCommand(Stats.statsScript, e, words); break; } } }