Fix server version detection for Bungeecord 1.8

This commit is contained in:
ORelio 2014-11-11 12:44:37 +01:00
parent 2dec21ddc7
commit 4752094f1f

View file

@ -595,14 +595,20 @@ namespace MinecraftClient.Protocol.Handlers
{
protocolversion = atoi(tmp_ver[1]);
// Handle if "name" exists twice, like when connecting to a server with another user logged in.
//Handle if "name" exists twice, eg when connecting to a server with another user logged in.
version = (tmp_name.Length == 2) ? tmp_name[1].Split('"')[0] : tmp_name[2].Split('"')[0];
//Automatic fix for BungeeCord 1.8 not properly reporting protocol version
if (protocolversion == 0 && version.Split(' ').Contains("1.8"))
protocolversion = ProtocolHandler.MCVer2ProtocolVersion("1.8.0");
if (result.Contains("modinfo\":"))
{
//Server is running Forge (which is not supported)
version = "Forge " + version;
protocolversion = 0;
}
ConsoleIO.WriteLineFormatted("§8Server version : " + version + " (protocol v" + protocolversion + ").");
return true;
}