mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-11-07 17:36:07 +00:00
Fix server version detection for Bungeecord 1.8
This commit is contained in:
parent
2dec21ddc7
commit
4752094f1f
1 changed files with 7 additions and 1 deletions
|
|
@ -595,14 +595,20 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
{
|
{
|
||||||
protocolversion = atoi(tmp_ver[1]);
|
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];
|
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\":"))
|
if (result.Contains("modinfo\":"))
|
||||||
{
|
{
|
||||||
//Server is running Forge (which is not supported)
|
//Server is running Forge (which is not supported)
|
||||||
version = "Forge " + version;
|
version = "Forge " + version;
|
||||||
protocolversion = 0;
|
protocolversion = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ConsoleIO.WriteLineFormatted("§8Server version : " + version + " (protocol v" + protocolversion + ").");
|
ConsoleIO.WriteLineFormatted("§8Server version : " + version + " (protocol v" + protocolversion + ").");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue