1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 15:20:48 -05:00

clean up the profanity determent plugin by using the Get/Set Additional properties

cleaned up the base event parser to not need the server object to generate the event
Hopefully prevent anticheat from freaking out when database connection is lost
This commit is contained in:
RaidMax
2019-05-13 10:36:11 -05:00
parent 12785d68ac
commit 7384f3d1a2
10 changed files with 169 additions and 212 deletions

View File

@ -7,11 +7,10 @@ namespace SharedLibraryCore.Interfaces
/// <summary>
/// Generates a game event based on log line input
/// </summary>
/// <param name="server">server the event occurred on</param>
/// <param name="logLine">single log line string</param>
/// <returns></returns>
/// todo: make this integrate without needing the server
GameEvent GetEvent(Server server, string logLine);
GameEvent GenerateGameEvent(string logLine);
/// <summary>
/// Get game specific folder prefix for log files
/// </summary>

View File

@ -268,11 +268,16 @@ namespace SharedLibraryCore
}
}
public static long ConvertGuidToLong(this string str)
public static long ConvertGuidToLong(this string str, long? fallback = null)
{
str = str.Substring(0, Math.Min(str.Length, 16));
var bot = Regex.Match(str, @"bot[0-9]+").Value;
if (string.IsNullOrWhiteSpace(str) && fallback.HasValue)
{
return fallback.Value;
}
// this is a special case for Plutonium T6
if (str.Length <= 11 &&
long.TryParse(str, NumberStyles.Integer, CultureInfo.InvariantCulture, out long id)) // 10 numeric characters + signed character