mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Chatlog, Message sending fixes
- Fix ChatLog not creating the folder containing log file - Fix chat prompt not sending regular text messages
This commit is contained in:
parent
87d4687394
commit
c4c5e2efd9
2 changed files with 6 additions and 3 deletions
|
|
@ -2,6 +2,7 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
namespace MinecraftClient.ChatBots
|
namespace MinecraftClient.ChatBots
|
||||||
{
|
{
|
||||||
|
|
@ -104,9 +105,10 @@ namespace MinecraftClient.ChatBots
|
||||||
tosave = "" + D + '-' + M + '-' + Y + ' ' + h + ':' + m + ':' + s + ' ' + tosave;
|
tosave = "" + D + '-' + M + '-' + Y + ' ' + h + ':' + m + ':' + s + ' ' + tosave;
|
||||||
}
|
}
|
||||||
|
|
||||||
System.IO.FileStream stream = new System.IO.FileStream(logfile, System.IO.FileMode.OpenOrCreate);
|
Directory.CreateDirectory(Path.GetDirectoryName(logfile));
|
||||||
System.IO.StreamWriter writer = new System.IO.StreamWriter(stream);
|
FileStream stream = new FileStream(logfile, FileMode.OpenOrCreate);
|
||||||
stream.Seek(0, System.IO.SeekOrigin.End);
|
StreamWriter writer = new StreamWriter(stream);
|
||||||
|
stream.Seek(0, SeekOrigin.End);
|
||||||
writer.WriteLine(tosave);
|
writer.WriteLine(tosave);
|
||||||
writer.Dispose();
|
writer.Dispose();
|
||||||
stream.Close();
|
stream.Close();
|
||||||
|
|
|
||||||
|
|
@ -186,6 +186,7 @@ namespace MinecraftClient
|
||||||
ConsoleIO.WriteLineFormatted("§8" + response_msg);
|
ConsoleIO.WriteLineFormatted("§8" + response_msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else SendChatMessage(text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue