public ServerGroupAutoAddPermCommand(ServerGroupType serverGroupType, IEnumerable <Permission> permissions) : base("ServerGroupAutoAddPerm")
        {
            if (permissions == null)
            {
                throw new ArgumentNullException(nameof(permissions));
            }

            if (!permissions.Any())
            {
                throw new ArgumentException("permissions are empty.");
            }

            AddParameter("sgtype", (uint)serverGroupType);

            uint index = 0;

            foreach (Permission permission in permissions)
            {
                AddParameter("permid", permission.Id, index);
                AddParameter("permvalue", permission.Value, index);
                AddParameter("permnegated", permission.Negated, index);
                AddParameter("permskip", permission.Skip, index);
                index++;
            }
        }
예제 #2
0
        public ServerGroupAutoDelPermCommand(ServerGroupType serverGroupType, IEnumerable <string> permissionNameList) : base("ServerGroupAutoDelPerm")
        {
            if (permissionNameList == null)
            {
                throw new ArgumentNullException(nameof(permissionNameList));
            }

            if (!permissionNameList.Any())
            {
                throw new ArgumentException("permissions are empty.");
            }

            AddParameter("sgtype", (uint)serverGroupType);

            uint index = 0;

            foreach (string permissionName in permissionNameList)
            {
                AddParameter("permsid", permissionName, index);
                index++;
            }
        }