mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-11-07 17:36:07 +00:00
Fix xxx.Parse
This commit is contained in:
parent
ccb4ce51cc
commit
53898f3446
21 changed files with 71 additions and 44 deletions
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Globalization;
|
||||
using MinecraftClient.Mapping;
|
||||
|
||||
namespace MinecraftClient.ChatBots
|
||||
|
|
@ -63,11 +64,11 @@ namespace MinecraftClient.ChatBots
|
|||
|
||||
if (parts.Length == 2)
|
||||
{
|
||||
if (int.TryParse(parts[0].Trim(), out int firstTime))
|
||||
if (int.TryParse(parts[0].Trim(), NumberStyles.Any, CultureInfo.CurrentCulture, out int firstTime))
|
||||
{
|
||||
timeping = firstTime;
|
||||
|
||||
if (int.TryParse(parts[1].Trim(), out int secondTime))
|
||||
if (int.TryParse(parts[1].Trim(), NumberStyles.Any, CultureInfo.CurrentCulture, out int secondTime))
|
||||
timepingMax = secondTime;
|
||||
else LogToConsole(Translations.TryGet("bot.antiafk.invalid_range_partial", timeping));
|
||||
}
|
||||
|
|
@ -77,7 +78,7 @@ namespace MinecraftClient.ChatBots
|
|||
}
|
||||
else
|
||||
{
|
||||
if (int.TryParse(pingparam.Trim(), out int value))
|
||||
if (int.TryParse(pingparam.Trim(), NumberStyles.Any, CultureInfo.CurrentCulture, out int value))
|
||||
timeping = value;
|
||||
else LogToConsole(Translations.TryGet("bot.antiafk.invalid_value"));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using MinecraftClient.Mapping;
|
||||
using MinecraftClient.Protocol.Handlers;
|
||||
|
|
@ -70,7 +71,7 @@ namespace MinecraftClient.ChatBots
|
|||
if (args.Length < 2)
|
||||
return "maps <list/render <id>> | maps <l/r <id>>";
|
||||
|
||||
if (int.TryParse(args[1], out int mapId))
|
||||
if (int.TryParse(args[1], NumberStyles.Any, CultureInfo.CurrentCulture, out int mapId))
|
||||
{
|
||||
if (!cachedMaps.ContainsKey(mapId))
|
||||
return Translations.TryGet("bot.map.cmd.not_found", mapId);
|
||||
|
|
|
|||
|
|
@ -84,8 +84,8 @@ namespace MinecraftClient.ChatBots
|
|||
string[] parts = argValue.Split("-");
|
||||
if (parts.Length == 2)
|
||||
{
|
||||
interval = int.Parse(parts[0].Trim());
|
||||
intervalMax = int.Parse(parts[1].Trim());
|
||||
interval = int.Parse(parts[0].Trim(), NumberStyles.Any, CultureInfo.CurrentCulture);
|
||||
intervalMax = int.Parse(parts[1].Trim(), NumberStyles.Any, CultureInfo.CurrentCulture);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -94,7 +94,7 @@ namespace MinecraftClient.ChatBots
|
|||
}
|
||||
else
|
||||
{
|
||||
interval = int.Parse(argValue);
|
||||
interval = int.Parse(argValue, NumberStyles.Any, CultureInfo.CurrentCulture);
|
||||
}
|
||||
|
||||
current_task.triggerOnInterval_Interval = interval;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue