mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-11-07 17:36:07 +00:00
Handle the case where "name" exists twice in the result string, like when connecting to a server with another user logged in.
This commit is contained in:
parent
1c28270377
commit
fef50a3d48
1 changed files with 3 additions and 1 deletions
|
|
@ -544,7 +544,9 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
if (tmp_ver.Length >= 2 && tmp_name.Length >= 2)
|
if (tmp_ver.Length >= 2 && tmp_name.Length >= 2)
|
||||||
{
|
{
|
||||||
protocolversion = atoi(tmp_ver[1]);
|
protocolversion = atoi(tmp_ver[1]);
|
||||||
version = tmp_name[1].Split('"')[0];
|
|
||||||
|
// Handle if "name" exists twice, like 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];
|
||||||
if (result.Contains("modinfo\":"))
|
if (result.Contains("modinfo\":"))
|
||||||
{
|
{
|
||||||
//Server is running Forge (which is not supported)
|
//Server is running Forge (which is not supported)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue