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);
|
||||
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
|
||||
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.
|
||||
Protocol18Forge.ServerInfoCheckForge(jsonData, ref forgeInfo);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue