mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Add Internal command logging.
This commit is contained in:
parent
3e11d89ffd
commit
02ebf067b9
3 changed files with 20 additions and 2 deletions
|
|
@ -12,11 +12,12 @@ namespace MinecraftClient.ChatBots
|
|||
|
||||
public class ChatLog : ChatBot
|
||||
{
|
||||
public enum MessageFilter { AllText, AllMessages, OnlyChat, OnlyWhispers };
|
||||
public enum MessageFilter { AllText, AllMessages, OnlyChat, OnlyWhispers, OnlyInternal };
|
||||
private bool dateandtime;
|
||||
private bool saveOther = true;
|
||||
private bool saveChat = true;
|
||||
private bool savePrivate = true;
|
||||
private bool saveInternal = true;
|
||||
private string logfile;
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -52,6 +53,12 @@ namespace MinecraftClient.ChatBots
|
|||
savePrivate = true;
|
||||
saveChat = false;
|
||||
break;
|
||||
case MessageFilter.OnlyInternal:
|
||||
saveOther = false;
|
||||
savePrivate = false;
|
||||
saveChat = false;
|
||||
saveInternal = true;
|
||||
break;
|
||||
}
|
||||
if (String.IsNullOrEmpty(file) || file.IndexOfAny(Path.GetInvalidPathChars()) >= 0)
|
||||
{
|
||||
|
|
@ -68,6 +75,7 @@ namespace MinecraftClient.ChatBots
|
|||
case "messages": return MessageFilter.AllMessages;
|
||||
case "chat": return MessageFilter.OnlyChat;
|
||||
case "private": return MessageFilter.OnlyWhispers;
|
||||
case "internal": return MessageFilter.OnlyInternal;
|
||||
default: return MessageFilter.AllText;
|
||||
}
|
||||
}
|
||||
|
|
@ -92,6 +100,14 @@ namespace MinecraftClient.ChatBots
|
|||
}
|
||||
}
|
||||
|
||||
public override void OnInternalCommand(string commandName,string commandParams, string Result)
|
||||
{
|
||||
if (saveInternal)
|
||||
{
|
||||
save($"Internal {commandName}({commandParams}): {Result}");
|
||||
}
|
||||
}
|
||||
|
||||
private void save(string tosave)
|
||||
{
|
||||
if (dateandtime)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue