public override void Use(Player p, string message, CommandData data) { IGame game = IGame.GameOn(p.level); if (game != null) { p.Message("You can only reload levels outside of a game."); return; } if (!Hacks.CanUseNoclip(p)) { p.Message("You cannot use &T/Reload &Son this map."); return; } if (CheckSuper(p, message, "player or level name")) { return; } if (message.Length == 0) { message = p.name; } string[] parts = message.SplitSpaces(); if (!parts[0].CaselessEq("all")) { PlayerActions.ReloadMap(p); p.Message("&bMap reloaded"); } else { Level lvl = p.level; if (parts.Length == 2) { lvl = Matcher.FindLevels(p, parts[1]); if (lvl == null) { return; } } else if (p.IsSuper) { SuperRequiresArgs(name + " all", p, "level name"); return; } if (!CheckExtraPerm(p, data, 1)) { return; } LevelActions.ReloadAll(lvl, p, true); } Server.DoGC(); }
public static bool DetectNoclip(Player p, Position newPos) { if (p.Game.Referee || Hacks.CanUseNoclip(p)) { return(false); } if (!p.IsLikelyInsideBlock() || p.Game.NoclipLog.AddSpamEntry(5, interval)) { return(false); } Warn(ref p.Game.LastNoclipWarn, p, "noclip"); return(false); }
public bool Detect(Position newPos) { Player p = player; if (p.Game.Referee || Hacks.CanUseNoclip(p)) { return(false); } if (!p.IsLikelyInsideBlock() || log.AddSpamEntry(5, interval)) { return(false); } Warn("noclip"); return(false); }
public override void Use(Player p, string message, CommandData data) { if (CheckSuper(p, message, "level name")) { return; } IGame game = IGame.GameOn(p.level); if (message.Length == 0) { if (game != null) { p.Message("You cannot use &T/Reload &Swhile a game is running"); } else if (!Hacks.CanUseNoclip(p)) { p.Message("You cannot use &T/Reload &Son this level"); } else { PlayerActions.ReloadMap(p); p.Message("&bMap reloaded"); } return; } if (!CheckExtraPerm(p, data, 1)) { return; } Level lvl = p.level; if (!message.CaselessEq("all")) { lvl = Matcher.FindLevels(p, message); if (lvl == null) { return; } } LevelActions.ReloadAll(lvl, p, true); }