Beispiel #1
0
 void UpdateExtraPerms(LevelPermission perm, int num)
 {
     CommandExtraPerms.Load();
     CommandExtraPerms.Set("lavasurvival", perm, "temp desc", num);
     CommandExtraPerms.Save();
     needsSaveSettings = true;
 }
Beispiel #2
0
        public static void Register(Command cmd)
        {
            allCmds.Add(cmd);

            CommandPerms perms = CommandPerms.Find(cmd.name);

            if (perms == null)
            {
                perms = new CommandPerms(cmd.name, cmd.defaultRank, null, null);
                CommandPerms.List.Add(perms);
            }
            foreach (Group grp in Group.GroupList)
            {
                if (perms.UsableBy(grp.Permission))
                {
                    grp.Commands.Add(cmd);
                }
            }

            CommandPerm[] extra = cmd.ExtraPerms;
            if (extra != null)
            {
                for (int i = 0; i < extra.Length; i++)
                {
                    CommandExtraPerms.Set(cmd.name, i + 1, extra[i].Description,
                                          extra[i].Perm, null, null);
                }
            }
            Alias.RegisterDefaults(cmd);
        }
Beispiel #3
0
        public void Add(Command cmd)
        {
            commands.Add(cmd);
            CommandPerm[] perms = cmd.ExtraPerms;
            if (!AddOtherPerms || perms == null)
            {
                return;
            }

            for (int i = 0; i < perms.Length; i++)
            {
                CommandExtraPerms.Set(cmd.name, perms[i].Perm, perms[i].Description, i + 1);
            }
        }
Beispiel #4
0
        public static void Register(Command cmd)
        {
            allCmds.Add(cmd);

            CommandPerms perms = CommandPerms.Find(cmd.name);

            if (perms == null)
            {
                perms = new CommandPerms(cmd.name, cmd.defaultRank, null, null);
                CommandPerms.List.Add(perms);
            }
            foreach (Group grp in Group.GroupList)
            {
                if (perms.UsableBy(grp.Permission))
                {
                    grp.Commands.Add(cmd);
                }
            }

            CommandPerm[] extra = cmd.ExtraPerms;
            if (extra != null)
            {
                for (int i = 0; i < extra.Length; i++)
                {
                    CommandExtraPerms.Set(cmd.name, i + 1, extra[i].Description,
                                          extra[i].Perm, null, null);
                }
            }

            CommandAlias[] aliases = cmd.Aliases;
            if (aliases == null)
            {
                return;
            }
            foreach (CommandAlias a in aliases)
            {
                Alias alias = new Alias(a.Trigger, cmd.name, a.Format);
                Alias.coreAliases.Add(alias);
            }
        }