mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-10 07:13:58 -05:00
fix reading PT6 having signed decimal GUID in log
fix alternative encoding character converting allow more paths for game log server add localization for unknown ips in welcome plugin add gamelog server uri to support game log server on games that must supply manual log path misc fixes
This commit is contained in:
@ -266,11 +266,16 @@ namespace SharedLibraryCore
|
||||
public static long ConvertLong(this string str)
|
||||
{
|
||||
str = str.Substring(0, Math.Min(str.Length, 16));
|
||||
if (Int64.TryParse(str, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out long id))
|
||||
if (long.TryParse(str, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out long id))
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
if (long.TryParse(str, NumberStyles.Integer, CultureInfo.InvariantCulture, out id))
|
||||
{
|
||||
return (uint)id;
|
||||
}
|
||||
|
||||
var bot = Regex.Match(str, @"bot[0-9]+").Value;
|
||||
if (!string.IsNullOrEmpty(bot))
|
||||
{
|
||||
@ -640,6 +645,13 @@ namespace SharedLibraryCore
|
||||
return cmdLine.Length > 1 ? cmdLine[1] : cmdLine[0];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// indicates if the given log path is a remote (http) uri
|
||||
/// </summary>
|
||||
/// <param name="log"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsRemoteLog(this string log) => (log ?? "").StartsWith("http");
|
||||
|
||||
public static string ToBase64UrlSafeString(this string src)
|
||||
{
|
||||
return Convert.ToBase64String(src.Select(c => Convert.ToByte(c)).ToArray()).Replace('+', '-').Replace('/', '_');
|
||||
|
Reference in New Issue
Block a user