@@ -26,7 +26,6 @@ using Game.Maps;
|
||||
using Game.Network.Packets;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
|
||||
namespace Game.Chat
|
||||
@@ -893,7 +892,7 @@ namespace Game.Chat
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!float.TryParse(valueStr, NumberStyles.Float, CultureInfo.InvariantCulture, out float value))
|
||||
if (!float.TryParse(valueStr, out float value))
|
||||
return false;
|
||||
|
||||
target.SetFloatValue(field, value);
|
||||
|
||||
@@ -24,7 +24,6 @@ using Game.Entities;
|
||||
using Game.Maps;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
|
||||
namespace Game.Chat
|
||||
@@ -130,13 +129,13 @@ namespace Game.Chat
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!float.TryParse(toX, NumberStyles.Float, CultureInfo.InvariantCulture, out x))
|
||||
if (!float.TryParse(toX, out x))
|
||||
return false;
|
||||
|
||||
if (!float.TryParse(toY, NumberStyles.Float, CultureInfo.InvariantCulture, out y))
|
||||
if (!float.TryParse(toY, out y))
|
||||
return false;
|
||||
|
||||
if (!float.TryParse(toZ, NumberStyles.Float, CultureInfo.InvariantCulture, out z))
|
||||
if (!float.TryParse(toZ, out z))
|
||||
return false;
|
||||
|
||||
if (!GridDefines.IsValidMapCoord(obj.GetMapId(), x, y, z))
|
||||
@@ -338,19 +337,19 @@ namespace Game.Chat
|
||||
float oz = 0.0f, oy = 0.0f, ox = 0.0f;
|
||||
if (!orientation.IsEmpty())
|
||||
{
|
||||
if (!float.TryParse(orientation, NumberStyles.Float, CultureInfo.InvariantCulture, out oz))
|
||||
if (!float.TryParse(orientation, out oz))
|
||||
return false;
|
||||
|
||||
orientation = args.NextString();
|
||||
if (!orientation.IsEmpty())
|
||||
{
|
||||
if (!float.TryParse(orientation, NumberStyles.Float, CultureInfo.InvariantCulture, out oy))
|
||||
if (!float.TryParse(orientation, out oy))
|
||||
return false;
|
||||
|
||||
orientation = args.NextString();
|
||||
if (!orientation.IsEmpty())
|
||||
{
|
||||
if (!float.TryParse(orientation, NumberStyles.Float, CultureInfo.InvariantCulture, out ox))
|
||||
if (!float.TryParse(orientation, out ox))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,6 @@ using Game.SupportSystem;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Globalization;
|
||||
|
||||
namespace Game.Chat.Commands
|
||||
{
|
||||
@@ -157,10 +156,10 @@ namespace Game.Chat.Commands
|
||||
|
||||
Player player = handler.GetSession().GetPlayer();
|
||||
|
||||
if (!float.TryParse(args.NextString(), NumberStyles.Float, CultureInfo.InvariantCulture, out float gridX))
|
||||
if (!float.TryParse(args.NextString(), out float gridX))
|
||||
return false;
|
||||
|
||||
if (!float.TryParse(args.NextString(), NumberStyles.Float, CultureInfo.InvariantCulture, out float gridY))
|
||||
if (!float.TryParse(args.NextString(), out float gridY))
|
||||
return false;
|
||||
|
||||
if (!uint.TryParse(args.NextString(), out uint mapId))
|
||||
@@ -403,10 +402,10 @@ namespace Game.Chat.Commands
|
||||
|
||||
Player player = handler.GetSession().GetPlayer();
|
||||
|
||||
if (!float.TryParse(args.NextString(), NumberStyles.Float, CultureInfo.InvariantCulture, out float x))
|
||||
if (!float.TryParse(args.NextString(), out float x))
|
||||
return false;
|
||||
|
||||
if (!float.TryParse(args.NextString(), NumberStyles.Float, CultureInfo.InvariantCulture, out float y))
|
||||
if (!float.TryParse(args.NextString(),out float y))
|
||||
return false;
|
||||
|
||||
// prevent accept wrong numeric args
|
||||
@@ -469,10 +468,10 @@ namespace Game.Chat.Commands
|
||||
|
||||
Player player = handler.GetSession().GetPlayer();
|
||||
|
||||
if (!float.TryParse( args.NextString(), NumberStyles.Float, CultureInfo.InvariantCulture, out float x))
|
||||
if (!float.TryParse(args.NextString(), out float x))
|
||||
return false;
|
||||
|
||||
if (!float.TryParse(args.NextString(), NumberStyles.Float, CultureInfo.InvariantCulture, out float y))
|
||||
if (!float.TryParse(args.NextString(), out float y))
|
||||
return false;
|
||||
|
||||
string goZ = args.NextString();
|
||||
@@ -480,13 +479,13 @@ namespace Game.Chat.Commands
|
||||
if (!uint.TryParse(args.NextString(), out uint mapId))
|
||||
mapId = player.GetMapId();
|
||||
|
||||
if (!float.TryParse(args.NextString(), NumberStyles.Float, CultureInfo.InvariantCulture, out float ort))
|
||||
if (!float.TryParse(args.NextString(), out float ort))
|
||||
ort = player.GetOrientation();
|
||||
|
||||
float z;
|
||||
if (!goZ.IsEmpty())
|
||||
{
|
||||
if (!float.TryParse(goZ, NumberStyles.Float, CultureInfo.InvariantCulture, out z))
|
||||
if (!float.TryParse(goZ, out z))
|
||||
return false;
|
||||
|
||||
if (!GridDefines.IsValidMapCoord(mapId, x, y, z))
|
||||
|
||||
@@ -28,7 +28,6 @@ using Game.Network.Packets;
|
||||
using Game.Spells;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
|
||||
namespace Game.Chat
|
||||
@@ -1275,7 +1274,7 @@ namespace Game.Chat
|
||||
return false;
|
||||
|
||||
//0 to 1, sending -1 is instand good weather
|
||||
if (!float.TryParse(args.NextString(), NumberStyles.Float, CultureInfo.InvariantCulture, out float grade))
|
||||
if (!float.TryParse(args.NextString(), out float grade))
|
||||
return false;
|
||||
|
||||
Player player = handler.GetSession().GetPlayer();
|
||||
|
||||
@@ -21,7 +21,6 @@ using Framework.IO;
|
||||
using Game.Entities;
|
||||
using Game.Maps;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
|
||||
namespace Game.Chat.Commands
|
||||
{
|
||||
@@ -285,7 +284,7 @@ namespace Game.Chat.Commands
|
||||
|
||||
if (arg_string == "posx")
|
||||
{
|
||||
if (!float.TryParse(arg_3, NumberStyles.Float, CultureInfo.InvariantCulture, out float arg3))
|
||||
if (!float.TryParse(arg_3, out float arg3))
|
||||
return false;
|
||||
|
||||
stmt = DB.World.GetPreparedStatement(WorldStatements.UPD_WAYPOINT_SCRIPT_X);
|
||||
@@ -298,7 +297,7 @@ namespace Game.Chat.Commands
|
||||
}
|
||||
else if (arg_string == "posy")
|
||||
{
|
||||
if (!float.TryParse(arg_3, NumberStyles.Float, CultureInfo.InvariantCulture, out float arg3))
|
||||
if (!float.TryParse(arg_3, out float arg3))
|
||||
return false;
|
||||
|
||||
stmt = DB.World.GetPreparedStatement(WorldStatements.UPD_WAYPOINT_SCRIPT_Y);
|
||||
@@ -311,7 +310,7 @@ namespace Game.Chat.Commands
|
||||
}
|
||||
else if (arg_string == "posz")
|
||||
{
|
||||
if (!float.TryParse(arg_3, NumberStyles.Float, CultureInfo.InvariantCulture, out float arg3))
|
||||
if (!float.TryParse(arg_3, out float arg3))
|
||||
return false;
|
||||
|
||||
stmt = DB.World.GetPreparedStatement(WorldStatements.UPD_WAYPOINT_SCRIPT_Z);
|
||||
@@ -324,7 +323,7 @@ namespace Game.Chat.Commands
|
||||
}
|
||||
else if (arg_string == "orientation")
|
||||
{
|
||||
if (!float.TryParse(arg_3, NumberStyles.Float, CultureInfo.InvariantCulture, out float arg3))
|
||||
if (!float.TryParse(arg_3, out float arg3))
|
||||
return false;
|
||||
|
||||
stmt = DB.World.GetPreparedStatement(WorldStatements.UPD_WAYPOINT_SCRIPT_O);
|
||||
|
||||
Reference in New Issue
Block a user