mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Handle negative value in server ping (#1626)
This commit is contained in:
parent
8bd221c248
commit
39b7d878dd
4 changed files with 3 additions and 13 deletions
|
|
@ -1059,15 +1059,5 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
result.AddRange(array);
|
result.AddRange(array);
|
||||||
return result.ToArray();
|
return result.ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// C-like atoi function for parsing an int from string
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="str">String to parse</param>
|
|
||||||
/// <returns>Int parsed</returns>
|
|
||||||
public int Atoi(string str)
|
|
||||||
{
|
|
||||||
return int.Parse(new string(str.Trim().TakeWhile(char.IsDigit).ToArray()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1442,7 +1442,7 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
|
|
||||||
//Retrieve protocol version number for handling this server
|
//Retrieve protocol version number for handling this server
|
||||||
if (versionData.Properties.ContainsKey("protocol"))
|
if (versionData.Properties.ContainsKey("protocol"))
|
||||||
protocolversion = dataTypes.Atoi(versionData.Properties["protocol"].StringValue);
|
protocolversion = int.Parse(versionData.Properties["protocol"].StringValue);
|
||||||
|
|
||||||
// Check for forge on the server.
|
// Check for forge on the server.
|
||||||
Protocol18Forge.ServerInfoCheckForge(jsonData, ref forgeInfo);
|
Protocol18Forge.ServerInfoCheckForge(jsonData, ref forgeInfo);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
╔═════════════════════════════════════╗
|
╔═════════════════════════════════════╗
|
||||||
║ Chest ║
|
║ Container ║
|
||||||
║╔═══╦═══╦═══╦═══╦═══╦═══╦═══╦═══╦═══╗║
|
║╔═══╦═══╦═══╦═══╦═══╦═══╦═══╦═══╦═══╗║
|
||||||
║║ 0 ║ 1 ║ 2 ║ 3 ║ 4 ║ 5 ║ 6 ║ 7 ║ 8 ║║
|
║║ 0 ║ 1 ║ 2 ║ 3 ║ 4 ║ 5 ║ 6 ║ 7 ║ 8 ║║
|
||||||
║╠═══╬═══╬═══╬═══╬═══╬═══╬═══╬═══╬═══╣║
|
║╠═══╬═══╬═══╬═══╬═══╬═══╬═══╬═══╬═══╣║
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
╔═════════════════════════════════════╗
|
╔═════════════════════════════════════╗
|
||||||
║ Large Container ║
|
║ Container ║
|
||||||
║╔═══╦═══╦═══╦═══╦═══╦═══╦═══╦═══╦═══╗║
|
║╔═══╦═══╦═══╦═══╦═══╦═══╦═══╦═══╦═══╗║
|
||||||
║║ 0 ║ 1 ║ 2 ║ 3 ║ 4 ║ 5 ║ 6 ║ 7 ║ 8 ║║
|
║║ 0 ║ 1 ║ 2 ║ 3 ║ 4 ║ 5 ║ 6 ║ 7 ║ 8 ║║
|
||||||
║╠═══╬═══╬═══╬═══╬═══╬═══╬═══╬═══╬═══╣║
|
║╠═══╬═══╬═══╬═══╬═══╬═══╬═══╬═══╬═══╣║
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue