Exemplo n.º 1
0
        public bool Run(Mobile from)
        {
            if (Scope == null)
            {
                from.SendMessage("You must select the batch command scope.");
                return(false);
            }

            if (Condition.Length > 0 && !Scope.SupportsConditionals)
            {
                from.SendMessage("This command scope does not support conditionals.");
                return(false);
            }

            if (Condition.Length > 0 && !Utility.InsensitiveStartsWith(Condition, "where"))
            {
                from.SendMessage("The condition field must start with \"where\".");
                return(false);
            }

            var args = CommandSystem.Split(Condition);

            Scope.Process(from, this, args);

            return(true);
        }
Exemplo n.º 2
0
        public void GetDetails(out string command, out string argString, out string[] args)
        {
            int indexOf = Command.IndexOf(' ');

            if (indexOf >= 0)
            {
                argString = Command.Substring(indexOf + 1);

                command = Command.Substring(0, indexOf);
                args    = CommandSystem.Split(argString);
            }
            else
            {
                argString = "";
                command   = Command.ToLower();
                args      = new string[0];
            }
        }