Ejemplo n.º 1
0
        public static bool HandleServerCommand(string commandName)
        {
            string[] args = new string[GameInterface.Cmd_Argc()];

            for (int i = 0; i < args.Length; i++)
            {
                args[i] = GameInterface.Cmd_Argv(i);
            }

            bool eat = false;

            ScriptProcessor.RunAll(script =>
            {
                eat = script.OnServerCommand(commandName.ToLowerInvariant(), args);
            });

            return(eat);
        }
Ejemplo n.º 2
0
        public static string[] Tokenize(string line)
        {
            GameInterface.Cmd_TokenizeString(line);
            var argc = GameInterface.Cmd_Argc();

            if (argc == 0)
            {
                return(new string[0]);
            }
            var tokenized = new string[argc];

            for (int i = 0; i < argc; i++)
            {
                tokenized[i] = GameInterface.Cmd_Argv(i);
            }
            GameInterface.Cmd_EndTokenizedString();
            return(tokenized);
        }
Ejemplo n.º 3
0
        public static bool HandleServerCommand(string commandName)
        {
            var args = new string[GameInterface.Cmd_Argc()];

            for (var i = 0; i < args.Length; i++)
            {
                args[i] = GameInterface.Cmd_Argv(i);
            }

            var eat = false;

            ScriptProcessor.RunAll(script =>
            {
                var success = script.ProcessServerCommand(commandName.ToLowerInvariant(), args);
                if (success)
                {
                    eat = true;
                }
            });
            return(eat);
        }