Example #1
0
        bool ReloadAll(Player p, string[] parts)
        {
            Level lvl = null;

            if (parts.Length == 2)
            {
                lvl = Matcher.FindLevels(p, parts[1]);
                if (lvl == null)
                {
                    return(false);
                }
            }
            else if (!Player.IsSuper(p))
            {
                lvl = p.level;
            }
            else
            {
                SuperRequiresArgs(name + " all", p, "level name"); return(false);
            }

            if (!CheckExtraPerm(p, 1))
            {
                return(false);
            }
            Player[] players = PlayerInfo.Online.Items;
            foreach (Player who in players)
            {
                if (who.level == lvl)
                {
                    LevelActions.ReloadMap(p, who, true);
                }
            }
            return(true);
        }
Example #2
0
        public override void Use(Player p, string message)
        {
            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"))
            {
                if (!ReloadAll(p, parts))
                {
                    return;
                }
            }
            else
            {
                LevelActions.ReloadMap(p, p, true);
            }
            Server.DoGC();
        }
Example #3
0
        public override void Use(Player p, string message)
        {
            if (CheckSuper(p, message, "player or level name"))
            {
                return;
            }
            if (message == "")
            {
                message = p.name;
            }
            string[] parts = message.ToLower().Split(' ');

            if (parts[0] == "all")
            {
                if (!ReloadAll(p, parts))
                {
                    return;
                }
            }
            else
            {
                Player who = PlayerInfo.FindMatches(p, parts[0]);
                if (who == null)
                {
                    return;
                }
                if (p != null && who.Rank > p.Rank)
                {
                    MessageTooHighRank(p, "reload the map for", true); return;
                }
                LevelActions.ReloadMap(p, who, true);
            }
            GC.Collect();
            GC.WaitForPendingFinalizers();
        }
Example #4
0
        static void ReloadMap(Player p, bool global)
        {
            Player[] players = PlayerInfo.Online.Items;
            foreach (Player pl in players)
            {
                if (!pl.hasBlockDefs)
                {
                    continue;
                }
                if (!global && p.level != pl.level)
                {
                    continue;
                }
                if (pl.level == null || !pl.level.HasCustomBlocks)
                {
                    continue;
                }
                if (!pl.outdatedClient)
                {
                    continue;
                }

                LevelActions.ReloadMap(p, pl, true);
            }
        }
Example #5
0
 static void DoReload(Player p, Level lvl)
 {
     Player[] players = PlayerInfo.Online.Items;
     foreach (Player pl in players)
     {
         if (pl.level.name.CaselessEq(lvl.name))
         {
             LevelActions.ReloadMap(p, pl, true);
         }
     }
     Server.DoGC();
 }
Example #6
0
 static void DoReload(Player p, Level lvl)
 {
     Player[] players = PlayerInfo.Online.Items;
     foreach (Player pl in players)
     {
         if (pl.level.name.CaselessEq(lvl.name))
         {
             LevelActions.ReloadMap(p, pl, true);
         }
     }
     GC.Collect();
     GC.WaitForPendingFinalizers();
 }