mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-11-07 17:36:07 +00:00
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:
parent
6f1fcb22ce
commit
162a1414bf
5 changed files with 63 additions and 15 deletions
23
MinecraftClient/Commands/Log.cs
Normal file
23
MinecraftClient/Commands/Log.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue