Exemplo n.º 1
0
        public CommandRuleSets DefineCommandSchemas()
        {
            CommandRuleSets ruleSets = new CommandRuleSets();
            CommandParameterGroupListWithRules cmds = new CommandParameterGroupListWithRules();

            CommandParameterGroupWithRules cmdCool = new CommandParameterGroupWithRules();

            cmdCool.Add(new CommandParameterWithRules("serverquery")
            {
                IsBaseCommand = true
            });
            cmdCool.Add(new CommandParameterWithRules("register")
            {
                NameValueSetting = NameValueSetting.NameOnly,
            });
            cmdCool.Add(new CommandParameterWithRules("username")
            {
                NameValueSetting = NameValueSetting.ValueOrValueAndName,
                Required         = true,
                Help             = "Your ServerQuery username",
                Nullable         = false,
            });
            cmdCool.Add(new CommandParameterWithRules("password")
            {
                NameValueSetting = NameValueSetting.ValueOrValueAndName,
                Required         = true,
                Help             = "Your ServerQuery password",
                Nullable         = false,
            });

            cmds.Add(cmdCool);
            ruleSets.Add(new CommandRuleSet(this.Name, cmds, ServerQueryUserRegistrationCommand));

            return(ruleSets);
        }
Exemplo n.º 2
0
        public CommandRuleSets DefineCommandSchemas()
        {
            CommandRuleSets ruleSets = new CommandRuleSets();
            CommandParameterGroupListWithRules cmds = new CommandParameterGroupListWithRules();

            // This is a command with params
            CommandParameterGroupWithRules cmdCool = new CommandParameterGroupWithRules();

            cmdCool.Add(new CommandParameterWithRules("coolcommand")
            {
                IsBaseCommand = true
            });
            cmdCool.Add(new CommandParameterWithRules("someparam")
            {
                NameValueSetting = NameValueSetting.ValueOrValueAndName,
                ValueType        = TS3_Objects.Entities.ValueType.Integer,
            });
            cmds.Add(cmdCool);

            // This is a command with params
            CommandParameterGroupWithRules cmdKickall = new CommandParameterGroupWithRules();

            cmdKickall.Add(new CommandParameterWithRules("kickall")
            {
                IsBaseCommand = true
            });
            cmds.Add(cmdKickall);

            ruleSets.Add(new CommandRuleSet(this.Name, cmds, Test));
            return(ruleSets);
        }
Exemplo n.º 3
0
        public CommandRuleSets DefineCommandSchemas()
        {
            CommandRuleSets ruleSets = new CommandRuleSets();
            CommandParameterGroupListWithRules cmdsToSortSubChannels = new CommandParameterGroupListWithRules();
            CommandParameterGroupListWithRules cmdsToStoreChannels   = new CommandParameterGroupListWithRules();
            CommandParameterGroupListWithRules cmdsToPopChannels     = new CommandParameterGroupListWithRules();

            // Sort channels based on parent channel
            CommandParameterGroupWithRules cmdSortSubChannels = new CommandParameterGroupWithRules();

            cmdSortSubChannels.Add(new CommandParameterWithRules("sort")
            {
                IsBaseCommand = true
            });
            //cmdCool.Add(new CommandParameterWithRules("someparam")
            //{
            //    NameValueSetting = NameValueSetting.ValueOrValueAndName,
            //    ValueType = TS3_Objects.Entities.ValueType.Integer,
            //});
            cmdsToSortSubChannels.Add(cmdSortSubChannels);

            // Store a channel
            CommandParameterGroupWithRules cmdStoreChannel = new CommandParameterGroupWithRules();

            cmdStoreChannel.Add(new CommandParameterWithRules("store")
            {
                IsBaseCommand = true
            });
            cmdsToStoreChannels.Add(cmdStoreChannel);

            // Pop a channel
            CommandParameterGroupWithRules cmdPopChannel = new CommandParameterGroupWithRules();

            cmdPopChannel.Add(new CommandParameterWithRules("pop")
            {
                IsBaseCommand = true
            });
            cmdsToPopChannels.Add(cmdPopChannel);

            ruleSets.Add(new CommandRuleSet(this.Name, cmdsToSortSubChannels, UserSortRequest));
            ruleSets.Add(new CommandRuleSet(this.Name, cmdsToStoreChannels, UserStoreChannelRequest));
            ruleSets.Add(new CommandRuleSet(this.Name, cmdsToPopChannels, UserPopChannelRequest));

            return(ruleSets);
        }