private void ProcessEvent_ConsoleCommand(ConsoleCommandInfo obj)
        {
            DebugOutput("Player {0}; Console command: {1} Allowed: {2}", obj.playerEntityId, obj.command, obj.allowed);

            Player player;

            lock (_onlinePlayersInfoById)
            {
                player = _onlinePlayersInfoById[obj.playerEntityId];
            }

            Event_ConsoleCommand?.Invoke(player, obj.command, obj.allowed);
        }
示例#2
0
 public static HelpCommand ForCommand(ConsoleCommandInfo command, IConsoleCommand instance)
 {
     if (command == null)
     {
         throw new ArgumentNullException("command");
     }
     if (instance == null)
     {
         throw new ArgumentNullException("instance");
     }
     return(new HelpCommand {
         _command = command, _instance = instance
     });
 }
示例#3
0
        private static string[] CommandToTableRow(ConsoleCommandInfo c)
        {
            var helpPrefix = c.Attribute.PrototypeArray.Length > 1
                                 ? FormatShortNames(c.Attribute.PrototypeArray)
                                 : null;

            var addHelpLines = Config.Help.GetAddlHelpDelegate == null
                                   ? null
                                   : Environment.NewLine +
                               string.Join(Environment.NewLine,
                                           Config.Help.GetAddlHelpDelegate(c.Attribute.FirstPrototype, c.CommandType));

            return(new[]
            {
                c.Attribute.FirstPrototype,
                helpPrefix + c.Attribute.Descripion + addHelpLines
            });
        }
 private void Broker_Event_ConsoleCommand(ConsoleCommandInfo obj)
 {
     Logger.log($@"***console command executed {obj.command}***");
 }
示例#5
0
 private static string GetCategory(ConsoleCommandInfo c)
 {
     return(Config.Help.GetCategoryDelegate == null
         ? null
         : Config.Help.GetCategoryDelegate(c.Attribute.FirstPrototype, c.CommandType));
 }
示例#6
0
 private void ProcessEvent_ConsoleCommand(ConsoleCommandInfo obj)
 {
     DebugOutput("Player {0}; Console command: {1} Allowed: {2}", obj.playerEntityId, obj.command, obj.allowed);
 }