Beispiel #1
0
        static void AddBuildPlayer(Player p, string name)
        {
            string[] zoneArgs = name.Split(' ');
            name = zoneArgs[0];
            string reason = zoneArgs.Length > 1 ? zoneArgs[1] : "";

            name = CmdZone.FindZoneOwner(p, "os zone add", name, ref reason);
            if (name == null)
            {
                return;
            }

            CmdZone.ZoneAll(p.level, name);
            Player.Message(p, "Added zone for &b" + name);

            LevelAccessController access = p.level.BuildAccess;

            if (access.Blacklisted.CaselessRemove(name))
            {
                access.OnListChanged(p, name, true, true);
            }
            if (!access.Whitelisted.CaselessContains(name))
            {
                access.Whitelisted.Add(name);
                access.OnListChanged(p, name, true, false);
            }
        }
Beispiel #2
0
        static void AddBuildPlayer(Player p, string rawArgs)
        {
            string[] args   = rawArgs.SplitSpaces();
            string   reason = args.Length > 1 ? args[1] : "";
            string   name   = ModActionCmd.FindName(p, "zone", "os zone add", "", args[0], ref reason);

            if (name == null)
            {
                return;
            }

            Player.Message(p, "Added zone for &b" + name);
            LevelAccessController access = p.level.BuildAccess;

            if (access.Blacklisted.CaselessRemove(name))
            {
                access.OnListChanged(p, name, true, true);
            }
            if (!access.Whitelisted.CaselessContains(name))
            {
                access.Whitelisted.Add(name);
                access.OnListChanged(p, name, true, false);
            }
        }
Beispiel #3
0
 static void DeleteBuildPlayer(Player p, string name)
 {
     if (name.CaselessEq("all"))
     {
         CmdZone.DeleteAll(p);
     }
     else if (Formatter.ValidName(p, name, "player"))
     {
         CmdZone.DeleteWhere(p, zone => zone.Owner.CaselessEq(name));
         LevelAccessController access = p.level.BuildAccess;
         if (access.Whitelisted.CaselessRemove(name))
         {
             access.OnListChanged(p, name, false, true);
         }
     }
 }
Beispiel #4
0
        static void DeleteBuildPlayer(Player p, string name)
        {
            if (!Formatter.ValidName(p, name, "player"))
            {
                return;
            }

            LevelAccessController access = p.level.BuildAccess;

            if (access.Whitelisted.CaselessRemove(name))
            {
                access.OnListChanged(p, name, false, true);
            }
            else
            {
                Player.Message(p, name + " was not whitelisted.");
            }
        }