diff --git a/MinecraftClient/Program.cs b/MinecraftClient/Program.cs index b5a4f7e7..85463067 100644 --- a/MinecraftClient/Program.cs +++ b/MinecraftClient/Program.cs @@ -245,9 +245,11 @@ namespace MinecraftClient } } - if (protocolversion == 0) + if (protocolversion == 0 || Settings.ServerMayHaveForge) { - Console.WriteLine("Retrieving Server Info..."); + if (protocolversion != 0) + Console.WriteLine("Checking if server is running Forge..."); + else Console.WriteLine("Retrieving Server Info..."); if (!ProtocolHandler.GetServerInfo(Settings.ServerIP, Settings.ServerPort, ref protocolversion, ref forgeInfo)) { HandleFailure("Failed to ping this IP.", true, ChatBots.AutoRelog.DisconnectReason.ConnectionLost); diff --git a/MinecraftClient/Protocol/ProtocolHandler.cs b/MinecraftClient/Protocol/ProtocolHandler.cs index 504e6d48..c0af5bdf 100644 --- a/MinecraftClient/Protocol/ProtocolHandler.cs +++ b/MinecraftClient/Protocol/ProtocolHandler.cs @@ -88,7 +88,12 @@ namespace MinecraftClient.Protocol } }, TimeSpan.FromSeconds(Settings.ResolveSrvRecordsShortTimeout ? 10 : 30))) { - protocolversion = protocolversionTmp; + if (protocolversion != 0 && protocolversion != protocolversionTmp) + ConsoleIO.WriteLineFormatted("§8Server reports a different version than manually set. Login may not work."); + if (protocolversion == 0 && protocolversionTmp == 0) + ConsoleIO.WriteLineFormatted("§8Server does not report its protocol version, autodetection will not work."); + if (protocolversion == 0) + protocolversion = protocolversionTmp; forgeInfo = forgeInfoTmp; return success; } diff --git a/MinecraftClient/Settings.cs b/MinecraftClient/Settings.cs index 53f8bdc1..27f64aba 100644 --- a/MinecraftClient/Settings.cs +++ b/MinecraftClient/Settings.cs @@ -28,6 +28,7 @@ namespace MinecraftClient public static string ServerIP = ""; public static ushort ServerPort = 25565; public static string ServerVersion = ""; + public static bool ServerMayHaveForge = true; public static string SingleCommand = ""; public static string ConsoleTitle = ""; @@ -237,6 +238,7 @@ namespace MinecraftClient case "playerheadicon": playerHeadAsIcon = str2bool(argValue); break; case "chatbotlogfile": chatbotLogFile = argValue; break; case "mcversion": ServerVersion = argValue; break; + case "mcforge": ServerMayHaveForge = argValue.ToLower() == "auto" || str2bool(argValue); break; case "splitmessagedelay": splitMessageDelay = TimeSpan.FromSeconds(str2int(argValue)); break; case "scriptcache": CacheScripts = str2bool(argValue); break; case "showsystemmessages": DisplaySystemMessages = str2bool(argValue); break; @@ -584,6 +586,7 @@ namespace MinecraftClient + "botowners=Player1,Player2,Player3 # Use name list or myfile.txt with one name per line\r\n" + "botmessagedelay=2 # Seconds to delay between message a bot makes to avoid accidental spam\r\n" + "mcversion=auto # Use 'auto' or '1.X.X' values\r\n" + + "mcforge=auto # Use 'auto' or 'false'\r\n" + "brandinfo=mcc # Use 'mcc','vanilla', or 'none'\r\n" + "chatbotlogfile= # Leave empty for no logfile\r\n" + "privatemsgscmdname=tell # Used by RemoteControl bot\r\n"