Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions MinecraftClient/ChatBot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -273,18 +273,19 @@ protected static bool isTeleportRequest(string text, ref string sender)
public static void LogToConsole(string text)
{
ConsoleIO.WriteLineFormatted("§8[BOT] " + text);
string logfile = Settings.expandVars(Settings.chatbotLogFile);

if (!String.IsNullOrEmpty(Settings.chatbotLogFile))
if (!String.IsNullOrEmpty(logfile))
{
if (!File.Exists(Settings.chatbotLogFile))
if (!File.Exists(logfile))
{
try { Directory.CreateDirectory(Path.GetDirectoryName(Settings.chatbotLogFile)); }
try { Directory.CreateDirectory(Path.GetDirectoryName(logfile)); }
catch { return; /* Invalid path or access denied */ }
try { File.WriteAllText(Settings.chatbotLogFile, ""); }
try { File.WriteAllText(logfile, ""); }
catch { return; /* Invalid file name or access denied */ }
}

File.AppendAllLines(Settings.chatbotLogFile, new string[] { getTimestamp() + ' ' + text });
File.AppendAllLines(logfile, new string[] { getTimestamp() + ' ' + text });
}
}

Expand Down
8 changes: 6 additions & 2 deletions MinecraftClient/McTcpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ public void Disconnect()
public void OnTextReceived(string text)
{
ConsoleIO.WriteLineFormatted(text, false);
foreach (ChatBot bot in bots)
foreach (ChatBot bot in new List<ChatBot>(bots))
bot.GetText(text);
}

Expand Down Expand Up @@ -349,7 +349,11 @@ public void OnUpdate()
}
catch (Exception e)
{
ConsoleIO.WriteLineFormatted("§8Got error from " + bots[i].ToString() + ": " + e.ToString());
if (!(e is ThreadAbortException))
{
ConsoleIO.WriteLineFormatted("§8Got error from " + bots[i].ToString() + ": " + e.ToString());
}
else throw; //ThreadAbortException should not be caught
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion MinecraftClient/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ static class Program

static void Main(string[] args)
{
Console.WriteLine("Console Client for MC 1.4.6 to 1.8.0 - v" + Version + " - By ORelio & Contributors");
Console.WriteLine("Console Client for MC 1.4.6 to 1.8.1 - v" + Version + " - By ORelio & Contributors");

//Basic Input/Output ?
if (args.Length >= 1 && args[args.Length - 1] == "BasicIO")
Expand Down
8 changes: 8 additions & 0 deletions MinecraftClient/Protocol/ProtocolHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,14 @@ public static LoginResult GetLogin(ref string user, string pass, ref string acce
{
return LoginResult.SSLError;
}
catch (System.IO.IOException e)
{
if (e.Message.Contains("authentication"))
{
return LoginResult.SSLError;
}
else return LoginResult.OtherError;
}
catch
{
return LoginResult.OtherError;
Expand Down
1 change: 1 addition & 0 deletions MinecraftClient/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ public static bool setAccount(string accountAlias)

public static bool setServerIP(string server)
{
server = server.ToLower();
string[] sip = server.Split(':');
string host = sip[0];
short port = 25565;
Expand Down
2 changes: 1 addition & 1 deletion MinecraftClient/config/README.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
==================================================================
Minecraft Client v1.8.0 for Minecraft 1.4.6 to 1.8.0 - By ORelio
Minecraft Client v1.8.1 for Minecraft 1.4.6 to 1.8.0 - By ORelio
==================================================================

Thanks for dowloading Minecraft Console Client!
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ send commands and receive text messages in a fast and easy way without having to

##How to use

Downloads, help and more info at http://www.minecraftforum.net/topic/1314800-/
Downloads, help and more info available on the [Minecraft Forum thread](http://www.minecraftforum.net/topic/1314800-/)'s first post.<br/>
Alternatively, you can take a look at the [README](https://github.com/ORelio/Minecraft-Console-Client/blob/master/MinecraftClient/config/README.txt) file from the latest stable binary release.

##License

Expand Down