mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-10 15:20:48 -05:00
fix duplicate meta data when restarting
fix issue with parsing anticheat info in non en-US culture fix rare issue with client spots "swapping" don't copy referenced shared library assemeblies from plugins
This commit is contained in:
@ -36,6 +36,7 @@ namespace SharedLibraryCore.Commands
|
||||
|
||||
public override Task ExecuteAsync(GameEvent E)
|
||||
{
|
||||
MetaService.Clear();
|
||||
E.Owner.Manager.Restart();
|
||||
E.Origin.Tell(Utilities.CurrentLocalization.LocalizationIndex["COMMANDS_RESTART_SUCCESS"]);
|
||||
return Task.CompletedTask;
|
||||
|
@ -38,11 +38,16 @@ namespace SharedLibraryCore.Helpers
|
||||
{
|
||||
bool valid = Regex.Match(s, @"\((-?[0-9]+\.?[0-9]*|-?[0-9]+\.?[0-9]*e-[0-9]+),\ (-?[0-9]+\.?[0-9]*|-?[0-9]+\.?[0-9]*e-[0-9]+),\ (-?[0-9]+\.?[0-9]*|-?[0-9]+\.?[0-9]*e-[0-9]+)\)").Success;
|
||||
if (!valid)
|
||||
{
|
||||
throw new FormatException("Vector3 is not in correct format");
|
||||
}
|
||||
|
||||
string removeParenthesis = s.Substring(1, s.Length - 2);
|
||||
string[] eachPoint = removeParenthesis.Split(',');
|
||||
return new Vector3(float.Parse(eachPoint[0], System.Globalization.NumberStyles.Any), float.Parse(eachPoint[1], System.Globalization.NumberStyles.Any), float.Parse(eachPoint[2], System.Globalization.NumberStyles.Any));
|
||||
|
||||
return new Vector3(float.Parse(eachPoint[0], System.Globalization.NumberStyles.Any, System.Globalization.CultureInfo.InvariantCulture),
|
||||
float.Parse(eachPoint[1], System.Globalization.NumberStyles.Any, System.Globalization.CultureInfo.InvariantCulture),
|
||||
float.Parse(eachPoint[2], System.Globalization.NumberStyles.Any, System.Globalization.CultureInfo.InvariantCulture));
|
||||
}
|
||||
|
||||
public static double Distance(Vector3 a, Vector3 b)
|
||||
@ -54,14 +59,12 @@ namespace SharedLibraryCore.Helpers
|
||||
{
|
||||
double deltaX = Math.Abs(b.X -a.X);
|
||||
double deltaY = Math.Abs(b.Y - a.Y);
|
||||
double deltaZ = Math.Abs(b.Z - a.Z);
|
||||
|
||||
// this 'fixes' the roll-over angles
|
||||
double dx = deltaX < 360.0 / 2 ? deltaX : 360.0 - deltaX;
|
||||
double dy = deltaY < 360.0 / 2 ? deltaY : 360.0 - deltaY;
|
||||
double dz = deltaZ < 360.0 / 2 ? deltaZ : 360.0 - deltaZ;
|
||||
|
||||
return Math.Sqrt((dx * dx) + (dy * dy) /*+ (dz * dz)*/);
|
||||
return Math.Sqrt((dx * dx) + (dy * dy));
|
||||
}
|
||||
|
||||
public static double ViewAngleDistance(Vector3 a, Vector3 b, Vector3 c)
|
||||
|
@ -56,6 +56,11 @@ namespace SharedLibraryCore.Services
|
||||
}
|
||||
}
|
||||
|
||||
internal static void Clear()
|
||||
{
|
||||
_metaActions.Clear();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// retrieves meta data for given client and key
|
||||
/// </summary>
|
||||
|
@ -31,6 +31,7 @@ namespace SharedLibraryCore
|
||||
public static Encoding EncodingType;
|
||||
public static Localization.Layout CurrentLocalization = new Localization.Layout(new Dictionary<string, string>());
|
||||
public static TimeSpan DefaultCommandTimeout = new TimeSpan(0, 0, 10);
|
||||
public static CultureInfo BestCulture = CultureInfo.CreateSpecificCulture("en-US");
|
||||
|
||||
public static EFClient IW4MAdminClient(Server server = null)
|
||||
{
|
||||
|
Reference in New Issue
Block a user