Example #1
0
        public void Execute(PlayerEntity entity, List <string> arguments, string commandname)
        {
            PlayerCommandEntry entry = new PlayerCommandEntry()
            {
                Player         = entity,
                InputArguments = arguments
            };

            entry.Command = GetCommand(commandname);
            if (entry.Command == null || !entry.Command.Silent)
            {
                StringBuilder args = new StringBuilder();
                for (int i = 0; i < arguments.Count; i++)
                {
                    args.Append(" \"").Append(arguments[i]).Append("\"");
                }
                SysConsole.Output(OutputType.INFO, "Client " + entity + " executing command '" + commandname + "' with arguments:" + args.ToString());
            }
            // TODO: Permission
            // TODO: Fire command event
            if (entry.Command == null)
            {
                entry.Player.SendMessage(TextChannel.COMMAND_RESPONSE, "Unknown command."); // TODO: Noise mode // TODO: Language
            }
            else
            {
                entry.Command.Execute(entry);
            }
        }
Example #2
0
 public void Execute(PlayerEntity entity, List<string> arguments, string commandname)
 {
     PlayerCommandEntry entry = new PlayerCommandEntry();
     entry.Player = entity;
     entry.InputArguments = arguments;
     entry.Command = GetCommand(commandname);
     if (entry.Command == null || !entry.Command.Silent)
     {
         StringBuilder args = new StringBuilder();
         for (int i = 0; i < arguments.Count; i++)
         {
             args.Append(" \"").Append(arguments[i]).Append("\"");
         }
         SysConsole.Output(OutputType.INFO, "Client " + entity + " executing command '" + commandname + "' with arguments:" + args.ToString());
     }
     // TODO: Permission
     // TODO: Fire command event
     if (entry.Command == null)
     {
         entry.Player.SendMessage(TextChannel.COMMAND_RESPONSE, "Unknown command."); // TODO: Noise mode // TODO: Language
     }
     else
     {
         entry.Command.Execute(entry);
     }
 }
 public abstract void Execute(PlayerCommandEntry entry);
 public void ShowUsage(PlayerCommandEntry entry)
 {
     ShowUsage("voxalia", entry);
 }
 public void ShowUsage(string textcat, PlayerCommandEntry entry)
 {
     entry.Player.SendLanguageData(TextChannel.COMMAND_RESPONSE, textcat, "commands.player." + Name + ".description");
     entry.Player.SendLanguageData(TextChannel.COMMAND_RESPONSE, textcat, "commands.player." + Name + ".usage");
 }