Esempio n. 1
0
        /// <summary>
        /// The request from vanilla code to start listening for commands
        /// </summary>
        public static void ListenForCommands()
        {
            var ctx = new HookContext()
            {
                Sender = HookContext.ConsoleSender
            };
            var args = new HookArgs.StartCommandProcessing();
            HookPoints.StartCommandProcessing.Invoke(ref ctx, ref args);

            if (ctx.Result == HookResult.DEFAULT)
            {
                //This might change to the vanilla code (allowing for pure vanilla functionalities). but we'll see.
                System.Threading.ThreadPool.QueueUserWorkItem(ListenForCommands);
            }
        }
        //        static readonly List<String> _officialCommands = new List<String>()
        //        {
        //            "help",
        //            "playing",
        //            "clear",
        //            "exit",
        //            "exit-nosave",
        //            "save",
        //            "kick",
        //            "ban",
        //            "password",
        //            "version",
        //            "time",
        //            "port",
        //            "maxplayers",
        //            "say",
        //            "motd",
        //            "dawn",
        //            "noon",
        //            "dusk",
        //            "midnight",
        //            "settle"
        //        };


        public static void ListenForCommands()
        {
            var ctx = new HookContext()
            {
                Sender = HookContext.ConsoleSender
            };
            var args = new HookArgs.StartCommandProcessing();

            HookPoints.StartCommandProcessing.Invoke(ref ctx, ref args);

            if (ctx.Result == HookResult.DEFAULT)
            {
                System.Threading.ThreadPool.QueueUserWorkItem(startDedInputCallBack);
            }
        }
Esempio n. 3
0
        void OnStartCommandProcessing(ref HookContext ctx, ref HookArgs.StartCommandProcessing args)
        {
            ctx.SetResult(HookResult.IGNORE);

            (new TDSM.API.Misc.ProgramThread("Command", ListenForCommands)).Start();
        }
        //        static readonly List<String> _officialCommands = new List<String>()
        //        {
        //            "help",
        //            "playing",
        //            "clear",
        //            "exit",
        //            "exit-nosave",
        //            "save",
        //            "kick",
        //            "ban",
        //            "password",
        //            "version",
        //            "time",
        //            "port",
        //            "maxplayers",
        //            "say",
        //            "motd",
        //            "dawn",
        //            "noon",
        //            "dusk",
        //            "midnight",
        //            "settle"
        //        };
        public static void ListenForCommands()
        {
            var ctx = new HookContext()
            {
                Sender = HookContext.ConsoleSender
            };
            var args = new HookArgs.StartCommandProcessing();
            HookPoints.StartCommandProcessing.Invoke(ref ctx, ref args);

            if (ctx.Result == HookResult.DEFAULT)
                System.Threading.ThreadPool.QueueUserWorkItem(startDedInputCallBack);
        }