public virtual void onPlayerCommandProcess(ConsoleCommandEvent Event)
 {
 }
 public ConsoleSender(Server server)
 {
     cCommand = new ConsoleCommandEvent();
     //setServer(server);
 }
 /// <summary>
 /// Hook method for console command; currently non-functional
 /// </summary>
 /// <param name="Event">ConsoleCommandEvent info</param>
 public virtual void onConsoleCommand(ConsoleCommandEvent Event)
 {
 }
        /// <summary>
        /// Parses new console command
        /// </summary>
        /// <param name="line">Command to parse</param>
        /// <param name="server">Current Server instance</param>
        /// <param name="sender">Sender of the Command</param>
        public void ParseConsoleCommand(string line, Server server, ConsoleSender sender = null)
        {
            line = line.Trim();

            if (sender == null)
            {
                sender = consoleSender;
            }

            var ev = new ConsoleCommandEvent ();
            ev.Sender = sender;
            ev.Message = line;
            server.PluginManager.processHook (Hooks.CONSOLE_COMMAND, ev);
            if (ev.Cancelled)
            {
                return;
            }

            ParseAndProcess (sender, line);
        }
 /// <summary>
 /// ConsoleSender constructor
 /// </summary>
 /// <param name="server">Current Server instance</param>
 public ConsoleSender(Server server)
 {
     ConsoleCommand = new ConsoleCommandEvent();
 }
Example #6
0
        public override void onPlayerCommandProcess(ConsoleCommandEvent Event)
        {
            if (isEnabled == false) { return; }

            string[] commands = Event.getMessage().ToLower().Split(' ');
            if (commands.Length > 0)
            {
                if (commands[0] != null && commands[0].Trim().Length > 0)
                {
                    if (commands[0].Equals("exportitems"))
                    {
                        ExportItems(Event.getSender(), commands);

                        Event.setCancelled(true);
                    }
                }

                if (commands[0] != null && commands[0].Trim().Length > 0)
                {
                    if (commands[0].Equals("save-settings"))
                    {
                        oPrivateMsgManager.Unload();

                        Event.setCancelled(true);
                    }
                }
            }
        }