Add ChatBot logging to file and 'log' command

- log <text> will print '[BOT] text' to the console
- logged [BOT] lines can be written to a logfile
- chatbotlogfile INI setting is used to set the log file
This commit is contained in:
ORelio 2014-07-20 12:02:17 +02:00
parent 6f1fcb22ce
commit 162a1414bf
5 changed files with 63 additions and 15 deletions

View file

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace MinecraftClient.Commands
{
public class Log : Command
{
public override string CMDName { get { return "log"; } }
public override string CMDDesc { get { return "log <text>: log some text to the console."; } }
public override string Run(McTcpClient handler, string command)
{
if (hasArg(command))
{
ChatBot.LogToConsole(getArg(command));
return "";
}
else return CMDDesc;
}
}
}