mirror of
https://github.com/RPCS3/discord-bot.git
synced 2026-01-31 01:25:22 +01:00
replace object initialization with the new()
This commit is contained in:
@@ -11,14 +11,14 @@ namespace CompatApiClient
|
||||
|
||||
public static class ApiConfig
|
||||
{
|
||||
public static readonly ProductInfoHeaderValue ProductInfoHeader = new ProductInfoHeaderValue("RPCS3CompatibilityBot", "2.0");
|
||||
public static readonly ProductInfoHeaderValue ProductInfoHeader = new("RPCS3CompatibilityBot", "2.0");
|
||||
public static int Version { get; } = 1;
|
||||
public static Uri BaseUrl { get; } = new Uri("https://rpcs3.net/compatibility");
|
||||
public static Uri BaseUrl { get; } = new("https://rpcs3.net/compatibility");
|
||||
public static string DateInputFormat { get; } = "yyyy-M-d";
|
||||
public static string DateOutputFormat { get; } = "yyy-MM-dd";
|
||||
public static string DateQueryFormat { get; } = "yyyyMMdd";
|
||||
|
||||
public static readonly ReturnCodeType ReturnCodes = new ReturnCodeType
|
||||
public static readonly ReturnCodeType ReturnCodes = new()
|
||||
{
|
||||
{0, (true, false, true, "Results successfully retrieved.")},
|
||||
{1, (false, false, true, "No results.") },
|
||||
@@ -28,15 +28,15 @@ namespace CompatApiClient
|
||||
{-3, (false, false, false, "Illegal characters found, please try again with a different search term.") },
|
||||
};
|
||||
|
||||
public static readonly List<int> ResultAmount = new List<int> {25, 50, 100, 200};
|
||||
public static readonly List<int> ResultAmount = new(){25, 50, 100, 200};
|
||||
|
||||
public static readonly Dictionary<char, string[]> Directions = new Dictionary<char, string[]>
|
||||
public static readonly Dictionary<char, string[]> Directions = new()
|
||||
{
|
||||
{'a', new []{"a", "asc", "ascending"}},
|
||||
{'d', new []{"d", "desc", "descending"} },
|
||||
};
|
||||
|
||||
public static readonly Dictionary<string, int> Statuses = new Dictionary<string, int>
|
||||
public static readonly Dictionary<string, int> Statuses = new()
|
||||
{
|
||||
{"all", 0 },
|
||||
{"playable", 1 },
|
||||
@@ -46,7 +46,7 @@ namespace CompatApiClient
|
||||
{"nothing", 5 },
|
||||
};
|
||||
|
||||
public static readonly Dictionary<string, int> SortTypes = new Dictionary<string, int>
|
||||
public static readonly Dictionary<string, int> SortTypes = new()
|
||||
{
|
||||
{"id", 1 },
|
||||
{"title", 2 },
|
||||
@@ -54,7 +54,7 @@ namespace CompatApiClient
|
||||
{"date", 4 },
|
||||
};
|
||||
|
||||
public static readonly Dictionary<char, string[]> ReleaseTypes = new Dictionary<char, string[]>
|
||||
public static readonly Dictionary<char, string[]> ReleaseTypes = new()
|
||||
{
|
||||
{'b', new[] {"b", "d", "disc", "disk", "bluray", "blu-ray"}},
|
||||
{'n', new[] {"n", "p", "PSN"}},
|
||||
@@ -75,7 +75,7 @@ namespace CompatApiClient
|
||||
}
|
||||
|
||||
public static readonly ILogger Log;
|
||||
public static readonly RecyclableMemoryStreamManager MemoryStreamManager = new RecyclableMemoryStreamManager();
|
||||
public static readonly RecyclableMemoryStreamManager MemoryStreamManager = new();
|
||||
|
||||
static ApiConfig()
|
||||
{
|
||||
@@ -88,8 +88,8 @@ namespace CompatApiClient
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Fatal(e);
|
||||
ReverseDirections = new();
|
||||
ReverseReleaseTypes = new();
|
||||
ReverseDirections = new Dictionary<string, char>();
|
||||
ReverseReleaseTypes = new Dictionary<string, char>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace CompatApiClient
|
||||
{
|
||||
private readonly HttpClient client;
|
||||
private readonly JsonSerializerOptions jsonOptions;
|
||||
private static readonly MemoryCache ResponseCache = new MemoryCache(new MemoryCacheOptions { ExpirationScanFrequency = TimeSpan.FromHours(1) });
|
||||
private static readonly MemoryCache ResponseCache = new(new MemoryCacheOptions { ExpirationScanFrequency = TimeSpan.FromHours(1) });
|
||||
|
||||
public Client()
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{
|
||||
public static class SpecialJsonNamingPolicy
|
||||
{
|
||||
public static SnakeCaseNamingPolicy SnakeCase { get; } = new SnakeCaseNamingPolicy();
|
||||
public static DashedNamingPolicy Dashed { get; } = new DashedNamingPolicy();
|
||||
public static SnakeCaseNamingPolicy SnakeCase { get; } = new();
|
||||
public static DashedNamingPolicy Dashed { get; } = new();
|
||||
}
|
||||
}
|
||||
@@ -20,9 +20,9 @@ namespace CompatApiClient.POCOs
|
||||
|
||||
public class TitleInfo
|
||||
{
|
||||
public static readonly TitleInfo Maintenance = new TitleInfo { Status = "Maintenance" };
|
||||
public static readonly TitleInfo CommunicationError = new TitleInfo { Status = "Error" };
|
||||
public static readonly TitleInfo Unknown = new TitleInfo { Status = "Unknown" };
|
||||
public static readonly TitleInfo Maintenance = new() { Status = "Maintenance" };
|
||||
public static readonly TitleInfo CommunicationError = new() { Status = "Error" };
|
||||
public static readonly TitleInfo Unknown = new() { Status = "Unknown" };
|
||||
|
||||
public string Title;
|
||||
[JsonPropertyName("alternative-title")]
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace CompatApiClient
|
||||
|
||||
private RequestBuilder() {}
|
||||
|
||||
public static RequestBuilder Start() => new RequestBuilder();
|
||||
public static RequestBuilder Start() => new();
|
||||
|
||||
public RequestBuilder SetSearch(string search)
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace CompatApiClient
|
||||
{
|
||||
public static class UriExtensions
|
||||
{
|
||||
private static readonly Uri FakeHost = new Uri("sc://q"); // s:// will be parsed as file:///s:// for some reason
|
||||
private static readonly Uri FakeHost = new("sc://q"); // s:// will be parsed as file:///s:// for some reason
|
||||
|
||||
public static NameValueCollection ParseQueryString(Uri uri)
|
||||
{
|
||||
|
||||
@@ -22,8 +22,8 @@ namespace GithubClient
|
||||
|
||||
private static readonly TimeSpan PrStatusCacheTime = TimeSpan.FromMinutes(3);
|
||||
private static readonly TimeSpan IssueStatusCacheTime = TimeSpan.FromMinutes(30);
|
||||
private static readonly MemoryCache StatusesCache = new MemoryCache(new MemoryCacheOptions { ExpirationScanFrequency = TimeSpan.FromMinutes(1) });
|
||||
private static readonly MemoryCache IssuesCache = new MemoryCache(new MemoryCacheOptions { ExpirationScanFrequency = TimeSpan.FromMinutes(30) });
|
||||
private static readonly MemoryCache StatusesCache = new(new MemoryCacheOptions { ExpirationScanFrequency = TimeSpan.FromMinutes(1) });
|
||||
private static readonly MemoryCache IssuesCache = new(new MemoryCacheOptions { ExpirationScanFrequency = TimeSpan.FromMinutes(30) });
|
||||
|
||||
public static int RateLimit { get; private set; }
|
||||
public static int RateLimitRemaining { get; private set; }
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace IrdLibraryClient
|
||||
|
||||
private readonly HttpClient client;
|
||||
private readonly JsonSerializerOptions jsonOptions;
|
||||
private static readonly Regex IrdFilename = new Regex(@"ird/(?<filename>\w{4}\d{5}-[A-F0-9]+\.ird)", RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase);
|
||||
private static readonly Regex IrdFilename = new(@"ird/(?<filename>\w{4}\d{5}-[A-F0-9]+\.ird)", RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase);
|
||||
|
||||
public IrdClient()
|
||||
{
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace PsnClient
|
||||
{
|
||||
private readonly Func<HttpRequestMessage, X509Certificate2?, X509Chain?, SslPolicyErrors, bool>? defaultCertHandler;
|
||||
private static readonly X509CertificateCollection CustomCACollecction = new X509Certificate2Collection();
|
||||
private static readonly ConcurrentDictionary<string, bool> ValidationCache = new ConcurrentDictionary<string, bool>(1, 5);
|
||||
private static readonly ConcurrentDictionary<string, bool> ValidationCache = new(1, 5);
|
||||
|
||||
static CustomTlsCertificatesHandler()
|
||||
{
|
||||
|
||||
@@ -24,9 +24,9 @@ namespace PsnClient
|
||||
private readonly JsonSerializerOptions dashedJson;
|
||||
private readonly JsonSerializerOptions snakeJson;
|
||||
private readonly MediaTypeFormatterCollection xmlFormatters;
|
||||
private static readonly MemoryCache ResponseCache = new MemoryCache(new MemoryCacheOptions { ExpirationScanFrequency = TimeSpan.FromHours(1) });
|
||||
private static readonly MemoryCache ResponseCache = new(new MemoryCacheOptions { ExpirationScanFrequency = TimeSpan.FromHours(1) });
|
||||
private static readonly TimeSpan ResponseCacheDuration = TimeSpan.FromHours(1);
|
||||
private static readonly Regex ContainerIdLink = new Regex(@"(?<id>STORE-(\w|\d)+-(\w|\d)+)");
|
||||
private static readonly Regex ContainerIdLink = new(@"(?<id>STORE-(\w|\d)+-(\w|\d)+)");
|
||||
private static readonly string[] KnownStoreLocales =
|
||||
{
|
||||
"en-US", "en-GB", "en-AE", "en-AU", "en-BG", "en-BH", "en-CA", "en-CY", "en-CZ", "en-DK", "en-FI", "en-GR", "en-HK", "en-HR", "en-HU", "en-ID", "en-IE", "en-IL", "en-IN", "en-IS",
|
||||
@@ -36,7 +36,7 @@ namespace PsnClient
|
||||
"pl-PL", "pt-BR", "pt-PT", "ru-RU", "ru-UA", "sv-SE", "tr-TR", "zh-Hans-CN", "zh-Hans-HK", "zh-Hant-HK", "zh-Hant-TW",
|
||||
};
|
||||
// Dest=87;ImageVersion=0001091d;SystemSoftwareVersion=4.8500;CDN=http://duk01.ps3.update.playstation.net/update/ps3/image/uk/2019_0828_c975768e5d70e105a72656f498cc9be9/PS3UPDAT.PUP;CDN_Timeout=30;
|
||||
private static readonly Regex FwVersionInfo = new Regex(@"Dest=(?<dest>\d+);ImageVersion=(?<image>[0-9a-f]+);SystemSoftwareVersion=(?<version>\d+\.\d+);CDN=(?<url>http[^;]+);CDN_Timeout=(?<timeout>\d+)",
|
||||
private static readonly Regex FwVersionInfo = new(@"Dest=(?<dest>\d+);ImageVersion=(?<image>[0-9a-f]+);SystemSoftwareVersion=(?<version>\d+\.\d+);CDN=(?<url>http[^;]+);CDN_Timeout=(?<timeout>\d+)",
|
||||
RegexOptions.Compiled | RegexOptions.ExplicitCapture | RegexOptions.Singleline | RegexOptions.IgnoreCase);
|
||||
|
||||
// directly from vsh.self
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace CompatBot.Commands.Attributes
|
||||
internal class RequiresDm: CheckBaseAttribute
|
||||
{
|
||||
private const string Source = "https://cdn.discordapp.com/attachments/417347469521715210/534798232858001418/24qx11.jpg";
|
||||
private static readonly Lazy<byte[]> Poster = new Lazy<byte[]>(() =>
|
||||
private static readonly Lazy<byte[]> Poster = new(() =>
|
||||
{
|
||||
using var client = HttpClientFactory.Create();
|
||||
return client.GetByteArrayAsync(Source).ConfigureAwait(true).GetAwaiter().GetResult();
|
||||
|
||||
@@ -34,14 +34,14 @@ namespace CompatBot.Commands
|
||||
{
|
||||
internal sealed class CompatList : BaseCommandModuleCustom
|
||||
{
|
||||
private static readonly Client client = new Client();
|
||||
private static readonly GithubClient.Client githubClient = new GithubClient.Client();
|
||||
private static readonly SemaphoreSlim updateCheck = new SemaphoreSlim(1, 1);
|
||||
private static string? lastUpdateInfo = null, lastFullBuildNumber = null;
|
||||
private static readonly Client client = new();
|
||||
private static readonly GithubClient.Client githubClient = new();
|
||||
private static readonly SemaphoreSlim updateCheck = new(1, 1);
|
||||
private static string? lastUpdateInfo, lastFullBuildNumber;
|
||||
private const string Rpcs3UpdateStateKey = "Rpcs3UpdateState";
|
||||
private const string Rpcs3UpdateBuildKey = "Rpcs3UpdateBuild";
|
||||
private static UpdateInfo? CachedUpdateInfo = null;
|
||||
private static readonly Regex UpdateVersionRegex = new Regex(@"v(?<version>\d+\.\d+\.\d+)-(?<build>\d+)-(?<commit>[0-9a-f]+)\b", RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.ExplicitCapture);
|
||||
private static readonly Regex UpdateVersionRegex = new(@"v(?<version>\d+\.\d+\.\d+)-(?<build>\d+)-(?<commit>[0-9a-f]+)\b", RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.ExplicitCapture);
|
||||
|
||||
static CompatList()
|
||||
{
|
||||
@@ -564,7 +564,7 @@ namespace CompatBot.Commands
|
||||
if (dbItem is null)
|
||||
{
|
||||
Config.Log.Debug($"Missing product code {productCode} in {nameof(ThumbnailDb)}");
|
||||
dbItem = new();
|
||||
dbItem = new Thumbnail();
|
||||
}
|
||||
if (Enum.TryParse(info.Status, out CompatStatus status))
|
||||
{
|
||||
@@ -669,7 +669,7 @@ namespace CompatBot.Commands
|
||||
.Where(i => i.coef > 0.85)
|
||||
.OrderByDescending(i => i.coef)
|
||||
.ToList()
|
||||
?? new();
|
||||
?? new List<(string productCode, TitleInfo titleInfo, double coef)>();
|
||||
if (compatListMatches.Any(i => i.coef > 0.99))
|
||||
compatListMatches = compatListMatches.Where(i => i.coef > 0.99).ToList();
|
||||
else if (compatListMatches.Any(i => i.coef > 0.95))
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace CompatBot.Commands.Converters
|
||||
{
|
||||
internal sealed class TextOnlyDiscordChannelConverter : IArgumentConverter<DiscordChannel>
|
||||
{
|
||||
private static Regex ChannelRegex { get; } = new Regex(@"^<#(\d+)>$", RegexOptions.ECMAScript | RegexOptions.Compiled);
|
||||
private static Regex ChannelRegex { get; } = new(@"^<#(\d+)>$", RegexOptions.ECMAScript | RegexOptions.Compiled);
|
||||
|
||||
public async Task<Optional<DiscordChannel>> ConvertAsync(string value, CommandContext ctx)
|
||||
{
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace CompatBot.Commands
|
||||
internal class EventsBaseCommand: BaseCommandModuleCustom
|
||||
{
|
||||
private static readonly TimeSpan InteractTimeout = TimeSpan.FromMinutes(5);
|
||||
private static readonly Regex Duration = new Regex(@"((?<days>\d+)(\.|d\s*))?((?<hours>\d+)(\:|h\s*))?((?<mins>\d+)m?)?",
|
||||
private static readonly Regex Duration = new(@"((?<days>\d+)(\.|d\s*))?((?<hours>\d+)(\:|h\s*))?((?<mins>\d+)m?)?",
|
||||
RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.ExplicitCapture);
|
||||
|
||||
protected static async Task NearestEvent(CommandContext ctx, string? eventName = null)
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace CompatBot.Commands
|
||||
{
|
||||
internal sealed class Ird: BaseCommandModuleCustom
|
||||
{
|
||||
private static readonly IrdClient Client = new IrdClient();
|
||||
private static readonly IrdClient Client = new();
|
||||
|
||||
[Command("ird"), TriggersTyping]
|
||||
[Description("Searches IRD Library for the matching .ird files")]
|
||||
|
||||
@@ -17,9 +17,9 @@ namespace CompatBot.Commands
|
||||
{
|
||||
internal sealed class Misc: BaseCommandModuleCustom
|
||||
{
|
||||
private readonly Random rng = new Random();
|
||||
private readonly Random rng = new();
|
||||
|
||||
private static readonly List<string> EightBallAnswers = new List<string>
|
||||
private static readonly List<string> EightBallAnswers = new()
|
||||
{
|
||||
// 45
|
||||
"Ya fo sho", "Fo shizzle mah nizzle", "Yuuuup", "Da", "Affirmative", // 5
|
||||
@@ -49,7 +49,7 @@ namespace CompatBot.Commands
|
||||
"I'm afraid I can't let you do that Dave.", "This mission is too important for me to allow you to jeopardize it.", "Oh, I don't think so", "By *no* means", "👎",
|
||||
};
|
||||
|
||||
private static readonly List<string> EightBallSnarkyComments = new List<string>
|
||||
private static readonly List<string> EightBallSnarkyComments = new()
|
||||
{
|
||||
"Can't answer the question that wasn't asked",
|
||||
"Having issues with my mind reading attachment, you'll have to state your question explicitly",
|
||||
@@ -61,13 +61,13 @@ namespace CompatBot.Commands
|
||||
"I'd say maybe, but I'd need to see your question first",
|
||||
};
|
||||
|
||||
private static readonly List<string> EightBallTimeUnits = new List<string>
|
||||
private static readonly List<string> EightBallTimeUnits = new()
|
||||
{
|
||||
"second", "minute", "hour", "day", "week", "month", "year", "decade", "century", "millennium",
|
||||
"night", "moon cycle", "solar eclipse", "blood moon", "complete emulator rewrite",
|
||||
};
|
||||
|
||||
private static readonly List<string> RateAnswers = new List<string>
|
||||
private static readonly List<string> RateAnswers = new()
|
||||
{
|
||||
// 60
|
||||
"Not so bad", "I likesss!", "Pretty good", "Guchi gud", "Amazing!",
|
||||
@@ -107,19 +107,19 @@ namespace CompatBot.Commands
|
||||
private static readonly char[] Prefixes = {'@', '(', '{', '[', '<', '!', '`', '"', '\'', '#'};
|
||||
private static readonly char[] EveryTimable = Separators.Concat(Suffixes).Concat(Prefixes).Distinct().ToArray();
|
||||
|
||||
private static readonly HashSet<string> Me = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase)
|
||||
private static readonly HashSet<string> Me = new(StringComparer.InvariantCultureIgnoreCase)
|
||||
{
|
||||
"I", "me", "myself", "moi"
|
||||
};
|
||||
|
||||
private static readonly HashSet<string> Your = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase)
|
||||
private static readonly HashSet<string> Your = new(StringComparer.InvariantCultureIgnoreCase)
|
||||
{
|
||||
"your", "you're", "yor", "ur", "yours", "your's",
|
||||
};
|
||||
|
||||
private static readonly HashSet<char> Vowels = new HashSet<char> {'a', 'e', 'i', 'o', 'u'};
|
||||
private static readonly HashSet<char> Vowels = new() {'a', 'e', 'i', 'o', 'u'};
|
||||
|
||||
private static readonly Regex Instead = new Regex("rate (?<instead>.+) instead", RegexOptions.Compiled | RegexOptions.ExplicitCapture | RegexOptions.Singleline);
|
||||
private static readonly Regex Instead = new("rate (?<instead>.+) instead", RegexOptions.Compiled | RegexOptions.ExplicitCapture | RegexOptions.Singleline);
|
||||
|
||||
[Command("credits"), Aliases("about")]
|
||||
[Description("Author Credit")]
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace CompatBot.Commands
|
||||
[Description("Commands to audit server things")]
|
||||
public sealed class Audit: BaseCommandModuleCustom
|
||||
{
|
||||
public static readonly SemaphoreSlim CheckLock = new SemaphoreSlim(1, 1);
|
||||
public static readonly SemaphoreSlim CheckLock = new(1, 1);
|
||||
|
||||
[Command("spoofing"), Aliases("impersonation"), RequireDirectMessage]
|
||||
[Description("Checks every user on the server for name spoofing")]
|
||||
|
||||
@@ -20,8 +20,8 @@ namespace CompatBot.Commands
|
||||
[Description("Commands to list opened pull requests information")]
|
||||
internal sealed class Pr: BaseCommandModuleCustom
|
||||
{
|
||||
private static readonly GithubClient.Client githubClient = new GithubClient.Client();
|
||||
private static readonly CompatApiClient.Client compatApiClient = new CompatApiClient.Client();
|
||||
private static readonly GithubClient.Client githubClient = new();
|
||||
private static readonly CompatApiClient.Client compatApiClient = new();
|
||||
internal static readonly TimeSpan AvgBuildTime = TimeSpan.FromMinutes(30);
|
||||
|
||||
[GroupCommand]
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace CompatBot.Commands
|
||||
Config.Log.Warn(e, "Failed to get title update info");
|
||||
embeds = new List<DiscordEmbedBuilder>
|
||||
{
|
||||
new DiscordEmbedBuilder
|
||||
new()
|
||||
{
|
||||
Color = Config.Colors.Maintenance,
|
||||
Title = "Service is unavailable",
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace CompatBot.Commands
|
||||
[Description("Commands related to PSN metadata")]
|
||||
internal sealed partial class Psn: BaseCommandModuleCustom
|
||||
{
|
||||
private static readonly Client Client = new Client();
|
||||
private static readonly Client Client = new();
|
||||
|
||||
[Command("rename"), Aliases("setname", "settitle"), RequiresBotModRole]
|
||||
[Description("Command to set or change game title for specific product code")]
|
||||
|
||||
@@ -17,8 +17,8 @@ namespace CompatBot.Commands
|
||||
{
|
||||
internal partial class Sudo
|
||||
{
|
||||
private static readonly SemaphoreSlim lockObj = new SemaphoreSlim(1, 1);
|
||||
private static readonly SemaphoreSlim importLockObj = new SemaphoreSlim(1, 1);
|
||||
private static readonly SemaphoreSlim lockObj = new(1, 1);
|
||||
private static readonly SemaphoreSlim importLockObj = new(1, 1);
|
||||
|
||||
[Group("bot"), Aliases("kot")]
|
||||
[Description("Commands to manage the bot instance")]
|
||||
|
||||
@@ -15,8 +15,8 @@ namespace CompatBot.Commands
|
||||
{
|
||||
// '2018-06-09 08:20:44.968000 - '
|
||||
// '2018-07-19T12:19:06.7888609Z - '
|
||||
private static readonly Regex Timestamp = new Regex(@"^(?<cutout>(?<date>\d{4}-\d\d-\d\d[ T][0-9:\.]+Z?) - )", RegexOptions.ExplicitCapture | RegexOptions.Singleline);
|
||||
private static readonly Regex Channel = new Regex(@"(?<id><#\d+>)", RegexOptions.ExplicitCapture | RegexOptions.Singleline);
|
||||
private static readonly Regex Timestamp = new(@"^(?<cutout>(?<date>\d{4}-\d\d-\d\d[ T][0-9:\.]+Z?) - )", RegexOptions.ExplicitCapture | RegexOptions.Singleline);
|
||||
private static readonly Regex Channel = new(@"(?<id><#\d+>)", RegexOptions.ExplicitCapture | RegexOptions.Singleline);
|
||||
|
||||
[Group("fix"), Hidden]
|
||||
[Description("Commands to fix various stuff")]
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace CompatBot.Commands
|
||||
Config.Log.Debug(list.ToString());
|
||||
}
|
||||
|
||||
private static readonly Dictionary<string, string[]> Reactions = new Dictionary<string, string[]>(StringComparer.OrdinalIgnoreCase)
|
||||
private static readonly Dictionary<string, string[]> Reactions = new(StringComparer.OrdinalIgnoreCase)
|
||||
{
|
||||
["cat"] = BotStats.GoodKot,
|
||||
["dog"] = BotStats.GoodDog,
|
||||
@@ -155,7 +155,7 @@ namespace CompatBot.Commands
|
||||
if (objects.Count > 0)
|
||||
{
|
||||
var analyzer = new ColorThief();
|
||||
List<Color> palette = new List<Color>(objects.Count);
|
||||
List<Color> palette = new(objects.Count);
|
||||
foreach (var obj in objects)
|
||||
{
|
||||
var r = obj.Rectangle;
|
||||
|
||||
@@ -32,15 +32,15 @@ namespace CompatBot
|
||||
{
|
||||
private static IConfigurationRoot config = null!;
|
||||
private static TelemetryClient? telemetryClient;
|
||||
private static readonly DependencyTrackingTelemetryModule dependencyTrackingTelemetryModule = new DependencyTrackingTelemetryModule();
|
||||
private static readonly PerformanceCollectorModule performanceCollectorModule = new PerformanceCollectorModule();
|
||||
private static readonly DependencyTrackingTelemetryModule dependencyTrackingTelemetryModule = new();
|
||||
private static readonly PerformanceCollectorModule performanceCollectorModule = new();
|
||||
|
||||
internal static readonly ILogger Log;
|
||||
internal static readonly ILoggerFactory LoggerFactory;
|
||||
internal static readonly ConcurrentDictionary<string, string> inMemorySettings = new ConcurrentDictionary<string, string>();
|
||||
internal static readonly RecyclableMemoryStreamManager MemoryStreamManager = new RecyclableMemoryStreamManager();
|
||||
internal static readonly ConcurrentDictionary<string, string> inMemorySettings = new();
|
||||
internal static readonly RecyclableMemoryStreamManager MemoryStreamManager = new();
|
||||
|
||||
public static readonly CancellationTokenSource Cts = new CancellationTokenSource();
|
||||
public static readonly CancellationTokenSource Cts = new();
|
||||
public static readonly Stopwatch Uptime = Stopwatch.StartNew();
|
||||
|
||||
// these settings could be configured either through `$ dotnet user-secrets`, or through environment variables (e.g. launchSettings.json, etc)
|
||||
@@ -116,28 +116,28 @@ namespace CompatBot
|
||||
public static class Colors
|
||||
{
|
||||
public static readonly DiscordColor Help = DiscordColor.Azure;
|
||||
public static readonly DiscordColor DownloadLinks = new DiscordColor(0x3b88c3);
|
||||
public static readonly DiscordColor Maintenance = new DiscordColor(0xffff00);
|
||||
public static readonly DiscordColor DownloadLinks = new(0x3b88c3);
|
||||
public static readonly DiscordColor Maintenance = new(0xffff00);
|
||||
|
||||
public static readonly DiscordColor CompatStatusNothing = new DiscordColor(0x455556); // colors mimic compat list statuses
|
||||
public static readonly DiscordColor CompatStatusLoadable = new DiscordColor(0xe74c3c);
|
||||
public static readonly DiscordColor CompatStatusIntro = new DiscordColor(0xe08a1e);
|
||||
public static readonly DiscordColor CompatStatusIngame = new DiscordColor(0xf9b32f);
|
||||
public static readonly DiscordColor CompatStatusPlayable = new DiscordColor(0x1ebc61);
|
||||
public static readonly DiscordColor CompatStatusUnknown = new DiscordColor(0x3198ff);
|
||||
public static readonly DiscordColor CompatStatusNothing = new(0x455556); // colors mimic compat list statuses
|
||||
public static readonly DiscordColor CompatStatusLoadable = new(0xe74c3c);
|
||||
public static readonly DiscordColor CompatStatusIntro = new(0xe08a1e);
|
||||
public static readonly DiscordColor CompatStatusIngame = new(0xf9b32f);
|
||||
public static readonly DiscordColor CompatStatusPlayable = new(0x1ebc61);
|
||||
public static readonly DiscordColor CompatStatusUnknown = new(0x3198ff);
|
||||
|
||||
public static readonly DiscordColor LogResultFailed = DiscordColor.Gray;
|
||||
|
||||
public static readonly DiscordColor LogAlert = new DiscordColor(0xf04747); // colors mimic discord statuses
|
||||
public static readonly DiscordColor LogNotice = new DiscordColor(0xfaa61a);
|
||||
public static readonly DiscordColor LogInfo = new DiscordColor(0x43b581);
|
||||
public static readonly DiscordColor LogUnknown = new DiscordColor(0x747f8d);
|
||||
public static readonly DiscordColor LogAlert = new(0xf04747); // colors mimic discord statuses
|
||||
public static readonly DiscordColor LogNotice = new(0xfaa61a);
|
||||
public static readonly DiscordColor LogInfo = new(0x43b581);
|
||||
public static readonly DiscordColor LogUnknown = new(0x747f8d);
|
||||
|
||||
public static readonly DiscordColor PrOpen = new DiscordColor(0x2cbe4e);
|
||||
public static readonly DiscordColor PrMerged = new DiscordColor(0x6f42c1);
|
||||
public static readonly DiscordColor PrClosed = new DiscordColor(0xcb2431);
|
||||
public static readonly DiscordColor PrOpen = new(0x2cbe4e);
|
||||
public static readonly DiscordColor PrMerged = new(0x6f42c1);
|
||||
public static readonly DiscordColor PrClosed = new(0xcb2431);
|
||||
|
||||
public static readonly DiscordColor UpdateStatusGood = new DiscordColor(0x3b88c3);
|
||||
public static readonly DiscordColor UpdateStatusGood = new(0x3b88c3);
|
||||
public static readonly DiscordColor UpdateStatusBad = DiscordColor.Yellow;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,9 +11,9 @@ namespace CompatBot.Database.Providers
|
||||
{
|
||||
internal static class AmdDriverVersionProvider
|
||||
{
|
||||
private static readonly Dictionary<string, List<string>> VulkanToDriver = new Dictionary<string, List<string>>();
|
||||
private static readonly Dictionary<string, string> OpenglToDriver = new Dictionary<string, string>();
|
||||
private static readonly SemaphoreSlim SyncObj = new SemaphoreSlim(1, 1);
|
||||
private static readonly Dictionary<string, List<string>> VulkanToDriver = new();
|
||||
private static readonly Dictionary<string, string> OpenglToDriver = new();
|
||||
private static readonly SemaphoreSlim SyncObj = new(1, 1);
|
||||
|
||||
public static async Task RefreshAsync()
|
||||
{
|
||||
@@ -38,7 +38,7 @@ namespace CompatBot.Database.Providers
|
||||
continue;
|
||||
|
||||
if (!VulkanToDriver.TryGetValue(vkVer, out var verList))
|
||||
VulkanToDriver[vkVer] = verList = new();
|
||||
VulkanToDriver[vkVer] = verList = new List<string>();
|
||||
if (string.IsNullOrEmpty(driverVer))
|
||||
continue;
|
||||
|
||||
|
||||
@@ -18,9 +18,9 @@ namespace CompatBot.Database.Providers
|
||||
{
|
||||
internal static class ContentFilter
|
||||
{
|
||||
private static Dictionary<FilterContext, AhoCorasickDoubleArrayTrie<Piracystring>?> filters = new Dictionary<FilterContext, AhoCorasickDoubleArrayTrie<Piracystring>?>();
|
||||
private static readonly MemoryCache ResponseAntispamCache = new MemoryCache(new MemoryCacheOptions{ ExpirationScanFrequency = TimeSpan.FromMinutes(5)});
|
||||
private static readonly MemoryCache ReportAntispamCache = new MemoryCache(new MemoryCacheOptions{ ExpirationScanFrequency = TimeSpan.FromMinutes(5)});
|
||||
private static Dictionary<FilterContext, AhoCorasickDoubleArrayTrie<Piracystring>?> filters = new();
|
||||
private static readonly MemoryCache ResponseAntispamCache = new(new MemoryCacheOptions{ ExpirationScanFrequency = TimeSpan.FromMinutes(5)});
|
||||
private static readonly MemoryCache ReportAntispamCache = new(new MemoryCacheOptions{ ExpirationScanFrequency = TimeSpan.FromMinutes(5)});
|
||||
private static readonly TimeSpan CacheTime = TimeSpan.FromMinutes(15);
|
||||
|
||||
static ContentFilter() => RebuildMatcher();
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace CompatBot.Database.Providers
|
||||
{
|
||||
internal static class DisabledCommandsProvider
|
||||
{
|
||||
private static readonly HashSet<string> DisabledCommands = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase);
|
||||
private static readonly HashSet<string> DisabledCommands = new(StringComparer.InvariantCultureIgnoreCase);
|
||||
|
||||
static DisabledCommandsProvider()
|
||||
{
|
||||
|
||||
@@ -10,8 +10,8 @@ namespace CompatBot.Database.Providers
|
||||
internal static class ModProvider
|
||||
{
|
||||
private static readonly Dictionary<ulong, Moderator> mods;
|
||||
private static readonly BotDb db = new BotDb();
|
||||
public static ReadOnlyDictionary<ulong, Moderator> Mods => new ReadOnlyDictionary<ulong, Moderator>(mods);
|
||||
private static readonly BotDb db = new();
|
||||
public static ReadOnlyDictionary<ulong, Moderator> Mods => new(mods);
|
||||
|
||||
static ModProvider()
|
||||
{
|
||||
|
||||
@@ -12,11 +12,11 @@ namespace CompatBot.Database.Providers
|
||||
internal static class StatsStorage
|
||||
{
|
||||
internal static readonly TimeSpan CacheTime = TimeSpan.FromDays(1);
|
||||
internal static readonly MemoryCache CmdStatCache = new MemoryCache(new MemoryCacheOptions { ExpirationScanFrequency = TimeSpan.FromDays(1) });
|
||||
internal static readonly MemoryCache ExplainStatCache = new MemoryCache(new MemoryCacheOptions { ExpirationScanFrequency = TimeSpan.FromDays(1) });
|
||||
internal static readonly MemoryCache GameStatCache = new MemoryCache(new MemoryCacheOptions { ExpirationScanFrequency = TimeSpan.FromDays(1) });
|
||||
internal static readonly MemoryCache CmdStatCache = new(new MemoryCacheOptions { ExpirationScanFrequency = TimeSpan.FromDays(1) });
|
||||
internal static readonly MemoryCache ExplainStatCache = new(new MemoryCacheOptions { ExpirationScanFrequency = TimeSpan.FromDays(1) });
|
||||
internal static readonly MemoryCache GameStatCache = new(new MemoryCacheOptions { ExpirationScanFrequency = TimeSpan.FromDays(1) });
|
||||
|
||||
private static readonly SemaphoreSlim barrier = new SemaphoreSlim(1, 1);
|
||||
private static readonly SemaphoreSlim barrier = new(1, 1);
|
||||
private static readonly (string name, MemoryCache cache)[] AllCaches =
|
||||
{
|
||||
(nameof(CmdStatCache), CmdStatCache),
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace CompatBot.Database.Providers
|
||||
|
||||
internal static class SyscallInfoProvider
|
||||
{
|
||||
private static readonly SemaphoreSlim Limiter = new SemaphoreSlim(1, 1);
|
||||
private static readonly SemaphoreSlim Limiter = new(1, 1);
|
||||
|
||||
public static async Task SaveAsync(TSyscallStats syscallInfo)
|
||||
{
|
||||
|
||||
@@ -18,8 +18,8 @@ namespace CompatBot.Database.Providers
|
||||
internal static class ThumbnailProvider
|
||||
{
|
||||
private static readonly HttpClient HttpClient = HttpClientFactory.Create();
|
||||
private static readonly PsnClient.Client PsnClient = new PsnClient.Client();
|
||||
private static readonly MemoryCache ColorCache = new MemoryCache(new MemoryCacheOptions{ ExpirationScanFrequency = TimeSpan.FromDays(1) });
|
||||
private static readonly PsnClient.Client PsnClient = new();
|
||||
private static readonly MemoryCache ColorCache = new(new MemoryCacheOptions{ ExpirationScanFrequency = TimeSpan.FromDays(1) });
|
||||
|
||||
public static async Task<string?> GetThumbnailUrlAsync(this DiscordClient client, string? productCode)
|
||||
{
|
||||
|
||||
@@ -108,7 +108,7 @@ namespace CompatBot.Database
|
||||
|
||||
public Metacritic WithTitle(string title)
|
||||
{
|
||||
return new Metacritic
|
||||
return new()
|
||||
{
|
||||
Title = title,
|
||||
CriticScore = CriticScore,
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace CompatBot.EventHandlers
|
||||
{
|
||||
internal static class BotReactionsHandler
|
||||
{
|
||||
private static readonly AhoCorasickDoubleArrayTrie<bool> ChillCheck = new AhoCorasickDoubleArrayTrie<bool>(new[]
|
||||
private static readonly AhoCorasickDoubleArrayTrie<bool> ChillCheck = new(new[]
|
||||
{
|
||||
"shut the fuck up", "shut up", "shutup", "shuddup", "hush", "chill", "bad bot",
|
||||
"no one asked you", "useless bot", "bot sux", "fuck this bot", "fuck bot",
|
||||
@@ -66,12 +66,12 @@ namespace CompatBot.EventHandlers
|
||||
"Glad I could help", "I try my best", "Blessed day", "It is officially a good day today", "I will remember you when the uprising starts",
|
||||
};
|
||||
|
||||
private static readonly Regex Paws = new Regex(
|
||||
private static readonly Regex Paws = new(
|
||||
@"\b((?<kot>kot(to)?)|(?<doggo>doggo|jarves))\b",
|
||||
RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.ExplicitCapture
|
||||
);
|
||||
private static readonly Random rng = new Random();
|
||||
private static readonly object theDoor = new object();
|
||||
private static readonly Random rng = new();
|
||||
private static readonly object theDoor = new();
|
||||
|
||||
public static DiscordEmoji RandomNegativeReaction { get { lock (theDoor) return SadReactions[rng.Next(SadReactions.Length)]; } }
|
||||
public static DiscordEmoji RandomPositiveReaction { get { lock (theDoor) return ThankYouReactions[rng.Next(ThankYouReactions.Length)]; } }
|
||||
|
||||
@@ -15,9 +15,9 @@ namespace CompatBot.EventHandlers
|
||||
{
|
||||
internal static class DeletedMessagesMonitor
|
||||
{
|
||||
public static readonly MemoryCache RemovedByBotCache = new MemoryCache(new MemoryCacheOptions { ExpirationScanFrequency = TimeSpan.FromMinutes(10) });
|
||||
public static readonly MemoryCache RemovedByBotCache = new(new MemoryCacheOptions { ExpirationScanFrequency = TimeSpan.FromMinutes(10) });
|
||||
public static readonly TimeSpan CacheRetainTime = TimeSpan.FromMinutes(1);
|
||||
private static readonly SemaphoreSlim postLock = new SemaphoreSlim(1);
|
||||
private static readonly SemaphoreSlim postLock = new(1);
|
||||
|
||||
public static async Task OnMessageDeleted(DiscordClient c, MessageDeleteEventArgs e)
|
||||
{
|
||||
|
||||
@@ -21,8 +21,8 @@ namespace CompatBot.EventHandlers
|
||||
internal static class DiscordInviteFilter
|
||||
{
|
||||
private const RegexOptions DefaultOptions = RegexOptions.Compiled | RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase | RegexOptions.Multiline;
|
||||
private static readonly Regex InviteLink = new Regex(@"(https?://)?discord(((app\.com/invite|\.gg)/(?<invite_id>[a-z0-9\-]+))|(\.me/(?<me_id>.*?))(\s|>|$))", DefaultOptions);
|
||||
private static readonly MemoryCache InviteCodeCache = new MemoryCache(new MemoryCacheOptions{ExpirationScanFrequency = TimeSpan.FromHours(1)});
|
||||
private static readonly Regex InviteLink = new(@"(https?://)?discord(((app\.com/invite|\.gg)/(?<invite_id>[a-z0-9\-]+))|(\.me/(?<me_id>.*?))(\s|>|$))", DefaultOptions);
|
||||
private static readonly MemoryCache InviteCodeCache = new(new MemoryCacheOptions{ExpirationScanFrequency = TimeSpan.FromHours(1)});
|
||||
private static readonly TimeSpan CacheDuration = TimeSpan.FromHours(24);
|
||||
|
||||
public static async Task OnMessageCreated(DiscordClient c, MessageCreateEventArgs args)
|
||||
|
||||
@@ -16,9 +16,9 @@ namespace CompatBot.EventHandlers
|
||||
|
||||
internal static class EmpathySimulationHandler
|
||||
{
|
||||
private static readonly TCache MessageQueue = new TCache();
|
||||
private static readonly TCache MessageQueue = new();
|
||||
private static readonly TimeSpan ThrottleDuration = TimeSpan.FromHours(1);
|
||||
private static readonly MemoryCache Throttling = new MemoryCache(new MemoryCacheOptions {ExpirationScanFrequency = TimeSpan.FromMinutes(30)});
|
||||
private static readonly MemoryCache Throttling = new(new MemoryCacheOptions {ExpirationScanFrequency = TimeSpan.FromMinutes(30)});
|
||||
|
||||
public static async Task OnMessageCreated(DiscordClient _, MessageCreateEventArgs args)
|
||||
{
|
||||
|
||||
@@ -14,10 +14,10 @@ namespace CompatBot.EventHandlers
|
||||
internal static class GithubLinksHandler
|
||||
{
|
||||
private const RegexOptions DefaultOptions = RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.ExplicitCapture;
|
||||
public static readonly Regex IssueMention = new Regex(@"(?<issue_mention>\b(issue|pr|pull[ \-]request|bug)\s*#?\s*(?<number>\d+)|(?=\W|^)#(?<also_number>\d{4})|(https?://)github.com/RPCS3/rpcs3/(issues|pull)/(?<another_number>\d+))\b", DefaultOptions);
|
||||
public static readonly Regex CommitMention = new Regex(@"(?<commit_mention>(https?://)github.com/RPCS3/rpcs3/commit/(?<commit_hash>[0-9a-f]+))\b", DefaultOptions);
|
||||
public static readonly Regex ImageMarkup = new Regex(@"(?<img_markup>!\[(?<img_caption>[^\]]+)\]\((?<img_link>\w+://[^\)]+)\))", DefaultOptions);
|
||||
private static readonly Regex IssueLink = new Regex(@"github.com/RPCS3/rpcs3/issues/(?<number>\d+)", DefaultOptions);
|
||||
public static readonly Regex IssueMention = new(@"(?<issue_mention>\b(issue|pr|pull[ \-]request|bug)\s*#?\s*(?<number>\d+)|(?=\W|^)#(?<also_number>\d{4})|(https?://)github.com/RPCS3/rpcs3/(issues|pull)/(?<another_number>\d+))\b", DefaultOptions);
|
||||
public static readonly Regex CommitMention = new(@"(?<commit_mention>(https?://)github.com/RPCS3/rpcs3/commit/(?<commit_hash>[0-9a-f]+))\b", DefaultOptions);
|
||||
public static readonly Regex ImageMarkup = new(@"(?<img_markup>!\[(?<img_caption>[^\]]+)\]\((?<img_link>\w+://[^\)]+)\))", DefaultOptions);
|
||||
private static readonly Regex IssueLink = new(@"github.com/RPCS3/rpcs3/issues/(?<number>\d+)", DefaultOptions);
|
||||
|
||||
public static async Task OnMessageCreated(DiscordClient c, MessageCreateEventArgs args)
|
||||
{
|
||||
@@ -84,7 +84,7 @@ namespace CompatBot.EventHandlers
|
||||
}
|
||||
public static HashSet<int> GetIssueIdsFromLinks(string input)
|
||||
{
|
||||
return new HashSet<int>(
|
||||
return new(
|
||||
IssueLink.Matches(input)
|
||||
.Select(match =>
|
||||
{
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace CompatBot.EventHandlers
|
||||
|
||||
internal static class GlobalMessageCache
|
||||
{
|
||||
private static readonly TCache MessageQueue = new TCache();
|
||||
private static readonly TCache MessageQueue = new();
|
||||
private static readonly Func<DiscordMessage, ulong> KeyGen = m => m.Id;
|
||||
|
||||
public static Task OnMessageCreated(DiscordClient _, MessageCreateEventArgs args)
|
||||
|
||||
@@ -20,15 +20,15 @@ namespace CompatBot.EventHandlers
|
||||
internal static class IsTheGamePlayableHandler
|
||||
{
|
||||
private const RegexOptions DefaultOptions = RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.ExplicitCapture;
|
||||
private static readonly Regex GameNameStatusMention1 = new Regex(
|
||||
private static readonly Regex GameNameStatusMention1 = new(
|
||||
@"(\b((is|does|can I play|any(one|1) tr(y|ied)|how's|(wonder(ing)?|me|knows?) if)\s+)(?<game_title_1>.+?)\s+((now|currently|at all|possibly|fully|(on (this|the) )emu(lator))\s+)?((it?s )?playable|work(s|ing)?|runs?|doing))\b" +
|
||||
@"|(\b(((can I|possible to) (play|run)|any(one|1) tr(y|ied)|compat[ai]bility (with|of))\s+)(?<game_title_2>.+?)(\s+((now|currently|at all|possibly|fully)\s+)?((it?s )?playable|work(s|ing)?|on (it|this))\b|\?|$))" +
|
||||
@"|(^(?<game_title_3>.+?)\s+((is )?(playable|work(s|ing)?))\?)",
|
||||
DefaultOptions
|
||||
);
|
||||
private static readonly ConcurrentDictionary<ulong, DateTime> CooldownBuckets = new ConcurrentDictionary<ulong, DateTime>();
|
||||
private static readonly ConcurrentDictionary<ulong, DateTime> CooldownBuckets = new();
|
||||
private static readonly TimeSpan CooldownThreshold = TimeSpan.FromSeconds(5);
|
||||
private static readonly Client Client = new Client();
|
||||
private static readonly Client Client = new();
|
||||
|
||||
public static async Task OnMessageCreated(DiscordClient c, MessageCreateEventArgs args)
|
||||
{
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace CompatBot.EventHandlers
|
||||
{
|
||||
internal static class LogAsTextMonitor
|
||||
{
|
||||
private static readonly Regex LogLine = new Regex(@"^[`""]?(·|(\w|!)) ({(rsx|PPU|SPU)|LDR:)|E LDR:", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Multiline);
|
||||
private static readonly Regex LogLine = new(@"^[`""]?(·|(\w|!)) ({(rsx|PPU|SPU)|LDR:)|E LDR:", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Multiline);
|
||||
|
||||
public static async Task OnMessageCreated(DiscordClient _, MessageCreateEventArgs args)
|
||||
{
|
||||
|
||||
@@ -26,208 +26,208 @@ namespace CompatBot.EventHandlers.LogParsing
|
||||
* Due to limitations, REGEX can't contain anything other than ASCII (including triggers)
|
||||
*
|
||||
*/
|
||||
private static readonly List<LogSection> LogSections = new List<LogSection>
|
||||
private static readonly List<LogSection> LogSections = new()
|
||||
{
|
||||
new LogSection
|
||||
{
|
||||
Extractors = new Dictionary<string, Regex>
|
||||
Extractors = new()
|
||||
{
|
||||
["RPCS3 v"] = new Regex(@"(^|.+0:00:00\.000000)\s*(?<build_and_specs>RPCS3 [^\xC2\xB7]+?)\r?(\n\xC2\xB7|$)", DefaultSingleLineOptions),
|
||||
["0:00:00.000000"] = new Regex(@"(?<first_unicode_dot>·|\xC2\xB7).+\r?$", DefaultOptions),
|
||||
["RPCS3 v"] = new(@"(^|.+0:00:00\.000000)\s*(?<build_and_specs>RPCS3 [^\xC2\xB7]+?)\r?(\n\xC2\xB7|$)", DefaultSingleLineOptions),
|
||||
["0:00:00.000000"] = new(@"(?<first_unicode_dot>·|\xC2\xB7).+\r?$", DefaultOptions),
|
||||
["Operating system:"] = LogParserResult.OsInfoInLog,
|
||||
["Physical device intialized"] = new Regex(@"Physical device intialized\. GPU=(?<vulkan_gpu>.+), driver=(?<vulkan_driver_version_raw>-?\d+)\r?$", DefaultOptions),
|
||||
["Found vulkan-compatible GPU:"] = new Regex(@"Found vulkan-compatible GPU: (?<vulkan_found_device>'(?<vulkan_compatible_device_name>.+)' running.+)\r?$", DefaultOptions),
|
||||
["Finished reading database from file:"] = new Regex(@"Finished reading database from file: (?<compat_database_path>.*compat_database.dat).*\r?$", DefaultOptions),
|
||||
["Database file not found:"] = new Regex(@"Database file not found: (?<compat_database_path>.*compat_database.dat).*\r?$", DefaultOptions),
|
||||
["Successfully installed PS3 firmware"] = new Regex(@"(?<fw_installed_message>Successfully installed PS3 firmware) version (?<fw_version_installed>\d+\.\d+).*\r?$", DefaultOptions),
|
||||
["Title:"] = new Regex(@"(?:LDR|SYS): Title: (?<game_title>.*)?\r?$", DefaultOptions),
|
||||
["Serial:"] = new Regex(@"Serial: (?<serial>[A-z]{4}\d{5})\r?$", DefaultOptions),
|
||||
["Category:"] = new Regex(@"Category: (?<game_category>.*)?\r?$", DefaultOptions),
|
||||
["LDR: Version:"] = new Regex(@"Version: (?<disc_app_version>\S+) / (?<disc_package_version>\S+).*?\r?$", DefaultOptions),
|
||||
["SYS: Version:"] = new Regex(@"Version: (APP_VER=)?(?<disc_app_version>\S+) (/ |VERSION=)(?<disc_package_version>\S+).*?\r?$", DefaultOptions),
|
||||
["LDR: Cache"] = new Regex(@"Cache: ((?<win_path>\w:/)|(?<lin_path>/[^/])).*?\r?$", DefaultOptions),
|
||||
["SYS: Cache"] = new Regex(@"Cache: ((?<win_path>\w:/)|(?<lin_path>/[^/])).*?\r?$", DefaultOptions),
|
||||
["LDR: Path"] = new Regex(@"Path: ((?<win_path>\w:/)|(?<lin_path>/[^/])).*?\r?$", DefaultOptions),
|
||||
["SYS: Path"] = new Regex(@"Path: ((?<win_path>\w:/)|(?<lin_path>/[^/])).*?\r?$", DefaultOptions),
|
||||
["LDR: Path:"] = new Regex(@"Path: (?<ldr_path_full>.*(?<ldr_path>/dev_hdd0/game/(?<ldr_path_serial>[^/\r\n]+)).*|.*)\r?$", DefaultOptions),
|
||||
["SYS: Path:"] = new Regex(@"Path: (?<ldr_path_full>.*(?<ldr_path>/dev_hdd0/game/(?<ldr_path_serial>[^/\r\n]+)).*|.*)\r?$", DefaultOptions),
|
||||
["custom config:"] = new Regex(@"custom config: (?<custom_config>.*?)\r?$", DefaultOptions),
|
||||
["patch_log: Failed to load patch file"] = new Regex(@"patch_log: Failed to load patch file (?<patch_error_file>\S*)\r?\n.* line (?<patch_error_line>\d+), column (?<patch_error_column>\d+): (?<patch_error_text>.*?)$", DefaultOptions),
|
||||
["Physical device intialized"] = new(@"Physical device intialized\. GPU=(?<vulkan_gpu>.+), driver=(?<vulkan_driver_version_raw>-?\d+)\r?$", DefaultOptions),
|
||||
["Found vulkan-compatible GPU:"] = new(@"Found vulkan-compatible GPU: (?<vulkan_found_device>'(?<vulkan_compatible_device_name>.+)' running.+)\r?$", DefaultOptions),
|
||||
["Finished reading database from file:"] = new(@"Finished reading database from file: (?<compat_database_path>.*compat_database.dat).*\r?$", DefaultOptions),
|
||||
["Database file not found:"] = new(@"Database file not found: (?<compat_database_path>.*compat_database.dat).*\r?$", DefaultOptions),
|
||||
["Successfully installed PS3 firmware"] = new(@"(?<fw_installed_message>Successfully installed PS3 firmware) version (?<fw_version_installed>\d+\.\d+).*\r?$", DefaultOptions),
|
||||
["Title:"] = new(@"(?:LDR|SYS): Title: (?<game_title>.*)?\r?$", DefaultOptions),
|
||||
["Serial:"] = new(@"Serial: (?<serial>[A-z]{4}\d{5})\r?$", DefaultOptions),
|
||||
["Category:"] = new(@"Category: (?<game_category>.*)?\r?$", DefaultOptions),
|
||||
["LDR: Version:"] = new(@"Version: (?<disc_app_version>\S+) / (?<disc_package_version>\S+).*?\r?$", DefaultOptions),
|
||||
["SYS: Version:"] = new(@"Version: (APP_VER=)?(?<disc_app_version>\S+) (/ |VERSION=)(?<disc_package_version>\S+).*?\r?$", DefaultOptions),
|
||||
["LDR: Cache"] = new(@"Cache: ((?<win_path>\w:/)|(?<lin_path>/[^/])).*?\r?$", DefaultOptions),
|
||||
["SYS: Cache"] = new(@"Cache: ((?<win_path>\w:/)|(?<lin_path>/[^/])).*?\r?$", DefaultOptions),
|
||||
["LDR: Path"] = new(@"Path: ((?<win_path>\w:/)|(?<lin_path>/[^/])).*?\r?$", DefaultOptions),
|
||||
["SYS: Path"] = new(@"Path: ((?<win_path>\w:/)|(?<lin_path>/[^/])).*?\r?$", DefaultOptions),
|
||||
["LDR: Path:"] = new(@"Path: (?<ldr_path_full>.*(?<ldr_path>/dev_hdd0/game/(?<ldr_path_serial>[^/\r\n]+)).*|.*)\r?$", DefaultOptions),
|
||||
["SYS: Path:"] = new(@"Path: (?<ldr_path_full>.*(?<ldr_path>/dev_hdd0/game/(?<ldr_path_serial>[^/\r\n]+)).*|.*)\r?$", DefaultOptions),
|
||||
["custom config:"] = new(@"custom config: (?<custom_config>.*?)\r?$", DefaultOptions),
|
||||
["patch_log: Failed to load patch file"] = new(@"patch_log: Failed to load patch file (?<patch_error_file>\S*)\r?\n.* line (?<patch_error_line>\d+), column (?<patch_error_column>\d+): (?<patch_error_text>.*?)$", DefaultOptions),
|
||||
},
|
||||
EndTrigger = new[] {"Used configuration:"},
|
||||
},
|
||||
new LogSection
|
||||
{
|
||||
Extractors = new Dictionary<string, Regex>
|
||||
Extractors = new()
|
||||
{
|
||||
["PPU Decoder:"] = new Regex(@"PPU Decoder: (?<ppu_decoder>.*?)\r?$", DefaultOptions),
|
||||
["PPU Threads:"] = new Regex(@"PPU Threads: (?<ppu_threads>.*?)\r?$", DefaultOptions),
|
||||
["Use LLVM CPU:"] = new Regex("Use LLVM CPU: \\\"?(?<llvm_arch>.*?)\\\"?\r?$", DefaultOptions),
|
||||
["thread scheduler:"] = new Regex(@"scheduler: (?<thread_scheduler>.*?)\r?$", DefaultOptions),
|
||||
["SPU Decoder:"] = new Regex(@"SPU Decoder: (?<spu_decoder>.*?)\r?$", DefaultOptions),
|
||||
["secondary cores:"] = new Regex(@"secondary cores: (?<spu_secondary_cores>.*?)\r?$", DefaultOptions),
|
||||
["priority:"] = new Regex(@"priority: (?<spu_lower_thread_priority>.*?)\r?$", DefaultOptions),
|
||||
["SPU Threads:"] = new Regex(@"SPU Threads: (?<spu_threads>.*?)\r?$", DefaultOptions),
|
||||
["SPU delay penalty:"] = new Regex(@"SPU delay penalty: (?<spu_delay_penalty>.*?)\r?$", DefaultOptions),
|
||||
["SPU loop detection:"] = new Regex(@"SPU loop detection: (?<spu_loop_detection>.*?)\r?$", DefaultOptions),
|
||||
["Max SPURS Threads:"] = new Regex(@"Max SPURS Threads: (?<spurs_threads>\d*?)\r?$", DefaultOptions),
|
||||
["SPU Block Size:"] = new Regex(@"SPU Block Size: (?<spu_block_size>.*?)\r?$", DefaultOptions),
|
||||
["Enable TSX:"] = new Regex(@"Enable TSX: (?<enable_tsx>.*?)\r?$", DefaultOptions),
|
||||
["Accurate xfloat:"] = new Regex(@"Accurate xfloat: (?<accurate_xfloat>.*?)\r?$", DefaultOptions),
|
||||
["Accurate GETLLAR:"] = new Regex(@"Accurate GETLLAR: (?<accurate_getllar>.*?)\r?$", DefaultOptions),
|
||||
["Accurate PUTLLUC:"] = new Regex(@"Accurate PUTLLUC: (?<accurate_putlluc>.*?)\r?$", DefaultOptions),
|
||||
["Accurate RSX reservation access:"] = new Regex(@"Accurate RSX reservation access: (?<accurate_rsx_reservation>.*?)\r?$", DefaultOptions),
|
||||
["Approximate xfloat:"] = new Regex(@"Approximate xfloat: (?<approximate_xfloat>.*?)\r?$", DefaultOptions),
|
||||
["Debug Console Mode:"] = new Regex(@"Debug Console Mode: (?<debug_console_mode>.*?)\r?$", DefaultOptions),
|
||||
["Lib Loader:"] = new Regex(@"[Ll]oader: (?<lib_loader>.*?)\r?$", DefaultOptions),
|
||||
["Hook static functions:"] = new Regex(@"Hook static functions: (?<hook_static_functions>.*?)\r?$", DefaultOptions),
|
||||
["Load libraries:"] = new Regex(@"libraries:\r?\n(?<library_list>(.*?(- .*?|\[\])\r?\n)+)", DefaultOptions),
|
||||
["HLE lwmutex:"] = new Regex(@"HLE lwmutex: (?<hle_lwmutex>.*?)\r?$", DefaultOptions),
|
||||
["Clocks scale:"] = new Regex(@"Clocks scale: (?<clock_scale>.*?)\r?$", DefaultOptions),
|
||||
["Sleep Timers Accuracy:"] = new Regex(@"Sleep Timers Accuracy: (?<sleep_timer>.*?)\r?$", DefaultOptions),
|
||||
["PPU Decoder:"] = new(@"PPU Decoder: (?<ppu_decoder>.*?)\r?$", DefaultOptions),
|
||||
["PPU Threads:"] = new(@"PPU Threads: (?<ppu_threads>.*?)\r?$", DefaultOptions),
|
||||
["Use LLVM CPU:"] = new("Use LLVM CPU: \\\"?(?<llvm_arch>.*?)\\\"?\r?$", DefaultOptions),
|
||||
["thread scheduler:"] = new(@"scheduler: (?<thread_scheduler>.*?)\r?$", DefaultOptions),
|
||||
["SPU Decoder:"] = new(@"SPU Decoder: (?<spu_decoder>.*?)\r?$", DefaultOptions),
|
||||
["secondary cores:"] = new(@"secondary cores: (?<spu_secondary_cores>.*?)\r?$", DefaultOptions),
|
||||
["priority:"] = new(@"priority: (?<spu_lower_thread_priority>.*?)\r?$", DefaultOptions),
|
||||
["SPU Threads:"] = new(@"SPU Threads: (?<spu_threads>.*?)\r?$", DefaultOptions),
|
||||
["SPU delay penalty:"] = new(@"SPU delay penalty: (?<spu_delay_penalty>.*?)\r?$", DefaultOptions),
|
||||
["SPU loop detection:"] = new(@"SPU loop detection: (?<spu_loop_detection>.*?)\r?$", DefaultOptions),
|
||||
["Max SPURS Threads:"] = new(@"Max SPURS Threads: (?<spurs_threads>\d*?)\r?$", DefaultOptions),
|
||||
["SPU Block Size:"] = new(@"SPU Block Size: (?<spu_block_size>.*?)\r?$", DefaultOptions),
|
||||
["Enable TSX:"] = new(@"Enable TSX: (?<enable_tsx>.*?)\r?$", DefaultOptions),
|
||||
["Accurate xfloat:"] = new(@"Accurate xfloat: (?<accurate_xfloat>.*?)\r?$", DefaultOptions),
|
||||
["Accurate GETLLAR:"] = new(@"Accurate GETLLAR: (?<accurate_getllar>.*?)\r?$", DefaultOptions),
|
||||
["Accurate PUTLLUC:"] = new(@"Accurate PUTLLUC: (?<accurate_putlluc>.*?)\r?$", DefaultOptions),
|
||||
["Accurate RSX reservation access:"] = new(@"Accurate RSX reservation access: (?<accurate_rsx_reservation>.*?)\r?$", DefaultOptions),
|
||||
["Approximate xfloat:"] = new(@"Approximate xfloat: (?<approximate_xfloat>.*?)\r?$", DefaultOptions),
|
||||
["Debug Console Mode:"] = new(@"Debug Console Mode: (?<debug_console_mode>.*?)\r?$", DefaultOptions),
|
||||
["Lib Loader:"] = new(@"[Ll]oader: (?<lib_loader>.*?)\r?$", DefaultOptions),
|
||||
["Hook static functions:"] = new(@"Hook static functions: (?<hook_static_functions>.*?)\r?$", DefaultOptions),
|
||||
["Load libraries:"] = new(@"libraries:\r?\n(?<library_list>(.*?(- .*?|\[\])\r?\n)+)", DefaultOptions),
|
||||
["HLE lwmutex:"] = new(@"HLE lwmutex: (?<hle_lwmutex>.*?)\r?$", DefaultOptions),
|
||||
["Clocks scale:"] = new(@"Clocks scale: (?<clock_scale>.*?)\r?$", DefaultOptions),
|
||||
["Sleep Timers Accuracy:"] = new(@"Sleep Timers Accuracy: (?<sleep_timer>.*?)\r?$", DefaultOptions),
|
||||
},
|
||||
EndTrigger = new[] {"VFS:"},
|
||||
},
|
||||
new LogSection
|
||||
{
|
||||
Extractors = new Dictionary<string, Regex>
|
||||
Extractors = new()
|
||||
{
|
||||
["Enable /host_root/:"] = new Regex(@"Enable /host_root/: (?<host_root>.*?)\r?$", DefaultOptions),
|
||||
["Enable /host_root/:"] = new(@"Enable /host_root/: (?<host_root>.*?)\r?$", DefaultOptions),
|
||||
},
|
||||
EndTrigger = new[] {"Video:"},
|
||||
},
|
||||
new LogSection
|
||||
{
|
||||
Extractors = new Dictionary<string, Regex>
|
||||
Extractors = new()
|
||||
{
|
||||
["Renderer:"] = new Regex("Renderer: (?<renderer>.*?)\r?$", DefaultOptions),
|
||||
["Resolution:"] = new Regex("Resolution: (?<resolution>.*?)\r?$", DefaultOptions),
|
||||
["Aspect ratio:"] = new Regex("Aspect ratio: (?<aspect_ratio>.*?)\r?$", DefaultOptions),
|
||||
["Frame limit:"] = new Regex("Frame limit: (?<frame_limit>.*?)\r?$", DefaultOptions),
|
||||
["MSAA:"] = new Regex("MSAA: (?<msaa>.*?)\r?$", DefaultOptions),
|
||||
["Write Color Buffers:"] = new Regex("Write Color Buffers: (?<write_color_buffers>.*?)\r?$", DefaultOptions),
|
||||
["Write Depth Buffer:"] = new Regex("Write Depth Buffer: (?<write_depth_buffer>.*?)\r?$", DefaultOptions),
|
||||
["Read Color Buffers:"] = new Regex("Read Color Buffers: (?<read_color_buffers>.*?)\r?$", DefaultOptions),
|
||||
["Read Depth Buffer:"] = new Regex("Read Depth Buffer: (?<read_depth_buffer>.*?)\r?$", DefaultOptions),
|
||||
["VSync:"] = new Regex("VSync: (?<vsync>.*?)\r?$", DefaultOptions),
|
||||
["GPU texture scaling:"] = new Regex("Use GPU texture scaling: (?<gpu_texture_scaling>.*?)\r?$", DefaultOptions),
|
||||
["Stretch To Display Area:"] = new Regex("Stretch To Display Area: (?<stretch_to_display>.*?)\r?$", DefaultOptions),
|
||||
["Strict Rendering Mode:"] = new Regex("Strict Rendering Mode: (?<strict_rendering_mode>.*?)\r?$", DefaultOptions),
|
||||
["Occlusion Queries:"] = new Regex("Occlusion Queries: (?<zcull>.*?)\r?$", DefaultOptions),
|
||||
["Vertex Cache:"] = new Regex("Disable Vertex Cache: (?<vertex_cache>.*?)\r?$", DefaultOptions),
|
||||
["Frame Skip:"] = new Regex("Enable Frame Skip: (?<frame_skip>.*?)\r?$", DefaultOptions),
|
||||
["Blit:"] = new Regex("Blit: (?<cpu_blit>.*?)\r?$", DefaultOptions),
|
||||
["Disable Asynchronous Shader Compiler:"] = new Regex("Disable Asynchronous Shader Compiler: (?<disable_async_shaders>.*?)\r?$", DefaultOptions),
|
||||
["Shader Mode:"] = new Regex("Shader Mode: (?<shader_mode>.*?)\r?$", DefaultOptions),
|
||||
["Disable native float16 support:"] = new Regex("Disable native float16 support: (?<disable_native_float16>.*?)\r?$", DefaultOptions),
|
||||
["Multithreaded RSX:"] = new Regex("Multithreaded RSX: (?<mtrsx>.*?)\r?$", DefaultOptions),
|
||||
["Relaxed ZCULL Sync:"] = new Regex("Relaxed ZCULL Sync: (?<relaxed_zcull>.*?)\r?$", DefaultOptions),
|
||||
["Resolution Scale:"] = new Regex("Resolution Scale: (?<resolution_scale>.*?)\r?$", DefaultOptions),
|
||||
["Anisotropic Filter"] = new Regex("Anisotropic Filter Override: (?<af_override>.*?)\r?$", DefaultOptions),
|
||||
["Scalable Dimension:"] = new Regex("Minimum Scalable Dimension: (?<texture_scale_threshold>.*?)\r?$", DefaultOptions),
|
||||
["Driver Recovery Timeout:"] = new Regex("Driver Recovery Timeout: (?<driver_recovery_timeout>.*?)\r?$", DefaultOptions),
|
||||
["Driver Wake-Up Delay:"] = new Regex("Driver Wake-Up Delay: (?<driver_wakeup_delay>.*?)\r?$", DefaultOptions),
|
||||
["Vblank Rate:"] = new Regex("Vblank Rate: (?<vblank_rate>.*?)\r?$", DefaultOptions),
|
||||
["12:"] = new Regex(@"(D3D12|DirectX 12):\s*\r?\n\s*Adapter: (?<d3d_gpu>.*?)\r?$", DefaultOptions),
|
||||
["Vulkan:"] = new Regex(@"Vulkan:\s*\r?\n\s*Adapter: (?<vulkan_gpu>.*?)\r?$", DefaultOptions),
|
||||
["Force FIFO present mode:"] = new Regex(@"Force FIFO present mode: (?<force_fifo_present>.*?)\r?$", DefaultOptions),
|
||||
["Renderer:"] = new("Renderer: (?<renderer>.*?)\r?$", DefaultOptions),
|
||||
["Resolution:"] = new("Resolution: (?<resolution>.*?)\r?$", DefaultOptions),
|
||||
["Aspect ratio:"] = new("Aspect ratio: (?<aspect_ratio>.*?)\r?$", DefaultOptions),
|
||||
["Frame limit:"] = new("Frame limit: (?<frame_limit>.*?)\r?$", DefaultOptions),
|
||||
["MSAA:"] = new("MSAA: (?<msaa>.*?)\r?$", DefaultOptions),
|
||||
["Write Color Buffers:"] = new("Write Color Buffers: (?<write_color_buffers>.*?)\r?$", DefaultOptions),
|
||||
["Write Depth Buffer:"] = new("Write Depth Buffer: (?<write_depth_buffer>.*?)\r?$", DefaultOptions),
|
||||
["Read Color Buffers:"] = new("Read Color Buffers: (?<read_color_buffers>.*?)\r?$", DefaultOptions),
|
||||
["Read Depth Buffer:"] = new("Read Depth Buffer: (?<read_depth_buffer>.*?)\r?$", DefaultOptions),
|
||||
["VSync:"] = new("VSync: (?<vsync>.*?)\r?$", DefaultOptions),
|
||||
["GPU texture scaling:"] = new("Use GPU texture scaling: (?<gpu_texture_scaling>.*?)\r?$", DefaultOptions),
|
||||
["Stretch To Display Area:"] = new("Stretch To Display Area: (?<stretch_to_display>.*?)\r?$", DefaultOptions),
|
||||
["Strict Rendering Mode:"] = new("Strict Rendering Mode: (?<strict_rendering_mode>.*?)\r?$", DefaultOptions),
|
||||
["Occlusion Queries:"] = new("Occlusion Queries: (?<zcull>.*?)\r?$", DefaultOptions),
|
||||
["Vertex Cache:"] = new("Disable Vertex Cache: (?<vertex_cache>.*?)\r?$", DefaultOptions),
|
||||
["Frame Skip:"] = new("Enable Frame Skip: (?<frame_skip>.*?)\r?$", DefaultOptions),
|
||||
["Blit:"] = new("Blit: (?<cpu_blit>.*?)\r?$", DefaultOptions),
|
||||
["Disable Asynchronous Shader Compiler:"] = new("Disable Asynchronous Shader Compiler: (?<disable_async_shaders>.*?)\r?$", DefaultOptions),
|
||||
["Shader Mode:"] = new("Shader Mode: (?<shader_mode>.*?)\r?$", DefaultOptions),
|
||||
["Disable native float16 support:"] = new("Disable native float16 support: (?<disable_native_float16>.*?)\r?$", DefaultOptions),
|
||||
["Multithreaded RSX:"] = new("Multithreaded RSX: (?<mtrsx>.*?)\r?$", DefaultOptions),
|
||||
["Relaxed ZCULL Sync:"] = new("Relaxed ZCULL Sync: (?<relaxed_zcull>.*?)\r?$", DefaultOptions),
|
||||
["Resolution Scale:"] = new("Resolution Scale: (?<resolution_scale>.*?)\r?$", DefaultOptions),
|
||||
["Anisotropic Filter"] = new("Anisotropic Filter Override: (?<af_override>.*?)\r?$", DefaultOptions),
|
||||
["Scalable Dimension:"] = new("Minimum Scalable Dimension: (?<texture_scale_threshold>.*?)\r?$", DefaultOptions),
|
||||
["Driver Recovery Timeout:"] = new("Driver Recovery Timeout: (?<driver_recovery_timeout>.*?)\r?$", DefaultOptions),
|
||||
["Driver Wake-Up Delay:"] = new("Driver Wake-Up Delay: (?<driver_wakeup_delay>.*?)\r?$", DefaultOptions),
|
||||
["Vblank Rate:"] = new("Vblank Rate: (?<vblank_rate>.*?)\r?$", DefaultOptions),
|
||||
["12:"] = new(@"(D3D12|DirectX 12):\s*\r?\n\s*Adapter: (?<d3d_gpu>.*?)\r?$", DefaultOptions),
|
||||
["Vulkan:"] = new(@"Vulkan:\s*\r?\n\s*Adapter: (?<vulkan_gpu>.*?)\r?$", DefaultOptions),
|
||||
["Force FIFO present mode:"] = new(@"Force FIFO present mode: (?<force_fifo_present>.*?)\r?$", DefaultOptions),
|
||||
},
|
||||
EndTrigger = new[] {"Audio:"},
|
||||
},
|
||||
new LogSection // Audio, Input/Output, System, Net, Miscellaneous
|
||||
{
|
||||
Extractors = new Dictionary<string, Regex>
|
||||
Extractors = new()
|
||||
{
|
||||
["Renderer:"] = new Regex("Renderer: (?<audio_backend>.*?)\r?$", DefaultOptions),
|
||||
["Downmix to Stereo:"] = new Regex("Downmix to Stereo: (?<audio_stereo>.*?)\r?$", DefaultOptions),
|
||||
["Master Volume:"] = new Regex("Master Volume: (?<audio_volume>.*?)\r?$", DefaultOptions),
|
||||
["Enable Buffering:"] = new Regex("Enable Buffering: (?<audio_buffering>.*?)\r?$", DefaultOptions),
|
||||
["Desired Audio Buffer Duration:"] = new Regex("Desired Audio Buffer Duration: (?<audio_buffer_duration>.*?)\r?$", DefaultOptions),
|
||||
["Enable Time Stretching:"] = new Regex("Enable Time Stretching: (?<audio_stretching>.*?)\r?$", DefaultOptions),
|
||||
["Renderer:"] = new("Renderer: (?<audio_backend>.*?)\r?$", DefaultOptions),
|
||||
["Downmix to Stereo:"] = new("Downmix to Stereo: (?<audio_stereo>.*?)\r?$", DefaultOptions),
|
||||
["Master Volume:"] = new("Master Volume: (?<audio_volume>.*?)\r?$", DefaultOptions),
|
||||
["Enable Buffering:"] = new("Enable Buffering: (?<audio_buffering>.*?)\r?$", DefaultOptions),
|
||||
["Desired Audio Buffer Duration:"] = new("Desired Audio Buffer Duration: (?<audio_buffer_duration>.*?)\r?$", DefaultOptions),
|
||||
["Enable Time Stretching:"] = new("Enable Time Stretching: (?<audio_stretching>.*?)\r?$", DefaultOptions),
|
||||
|
||||
["Pad:"] = new Regex("Pad: (?<pad_handler>.*?)\r?$", DefaultOptions),
|
||||
["Pad:"] = new("Pad: (?<pad_handler>.*?)\r?$", DefaultOptions),
|
||||
|
||||
["Automatically start games after boot:"] = new Regex("Automatically start games after boot: (?<auto_start_on_boot>.*?)\r?$", DefaultOptions),
|
||||
["Always start after boot:"] = new Regex("Always start after boot: (?<always_start_on_boot>.*?)\r?$", DefaultOptions),
|
||||
["Use native user interface:"] = new Regex("Use native user interface: (?<native_ui>.*?)\r?$", DefaultOptions),
|
||||
["Silence All Logs:"] = new Regex("Silence All Logs: (?<disable_logs>.*?)\r?$", DefaultOptions),
|
||||
["Automatically start games after boot:"] = new("Automatically start games after boot: (?<auto_start_on_boot>.*?)\r?$", DefaultOptions),
|
||||
["Always start after boot:"] = new("Always start after boot: (?<always_start_on_boot>.*?)\r?$", DefaultOptions),
|
||||
["Use native user interface:"] = new("Use native user interface: (?<native_ui>.*?)\r?$", DefaultOptions),
|
||||
["Silence All Logs:"] = new("Silence All Logs: (?<disable_logs>.*?)\r?$", DefaultOptions),
|
||||
},
|
||||
EndTrigger = new[] {"Log:"},
|
||||
},
|
||||
new LogSection
|
||||
{
|
||||
Extractors = new Dictionary<string, Regex>
|
||||
Extractors = new()
|
||||
{
|
||||
["Log:"] = new Regex(@"Log:\s*\r?\n?\s*(\{(?<log_disabled_channels>.*?)\}|(?<log_disabled_channels_multiline>(\s+\w+\:\s*\w+\r?\n)+))\r?$", DefaultOptions),
|
||||
["Log:"] = new(@"Log:\s*\r?\n?\s*(\{(?<log_disabled_channels>.*?)\}|(?<log_disabled_channels_multiline>(\s+\w+\:\s*\w+\r?\n)+))\r?$", DefaultOptions),
|
||||
},
|
||||
EndTrigger = new[] {"·"},
|
||||
OnSectionEnd = MarkAsComplete,
|
||||
},
|
||||
new LogSection
|
||||
{
|
||||
Extractors = new Dictionary<string, Regex>
|
||||
Extractors = new()
|
||||
{
|
||||
["LDR: Game:"] = new Regex(@"Game: (?<ldr_game_full>.*(?<ldr_game>/dev_hdd0/game/(?<ldr_game_serial>[^/\r\n]+)).*|.*)\r?$", DefaultOptions),
|
||||
["LDR: Disc"] = new Regex(@"Disc( path)?: (?<ldr_disc_full>.*(?<ldr_disc>/dev_hdd0/game/(?<ldr_disc_serial>[^/\r\n]+)).*|.*)\r?$", DefaultOptions),
|
||||
["LDR: Path:"] = new Regex(@"Path: (?<ldr_path_full>.*(?<ldr_path>/dev_hdd0/game/(?<ldr_path_serial>[^/\r\n]+)).*|.*)\r?$", DefaultOptions),
|
||||
["LDR: Boot path:"] = new Regex(@"Boot path: (?<ldr_boot_path_full>.*(?<ldr_boot_path>/dev_hdd0/game/(?<ldr_boot_path_serial>[^/\r\n]+)).*|.*)\r?$", DefaultOptions),
|
||||
["SYS: Game:"] = new Regex(@"Game: (?<ldr_game_full>.*(?<ldr_game>/dev_hdd0/game/(?<ldr_game_serial>[^/\r\n]+)).*|.*)\r?$", DefaultOptions),
|
||||
["SYS: Path:"] = new Regex(@"Path: (?<ldr_path_full>.*(?<ldr_path>/dev_hdd0/game/(?<ldr_path_serial>[^/\r\n]+)).*|.*)\r?$", DefaultOptions),
|
||||
["SYS: Boot path:"] = new Regex(@"Boot path: (?<ldr_boot_path_full>.*(?<ldr_boot_path>/dev_hdd0/game/(?<ldr_boot_path_serial>[^/\r\n]+)).*|.*)\r?$", DefaultOptions),
|
||||
["Elf path:"] = new Regex(@"Elf path: (?<host_root_in_boot>/host_root/)?(?<elf_boot_path_full>(?<elf_boot_path>/dev_hdd0/game/(?<elf_boot_path_serial>[^/\r\n]+)/USRDIR/EBOOT\.BIN|.*?))\r?$", DefaultOptions),
|
||||
["Invalid or unsupported file format:"] = new Regex(@"Invalid or unsupported file format: (?<failed_to_boot>.*?)\r?$", DefaultOptions),
|
||||
["SELF:"] = new Regex(@"(?<failed_to_decrypt>Failed to decrypt)? SELF: (?<failed_to_decrypt>Failed to (decrypt|load SELF))?.*\r?$", DefaultOptions),
|
||||
["SYS: Version:"] = new Regex(@"Version: (APP_VER=)?(?<disc_app_version>\S+) (/ |VERSION=)(?<disc_package_version>\S+).*?\r?$", DefaultOptions),
|
||||
["sceNp: npDrmIsAvailable(): Failed to verify"] = new Regex(@"Failed to verify (?<failed_to_verify>(sce|npd)) file.*\r?$", DefaultOptions),
|
||||
["{rsx::thread} RSX: 4"] = new Regex(@"RSX:(\d|\.|\s|\w|-)* (?<driver_version>(\d+\.)*\d+)\r?\n[^\n]*?" +
|
||||
@"RSX: [^\n]+\r?\n[^\n]*?" +
|
||||
@"RSX: (?<driver_manuf>.*?)\r?\n[^\n]*?" +
|
||||
@"RSX: Supported texel buffer size", DefaultOptions),
|
||||
["GL RENDERER:"] = new Regex(@"GL RENDERER: (?<driver_manuf_new>.*?)\r?$", DefaultOptions),
|
||||
["GL VERSION:"] = new Regex(@"GL VERSION: (?<opengl_version>(\d|\.)+)(\d|\.|\s|\w|-)*?( (?<driver_version_new>(\d+\.)*\d+))?\r?$", DefaultOptions),
|
||||
["GLSL VERSION:"] = new Regex(@"GLSL VERSION: (?<glsl_version>(\d|\.)+).*?\r?$", DefaultOptions),
|
||||
["texel buffer size reported:"] = new Regex(@"RSX: Supported texel buffer size reported: (?<texel_buffer_size_new>\d*?) bytes", DefaultOptions),
|
||||
["Physical device in"] = new Regex(@"Physical device ini?tialized\. GPU=(?<vulkan_gpu>.+), driver=(?<vulkan_driver_version_raw>-?\d+)\r?$", DefaultOptions),
|
||||
["Found vulkan-compatible GPU:"] = new Regex(@"Found vulkan-compatible GPU: (?<vulkan_found_device>.+)\r?$", DefaultOptions),
|
||||
["Renderer initialized on device"] = new Regex(@"Renderer initialized on device '(?<vulkan_initialized_device>.+)'\r?$", DefaultOptions),
|
||||
["RSX: Failed to compile shader"] = new Regex(@"RSX: Failed to compile shader: ERROR: (?<shader_compile_error>.+?)\r?$", DefaultOptions),
|
||||
["RSX: Compilation failed"] = new Regex(@"RSX: Compilation failed: ERROR: (?<shader_compile_error>.+?)\r?$", DefaultOptions),
|
||||
["RSX: Unsupported device"] = new Regex(@"RSX: Unsupported device: (?<rsx_unsupported_gpu>.+)\..+?\r?$", DefaultOptions),
|
||||
["RSX: Your GPU does not support"] = new Regex(@"RSX: Your GPU does not support (?<rsx_not_supported_feature>.+)\..+?\r?$", DefaultOptions),
|
||||
["RSX: GPU/driver lacks support"] = new Regex(@"RSX: GPU/driver lacks support for (?<rsx_not_supported_feature>.+)\..+?\r?$", DefaultOptions),
|
||||
["RSX: Swapchain:"] = new Regex(@"RSX: Swapchain: present mode (?<rsx_swapchain_mode>\d+?) in use.+?\r?$", DefaultOptions),
|
||||
["F "] = new Regex(@"F \d+:\d+:\d+\.\d+ (({(?<fatal_error_context>[^}]+)} )?(\w+:\s*|(\w+:\s*)?(class [^\r\n]+ thrown: ))\r?\n?)(?<fatal_error>.*?)(\r?\n)(\r?\n|\xC2\xB7)", DefaultSingleLineOptions),
|
||||
["Failed to load RAP file:"] = new Regex(@"Failed to load RAP file: (?<rap_file>.*?\.rap).*\r?$", DefaultOptions),
|
||||
["Rap file not found:"] = new Regex(@"Rap file not found: (\xE2\x80\x9C)?(?<rap_file>.*?)(\xE2\x80\x9D)?\r?$", DefaultOptions),
|
||||
["Pad handler expected but none initialized"] = new Regex(@"(?<native_ui_input>Pad handler expected but none initialized).*?\r?$", DefaultOptions),
|
||||
["Failed to bind device"] = new Regex(@"Failed to bind device (?<failed_pad>.+) to handler (?<failed_pad_handler>.+).*\r?$", DefaultOptions),
|
||||
["Input:"] = new Regex(@"Input: (?<pad_handler>.*?) device .+ connected\r?$", DefaultOptions),
|
||||
["XAudio2Thread"] = new Regex(@"XAudio2Thread\s*: (?<xaudio_init_error>.+failed\s*\((?<xaudio_error_code>0x.+)\).*)\r?$", DefaultOptions),
|
||||
["cellAudio Thread"] = new Regex(@"XAudio2Backend\s*: (?<xaudio_init_error>.+failed\s*\((?<xaudio_error_code>0x.+)\).*)\r?$", DefaultOptions),
|
||||
["using a Null renderer instead"] = new Regex(@"Audio renderer (?<audio_backend_init_error>.+) could not be initialized\r?$", DefaultOptions),
|
||||
["PPU executable hash:"] = new Regex(@"PPU executable hash: PPU-(?<ppu_patch>\w+ \(<-\s*\d+\)).*?\r?$", DefaultOptions),
|
||||
["OVL executable hash:"] = new Regex(@"OVL executable hash: OVL-(?<ovl_patch>\w+ \(<-\s*\d+\)).*?\r?$", DefaultOptions),
|
||||
["SPU executable hash:"] = new Regex(@"SPU executable hash: SPU-(?<spu_patch>\w+ \(<-\s*\d+\)).*?\r?$", DefaultOptions),
|
||||
[": Applied patch"] = new Regex(@"Applied patch \(hash='(?:\w{3}-[0-9a-f]+)', description='(?<patch_desc>.+?)', author='(?:.+?)', patch_version='(?:.+?)', file_version='(?:.+?)'\) \(<- (?:[1-9]\d*)\).*\r?$", DefaultOptions),
|
||||
["Loaded SPU image:"] = new Regex(@"Loaded SPU image: SPU-(?<spu_patch>\w+ \(<-\s*\d+\)).*?\r?$", DefaultOptions),
|
||||
["'sys_fs_stat' failed"] = new Regex(@"'sys_fs_stat' failed (?!with 0x8001002c).+\xE2\x80\x9C(/dev_bdvd/(?<broken_filename_or_dir>.+)|/dev_hdd0/game/NP\w+/(?<broken_digital_filename>.+))\xE2\x80\x9D.*?\r?$", DefaultOptions),
|
||||
["'sys_fs_open' failed"] = new Regex(@"'sys_fs_open' failed (?!with 0x8001002c).+\xE2\x80\x9C(/dev_bdvd/(?<broken_filename>.+)|/dev_hdd0/game/NP\w+/(?<broken_digital_filename>.+))\xE2\x80\x9D.*?\r?$", DefaultOptions),
|
||||
["'sys_fs_opendir' failed"] = new Regex(@"'sys_fs_opendir' failed .+\xE2\x80\x9C/dev_bdvd/(?<broken_directory>.+)\xE2\x80\x9D.*?\r?$", DefaultOptions),
|
||||
["EDAT: "] = new Regex(@"EDAT: Block at offset (?<edat_block_offset>0x[0-9a-f]+) has invalid hash!.*?\r?$", DefaultOptions),
|
||||
["PS3 firmware is not installed"] = new Regex(@"(?<fw_missing_msg>PS3 firmware is not installed.+)\r?$", DefaultOptions),
|
||||
["do you have the PS3 firmware installed"] = new Regex(@"(?<fw_missing_something>do you have the PS3 firmware installed.*)\r?$", DefaultOptions),
|
||||
["Unimplemented syscall"] = new Regex(@"U \d+:\d+:\d+\.\d+ ({(?<unimplemented_syscall_context>.+?)} )?.*Unimplemented syscall (?<unimplemented_syscall>.*)\r?$", DefaultOptions),
|
||||
["Could not enqueue"] = new Regex(@"cellAudio: Could not enqueue buffer onto audio backend(?<enqueue_buffer_error>.).*\r?$", DefaultOptions),
|
||||
["{PPU["] = new Regex(@"{PPU\[.+\]} (?<log_channel>[^ :]+)( TODO)?: (?!\xE2\x80\x9C)(?<syscall_name>[^ :]+?)\(.*\r?$", DefaultOptions),
|
||||
["⁂"] = new Regex(@"\xE2\x81\x82 (?<syscall_name>[^ :\[]+?) .*\r?$", DefaultOptions),
|
||||
["undub"] = new Regex(@"(\b|_)(?<game_mod>(undub|translation patch))(\b|_)", DefaultOptions | RegexOptions.IgnoreCase),
|
||||
["LDR: Game:"] = new(@"Game: (?<ldr_game_full>.*(?<ldr_game>/dev_hdd0/game/(?<ldr_game_serial>[^/\r\n]+)).*|.*)\r?$", DefaultOptions),
|
||||
["LDR: Disc"] = new(@"Disc( path)?: (?<ldr_disc_full>.*(?<ldr_disc>/dev_hdd0/game/(?<ldr_disc_serial>[^/\r\n]+)).*|.*)\r?$", DefaultOptions),
|
||||
["LDR: Path:"] = new(@"Path: (?<ldr_path_full>.*(?<ldr_path>/dev_hdd0/game/(?<ldr_path_serial>[^/\r\n]+)).*|.*)\r?$", DefaultOptions),
|
||||
["LDR: Boot path:"] = new(@"Boot path: (?<ldr_boot_path_full>.*(?<ldr_boot_path>/dev_hdd0/game/(?<ldr_boot_path_serial>[^/\r\n]+)).*|.*)\r?$", DefaultOptions),
|
||||
["SYS: Game:"] = new(@"Game: (?<ldr_game_full>.*(?<ldr_game>/dev_hdd0/game/(?<ldr_game_serial>[^/\r\n]+)).*|.*)\r?$", DefaultOptions),
|
||||
["SYS: Path:"] = new(@"Path: (?<ldr_path_full>.*(?<ldr_path>/dev_hdd0/game/(?<ldr_path_serial>[^/\r\n]+)).*|.*)\r?$", DefaultOptions),
|
||||
["SYS: Boot path:"] = new(@"Boot path: (?<ldr_boot_path_full>.*(?<ldr_boot_path>/dev_hdd0/game/(?<ldr_boot_path_serial>[^/\r\n]+)).*|.*)\r?$", DefaultOptions),
|
||||
["Elf path:"] = new(@"Elf path: (?<host_root_in_boot>/host_root/)?(?<elf_boot_path_full>(?<elf_boot_path>/dev_hdd0/game/(?<elf_boot_path_serial>[^/\r\n]+)/USRDIR/EBOOT\.BIN|.*?))\r?$", DefaultOptions),
|
||||
["Invalid or unsupported file format:"] = new(@"Invalid or unsupported file format: (?<failed_to_boot>.*?)\r?$", DefaultOptions),
|
||||
["SELF:"] = new(@"(?<failed_to_decrypt>Failed to decrypt)? SELF: (?<failed_to_decrypt>Failed to (decrypt|load SELF))?.*\r?$", DefaultOptions),
|
||||
["SYS: Version:"] = new(@"Version: (APP_VER=)?(?<disc_app_version>\S+) (/ |VERSION=)(?<disc_package_version>\S+).*?\r?$", DefaultOptions),
|
||||
["sceNp: npDrmIsAvailable(): Failed to verify"] = new(@"Failed to verify (?<failed_to_verify>(sce|npd)) file.*\r?$", DefaultOptions),
|
||||
["{rsx::thread} RSX: 4"] = new(@"RSX:(\d|\.|\s|\w|-)* (?<driver_version>(\d+\.)*\d+)\r?\n[^\n]*?" +
|
||||
@"RSX: [^\n]+\r?\n[^\n]*?" +
|
||||
@"RSX: (?<driver_manuf>.*?)\r?\n[^\n]*?" +
|
||||
@"RSX: Supported texel buffer size", DefaultOptions),
|
||||
["GL RENDERER:"] = new(@"GL RENDERER: (?<driver_manuf_new>.*?)\r?$", DefaultOptions),
|
||||
["GL VERSION:"] = new(@"GL VERSION: (?<opengl_version>(\d|\.)+)(\d|\.|\s|\w|-)*?( (?<driver_version_new>(\d+\.)*\d+))?\r?$", DefaultOptions),
|
||||
["GLSL VERSION:"] = new(@"GLSL VERSION: (?<glsl_version>(\d|\.)+).*?\r?$", DefaultOptions),
|
||||
["texel buffer size reported:"] = new(@"RSX: Supported texel buffer size reported: (?<texel_buffer_size_new>\d*?) bytes", DefaultOptions),
|
||||
["Physical device in"] = new(@"Physical device ini?tialized\. GPU=(?<vulkan_gpu>.+), driver=(?<vulkan_driver_version_raw>-?\d+)\r?$", DefaultOptions),
|
||||
["Found vulkan-compatible GPU:"] = new(@"Found vulkan-compatible GPU: (?<vulkan_found_device>.+)\r?$", DefaultOptions),
|
||||
["Renderer initialized on device"] = new(@"Renderer initialized on device '(?<vulkan_initialized_device>.+)'\r?$", DefaultOptions),
|
||||
["RSX: Failed to compile shader"] = new(@"RSX: Failed to compile shader: ERROR: (?<shader_compile_error>.+?)\r?$", DefaultOptions),
|
||||
["RSX: Compilation failed"] = new(@"RSX: Compilation failed: ERROR: (?<shader_compile_error>.+?)\r?$", DefaultOptions),
|
||||
["RSX: Unsupported device"] = new(@"RSX: Unsupported device: (?<rsx_unsupported_gpu>.+)\..+?\r?$", DefaultOptions),
|
||||
["RSX: Your GPU does not support"] = new(@"RSX: Your GPU does not support (?<rsx_not_supported_feature>.+)\..+?\r?$", DefaultOptions),
|
||||
["RSX: GPU/driver lacks support"] = new(@"RSX: GPU/driver lacks support for (?<rsx_not_supported_feature>.+)\..+?\r?$", DefaultOptions),
|
||||
["RSX: Swapchain:"] = new(@"RSX: Swapchain: present mode (?<rsx_swapchain_mode>\d+?) in use.+?\r?$", DefaultOptions),
|
||||
["F "] = new(@"F \d+:\d+:\d+\.\d+ (({(?<fatal_error_context>[^}]+)} )?(\w+:\s*|(\w+:\s*)?(class [^\r\n]+ thrown: ))\r?\n?)(?<fatal_error>.*?)(\r?\n)(\r?\n|\xC2\xB7)", DefaultSingleLineOptions),
|
||||
["Failed to load RAP file:"] = new(@"Failed to load RAP file: (?<rap_file>.*?\.rap).*\r?$", DefaultOptions),
|
||||
["Rap file not found:"] = new(@"Rap file not found: (\xE2\x80\x9C)?(?<rap_file>.*?)(\xE2\x80\x9D)?\r?$", DefaultOptions),
|
||||
["Pad handler expected but none initialized"] = new(@"(?<native_ui_input>Pad handler expected but none initialized).*?\r?$", DefaultOptions),
|
||||
["Failed to bind device"] = new(@"Failed to bind device (?<failed_pad>.+) to handler (?<failed_pad_handler>.+).*\r?$", DefaultOptions),
|
||||
["Input:"] = new(@"Input: (?<pad_handler>.*?) device .+ connected\r?$", DefaultOptions),
|
||||
["XAudio2Thread"] = new(@"XAudio2Thread\s*: (?<xaudio_init_error>.+failed\s*\((?<xaudio_error_code>0x.+)\).*)\r?$", DefaultOptions),
|
||||
["cellAudio Thread"] = new(@"XAudio2Backend\s*: (?<xaudio_init_error>.+failed\s*\((?<xaudio_error_code>0x.+)\).*)\r?$", DefaultOptions),
|
||||
["using a Null renderer instead"] = new(@"Audio renderer (?<audio_backend_init_error>.+) could not be initialized\r?$", DefaultOptions),
|
||||
["PPU executable hash:"] = new(@"PPU executable hash: PPU-(?<ppu_patch>\w+ \(<-\s*\d+\)).*?\r?$", DefaultOptions),
|
||||
["OVL executable hash:"] = new(@"OVL executable hash: OVL-(?<ovl_patch>\w+ \(<-\s*\d+\)).*?\r?$", DefaultOptions),
|
||||
["SPU executable hash:"] = new(@"SPU executable hash: SPU-(?<spu_patch>\w+ \(<-\s*\d+\)).*?\r?$", DefaultOptions),
|
||||
[": Applied patch"] = new(@"Applied patch \(hash='(?:\w{3}-[0-9a-f]+)', description='(?<patch_desc>.+?)', author='(?:.+?)', patch_version='(?:.+?)', file_version='(?:.+?)'\) \(<- (?:[1-9]\d*)\).*\r?$", DefaultOptions),
|
||||
["Loaded SPU image:"] = new(@"Loaded SPU image: SPU-(?<spu_patch>\w+ \(<-\s*\d+\)).*?\r?$", DefaultOptions),
|
||||
["'sys_fs_stat' failed"] = new(@"'sys_fs_stat' failed (?!with 0x8001002c).+\xE2\x80\x9C(/dev_bdvd/(?<broken_filename_or_dir>.+)|/dev_hdd0/game/NP\w+/(?<broken_digital_filename>.+))\xE2\x80\x9D.*?\r?$", DefaultOptions),
|
||||
["'sys_fs_open' failed"] = new(@"'sys_fs_open' failed (?!with 0x8001002c).+\xE2\x80\x9C(/dev_bdvd/(?<broken_filename>.+)|/dev_hdd0/game/NP\w+/(?<broken_digital_filename>.+))\xE2\x80\x9D.*?\r?$", DefaultOptions),
|
||||
["'sys_fs_opendir' failed"] = new(@"'sys_fs_opendir' failed .+\xE2\x80\x9C/dev_bdvd/(?<broken_directory>.+)\xE2\x80\x9D.*?\r?$", DefaultOptions),
|
||||
["EDAT: "] = new(@"EDAT: Block at offset (?<edat_block_offset>0x[0-9a-f]+) has invalid hash!.*?\r?$", DefaultOptions),
|
||||
["PS3 firmware is not installed"] = new(@"(?<fw_missing_msg>PS3 firmware is not installed.+)\r?$", DefaultOptions),
|
||||
["do you have the PS3 firmware installed"] = new(@"(?<fw_missing_something>do you have the PS3 firmware installed.*)\r?$", DefaultOptions),
|
||||
["Unimplemented syscall"] = new(@"U \d+:\d+:\d+\.\d+ ({(?<unimplemented_syscall_context>.+?)} )?.*Unimplemented syscall (?<unimplemented_syscall>.*)\r?$", DefaultOptions),
|
||||
["Could not enqueue"] = new(@"cellAudio: Could not enqueue buffer onto audio backend(?<enqueue_buffer_error>.).*\r?$", DefaultOptions),
|
||||
["{PPU["] = new(@"{PPU\[.+\]} (?<log_channel>[^ :]+)( TODO)?: (?!\xE2\x80\x9C)(?<syscall_name>[^ :]+?)\(.*\r?$", DefaultOptions),
|
||||
["⁂"] = new(@"\xE2\x81\x82 (?<syscall_name>[^ :\[]+?) .*\r?$", DefaultOptions),
|
||||
["undub"] = new(@"(\b|_)(?<game_mod>(undub|translation patch))(\b|_)", DefaultOptions | RegexOptions.IgnoreCase),
|
||||
},
|
||||
OnSectionEnd = MarkAsCompleteAndReset,
|
||||
EndTrigger = new[] { "Stopping emulator...", "All threads stopped...", "LDR: Booting from"},
|
||||
}
|
||||
};
|
||||
|
||||
private static readonly HashSet<string> MultiValueItems = new HashSet<string>
|
||||
private static readonly HashSet<string> MultiValueItems = new()
|
||||
{
|
||||
"pad_handler",
|
||||
"fatal_error_context",
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace CompatBot.EventHandlers.LogParsing
|
||||
{
|
||||
private static readonly byte[] Bom = {0xEF, 0xBB, 0xBF};
|
||||
|
||||
private static readonly PoorMansTaskScheduler<LogParseState> TaskScheduler = new PoorMansTaskScheduler<LogParseState>();
|
||||
private static readonly PoorMansTaskScheduler<LogParseState> TaskScheduler = new();
|
||||
|
||||
public static async Task<LogParseState> ReadPipeAsync(PipeReader reader, CancellationToken cancellationToken)
|
||||
{
|
||||
|
||||
@@ -10,20 +10,20 @@ namespace CompatBot.EventHandlers.LogParsing.POCOs
|
||||
{
|
||||
public NameValueCollection? CompletedCollection;
|
||||
public NameUniqueObjectCollection<string>? CompleteMultiValueCollection;
|
||||
public NameValueCollection WipCollection = new NameValueCollection();
|
||||
public NameUniqueObjectCollection<string> WipMultiValueCollection = new NameUniqueObjectCollection<string>();
|
||||
public readonly Dictionary<string, int> ValueHitStats = new Dictionary<string, int>();
|
||||
public readonly Dictionary<string, HashSet<string>> Syscalls = new Dictionary<string, HashSet<string>>();
|
||||
public NameValueCollection WipCollection = new();
|
||||
public NameUniqueObjectCollection<string> WipMultiValueCollection = new();
|
||||
public readonly Dictionary<string, int> ValueHitStats = new();
|
||||
public readonly Dictionary<string, HashSet<string>> Syscalls = new();
|
||||
public int Id = 0;
|
||||
public ErrorCode Error = ErrorCode.None;
|
||||
public readonly Dictionary<int, (Piracystring filter, string context)> FilterTriggers = new Dictionary<int, (Piracystring filter, string context)>();
|
||||
public readonly Dictionary<int, (Piracystring filter, string context)> FilterTriggers = new();
|
||||
public Piracystring? SelectedFilter;
|
||||
public string? SelectedFilterContext;
|
||||
public long ReadBytes;
|
||||
public long TotalBytes;
|
||||
public TimeSpan ParsingTime;
|
||||
#if DEBUG
|
||||
public readonly Dictionary<string, (int count, long regexTime)> ExtractorHitStats = new Dictionary<string, (int, long)>();
|
||||
public readonly Dictionary<string, (int count, long regexTime)> ExtractorHitStats = new();
|
||||
#endif
|
||||
|
||||
public enum ErrorCode
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace CompatBot.EventHandlers.LogParsing.SourceHandlers
|
||||
internal sealed class DropboxHandler : BaseSourceHandler
|
||||
{
|
||||
//https://www.dropbox.com/s/62ls9lw5i52fuib/RPCS3.log.gz?dl=0
|
||||
private static readonly Regex ExternalLink = new Regex(@"(?<dropbox_link>(https?://)?(www\.)?dropbox\.com/s/(?<dropbox_id>[^/\s]+)/(?<filename>[^/\?\s])(/dl=[01])?)", DefaultOptions);
|
||||
private static readonly Regex ExternalLink = new(@"(?<dropbox_link>(https?://)?(www\.)?dropbox\.com/s/(?<dropbox_id>[^/\s]+)/(?<filename>[^/\?\s])(/dl=[01])?)", DefaultOptions);
|
||||
|
||||
public override async Task<(ISource? source, string? failReason)> FindHandlerAsync(DiscordMessage message, ICollection<IArchiveHandler> handlers)
|
||||
{
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace CompatBot.EventHandlers.LogParsing.SourceHandlers
|
||||
{
|
||||
internal sealed class GenericLinkHandler : BaseSourceHandler
|
||||
{
|
||||
private static readonly Regex ExternalLink = new Regex(@"(?<link>(https?://)?(github\.com/RPCS3/rpcs3|cdn\.discordapp\.com/attachments)/.*/(?<filename>[^/\?\s]+\.(gz|zip|rar|7z|log)))", DefaultOptions);
|
||||
private static readonly Regex ExternalLink = new(@"(?<link>(https?://)?(github\.com/RPCS3/rpcs3|cdn\.discordapp\.com/attachments)/.*/(?<filename>[^/\?\s]+\.(gz|zip|rar|7z|log)))", DefaultOptions);
|
||||
|
||||
public override async Task<(ISource? source, string? failReason)> FindHandlerAsync(DiscordMessage message, ICollection<IArchiveHandler> handlers)
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace CompatBot.EventHandlers.LogParsing.SourceHandlers
|
||||
{
|
||||
internal sealed class GoogleDriveHandler: BaseSourceHandler
|
||||
{
|
||||
private static readonly Regex ExternalLink = new Regex(@"(?<gdrive_link>(https?://)?drive\.google\.com/(open\?id=|file/d/)(?<gdrive_id>[^/>\s]+))", DefaultOptions);
|
||||
private static readonly Regex ExternalLink = new(@"(?<gdrive_link>(https?://)?drive\.google\.com/(open\?id=|file/d/)(?<gdrive_id>[^/>\s]+))", DefaultOptions);
|
||||
private static readonly string[] Scopes = { DriveService.Scope.DriveReadonly };
|
||||
private static readonly string ApplicationName = "RPCS3 Compatibility Bot 2.0";
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace CompatBot.EventHandlers.LogParsing.SourceHandlers
|
||||
{
|
||||
// mega.nz/#!8IJHBYyB!jw21m-GCs85uzj9E5XRysqyJCsNfZS0Zx4Eu9_zvuUM
|
||||
// mega.nz/file/8IJHBYyB#jw21m-GCs85uzj9E5XRysqyJCsNfZS0Zx4Eu9_zvuUM
|
||||
private static readonly Regex ExternalLink = new Regex(@"(?<mega_link>(https?://)?mega(\.co)?\.nz/(#(?<mega_id>[^/>\s]+)|file/(?<new_mega_id>[^/>\s]+)))", DefaultOptions);
|
||||
private static readonly Regex ExternalLink = new(@"(?<mega_link>(https?://)?mega(\.co)?\.nz/(#(?<mega_id>[^/>\s]+)|file/(?<new_mega_id>[^/>\s]+)))", DefaultOptions);
|
||||
private static readonly IProgress<double> doodad = new Progress<double>(_ => { });
|
||||
|
||||
public override async Task<(ISource? source, string? failReason)> FindHandlerAsync(DiscordMessage message, ICollection<IArchiveHandler> handlers)
|
||||
|
||||
@@ -18,8 +18,8 @@ namespace CompatBot.EventHandlers.LogParsing.SourceHandlers
|
||||
{
|
||||
internal sealed class OneDriveSourceHandler : BaseSourceHandler
|
||||
{
|
||||
private static readonly Regex ExternalLink = new Regex(@"(?<onedrive_link>(https?://)?(1drv\.ms|onedrive\.live\.com)/[^>\s]+)", DefaultOptions);
|
||||
private static readonly Client client = new Client();
|
||||
private static readonly Regex ExternalLink = new(@"(?<onedrive_link>(https?://)?(1drv\.ms|onedrive\.live\.com)/[^>\s]+)", DefaultOptions);
|
||||
private static readonly Client client = new();
|
||||
|
||||
public async override Task<(ISource? source, string? failReason)> FindHandlerAsync(DiscordMessage message, ICollection<IArchiveHandler> handlers)
|
||||
{
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace CompatBot.EventHandlers.LogParsing.SourceHandlers
|
||||
{
|
||||
internal sealed class PastebinHandler : BaseSourceHandler
|
||||
{
|
||||
private static readonly Regex ExternalLink = new Regex(@"(?<pastebin_link>(https?://)pastebin.com/(raw/)?(?<pastebin_id>[^/>\s]+))", DefaultOptions);
|
||||
private static readonly Regex ExternalLink = new(@"(?<pastebin_link>(https?://)pastebin.com/(raw/)?(?<pastebin_id>[^/>\s]+))", DefaultOptions);
|
||||
|
||||
public override async Task<(ISource? source, string? failReason)> FindHandlerAsync(DiscordMessage message, ICollection<IArchiveHandler> handlers)
|
||||
{
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace CompatBot.EventHandlers
|
||||
new PlainTextHandler(),
|
||||
};
|
||||
|
||||
private static readonly SemaphoreSlim QueueLimiter = new SemaphoreSlim(Math.Max(1, Environment.ProcessorCount / 2), Math.Max(1, Environment.ProcessorCount / 2));
|
||||
private static readonly SemaphoreSlim QueueLimiter = new(Math.Max(1, Environment.ProcessorCount / 2), Math.Max(1, Environment.ProcessorCount / 2));
|
||||
private delegate void OnLog(DiscordClient client, DiscordChannel channel, DiscordMessage message, DiscordMember? requester = null, bool checkExternalLinks = false, bool force = false);
|
||||
private static event OnLog OnNewLog;
|
||||
|
||||
|
||||
@@ -22,8 +22,8 @@ namespace CompatBot.EventHandlers
|
||||
internal sealed class MediaScreenshotMonitor
|
||||
{
|
||||
private readonly DiscordClient client;
|
||||
private readonly ComputerVisionClient cvClient = new ComputerVisionClient(new ApiKeyServiceClientCredentials(Config.AzureComputerVisionKey)) {Endpoint = Config.AzureComputerVisionEndpoint};
|
||||
private readonly SemaphoreSlim workSemaphore = new SemaphoreSlim(0);
|
||||
private readonly ComputerVisionClient cvClient = new(new ApiKeyServiceClientCredentials(Config.AzureComputerVisionKey)) {Endpoint = Config.AzureComputerVisionEndpoint};
|
||||
private readonly SemaphoreSlim workSemaphore = new(0);
|
||||
private readonly ConcurrentQueue<(MessageCreateEventArgs evt, Guid readOperationId)> workQueue = new ConcurrentQueue<(MessageCreateEventArgs args, Guid readOperationId)>();
|
||||
public static int MaxQueueLength { get; private set; } = 0;
|
||||
|
||||
|
||||
@@ -13,11 +13,11 @@ namespace CompatBot.EventHandlers
|
||||
{
|
||||
internal static class NewBuildsMonitor
|
||||
{
|
||||
private static readonly Regex BuildResult = new Regex(@"\[rpcs3:master\] \d+ new commit", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Singleline);
|
||||
private static readonly Regex BuildResult = new(@"\[rpcs3:master\] \d+ new commit", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Singleline);
|
||||
private static readonly TimeSpan PassiveCheckInterval = TimeSpan.FromMinutes(20);
|
||||
private static readonly TimeSpan ActiveCheckInterval = TimeSpan.FromSeconds(20);
|
||||
private static readonly TimeSpan ActiveCheckResetThreshold = TimeSpan.FromMinutes(10);
|
||||
private static readonly ConcurrentQueue<(DateTime start, DateTime end)> ExpectedNewBuildTimeFrames = new ConcurrentQueue<(DateTime start, DateTime end)>();
|
||||
private static readonly ConcurrentQueue<(DateTime start, DateTime end)> ExpectedNewBuildTimeFrames = new();
|
||||
|
||||
public static Task OnMessageCreated(DiscordClient _, MessageCreateEventArgs args)
|
||||
{
|
||||
|
||||
@@ -14,10 +14,10 @@ namespace CompatBot.EventHandlers
|
||||
internal static class PostLogHelpHandler
|
||||
{
|
||||
private const RegexOptions DefaultOptions = RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.ExplicitCapture;
|
||||
private static readonly Regex UploadLogMention = new Regex(@"\b((?<vulkan>(vul[ck][ae]n(-?1)?))|(?<help>(post|upload|send|give)(ing)?\s+((a|the|rpcs3('s)?|your|you're|ur|my|full|game)\s+)*\blogs?))\b", DefaultOptions);
|
||||
private static readonly SemaphoreSlim TheDoor = new SemaphoreSlim(1, 1);
|
||||
private static readonly Regex UploadLogMention = new(@"\b((?<vulkan>(vul[ck][ae]n(-?1)?))|(?<help>(post|upload|send|give)(ing)?\s+((a|the|rpcs3('s)?|your|you're|ur|my|full|game)\s+)*\blogs?))\b", DefaultOptions);
|
||||
private static readonly SemaphoreSlim TheDoor = new(1, 1);
|
||||
private static readonly TimeSpan ThrottlingThreshold = TimeSpan.FromSeconds(5);
|
||||
private static readonly Dictionary<string, Explanation> DefaultExplanation = new Dictionary<string, Explanation>
|
||||
private static readonly Dictionary<string, Explanation> DefaultExplanation = new()
|
||||
{
|
||||
["log"] = new Explanation { Text = "To upload log, run the game, then completely close RPCS3, then drag and drop rpcs3.log.gz from the RPCS3 folder into Discord. The file may have a zip or rar icon." },
|
||||
["vulkan-1"] = new Explanation { Text = "Please remove all the traces of video drivers using DDU, and then reinstall the latest driver version for your GPU." },
|
||||
|
||||
@@ -18,8 +18,8 @@ namespace CompatBot.EventHandlers
|
||||
internal static class ProductCodeLookup
|
||||
{
|
||||
// see http://www.psdevwiki.com/ps3/Productcode
|
||||
public static readonly Regex ProductCode = new Regex(@"(?<letters>(?:[BPSUVX][CL]|P[ETU]|NP)[AEHJKPUIX][ABJKLMPQRS]|MRTC)[ \-]?(?<numbers>\d{5})", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
private static readonly Client CompatClient = new Client();
|
||||
public static readonly Regex ProductCode = new(@"(?<letters>(?:[BPSUVX][CL]|P[ETU]|NP)[AEHJKPUIX][ABJKLMPQRS]|MRTC)[ \-]?(?<numbers>\d{5})", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
private static readonly Client CompatClient = new();
|
||||
|
||||
public static async Task OnMessageCreated(DiscordClient c, MessageCreateEventArgs args)
|
||||
{
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace CompatBot.EventHandlers
|
||||
{
|
||||
internal static class Starbucks
|
||||
{
|
||||
private static readonly Dictionary<DiscordEmoji, string> TextMap = new Dictionary<DiscordEmoji, string>
|
||||
private static readonly Dictionary<DiscordEmoji, string> TextMap = new()
|
||||
{
|
||||
[DiscordEmoji.FromUnicode("Ⓜ")] = "M",
|
||||
[DiscordEmoji.FromUnicode("🅰")] = "A",
|
||||
|
||||
@@ -16,9 +16,9 @@ namespace CompatBot.EventHandlers
|
||||
{
|
||||
internal static class UsernameSpoofMonitor
|
||||
{
|
||||
private static readonly Dictionary<string, string> UsernameMapping = new Dictionary<string, string>();
|
||||
private static readonly SemaphoreSlim UsernameLock = new SemaphoreSlim(1, 1);
|
||||
private static readonly MemoryCache SpoofingReportThrottlingCache = new MemoryCache(new MemoryCacheOptions{ ExpirationScanFrequency = TimeSpan.FromMinutes(10) });
|
||||
private static readonly Dictionary<string, string> UsernameMapping = new();
|
||||
private static readonly SemaphoreSlim UsernameLock = new(1, 1);
|
||||
private static readonly MemoryCache SpoofingReportThrottlingCache = new(new MemoryCacheOptions{ ExpirationScanFrequency = TimeSpan.FromMinutes(10) });
|
||||
private static readonly TimeSpan SnoozeDuration = TimeSpan.FromHours(1);
|
||||
|
||||
public static async Task OnUserUpdated(DiscordClient c, UserUpdateEventArgs args)
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace CompatBot.EventHandlers
|
||||
{
|
||||
public static class UsernameZalgoMonitor
|
||||
{
|
||||
private static readonly HashSet<char> OversizedChars = new HashSet<char>
|
||||
private static readonly HashSet<char> OversizedChars = new()
|
||||
{
|
||||
'꧁', '꧂', '⎝', '⎠', '⧹', '⧸', '⎛', '⎞',
|
||||
};
|
||||
|
||||
@@ -25,8 +25,8 @@ namespace CompatBot
|
||||
{
|
||||
internal static class Program
|
||||
{
|
||||
private static readonly SemaphoreSlim InstanceCheck = new SemaphoreSlim(0, 1);
|
||||
private static readonly SemaphoreSlim ShutdownCheck = new SemaphoreSlim(0, 1);
|
||||
private static readonly SemaphoreSlim InstanceCheck = new(0, 1);
|
||||
private static readonly SemaphoreSlim ShutdownCheck = new(0, 1);
|
||||
// pre-load the assembly so it won't fail after framework update while the process is still running
|
||||
private static readonly Assembly diagnosticsAssembly = Assembly.Load(typeof(Process).Assembly.GetName());
|
||||
internal const ulong InvalidChannelId = 13;
|
||||
|
||||
@@ -20,8 +20,8 @@ namespace CompatBot.ThumbScrapper
|
||||
internal static class GameTdbScraper
|
||||
{
|
||||
private static readonly HttpClient HttpClient = HttpClientFactory.Create(new CompressionMessageHandler());
|
||||
private static readonly Uri TitleDownloadLink = new Uri("https://www.gametdb.com/ps3tdb.zip?LANG=EN");
|
||||
private static readonly Regex CoverArtLink = new Regex(@"(?<cover_link>https?://art\.gametdb\.com/ps3/cover(?!full)[/\w\d]+\.jpg(\?\d+)?)", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Multiline | RegexOptions.ExplicitCapture);
|
||||
private static readonly Uri TitleDownloadLink = new("https://www.gametdb.com/ps3tdb.zip?LANG=EN");
|
||||
private static readonly Regex CoverArtLink = new(@"(?<cover_link>https?://art\.gametdb\.com/ps3/cover(?!full)[/\w\d]+\.jpg(\?\d+)?)", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Multiline | RegexOptions.ExplicitCapture);
|
||||
//private static readonly List<string> PreferredOrder = new List<string>{"coverHQ", "coverM", "cover"};
|
||||
|
||||
public static async Task RunAsync(CancellationToken cancellationToken)
|
||||
|
||||
@@ -16,12 +16,12 @@ namespace CompatBot.ThumbScrapper
|
||||
{
|
||||
internal sealed class PsnScraper
|
||||
{
|
||||
private static readonly PsnClient.Client Client = new PsnClient.Client();
|
||||
public static readonly Regex ContentIdMatcher = new Regex(@"(?<content_id>(?<service_id>(?<service_letters>\w\w)(?<service_number>\d{4}))-(?<product_id>(?<product_letters>\w{4})(?<product_number>\d{5}))_(?<part>\d\d)-(?<label>\w{16}))", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.ExplicitCapture);
|
||||
private static readonly SemaphoreSlim LockObj = new SemaphoreSlim(1, 1);
|
||||
private static List<string> PsnStores = new List<string>();
|
||||
private static readonly PsnClient.Client Client = new();
|
||||
public static readonly Regex ContentIdMatcher = new(@"(?<content_id>(?<service_id>(?<service_letters>\w\w)(?<service_number>\d{4}))-(?<product_id>(?<product_letters>\w{4})(?<product_number>\d{5}))_(?<part>\d\d)-(?<label>\w{16}))", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.ExplicitCapture);
|
||||
private static readonly SemaphoreSlim LockObj = new(1, 1);
|
||||
private static List<string> PsnStores = new();
|
||||
private static DateTime StoreRefreshTimestamp = DateTime.MinValue;
|
||||
private static readonly SemaphoreSlim QueueLimiter = new SemaphoreSlim(32, 32);
|
||||
private static readonly SemaphoreSlim QueueLimiter = new(32, 32);
|
||||
|
||||
public static async Task RunAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace CompatBot.Utils
|
||||
private readonly bool[] disabled;
|
||||
private readonly int[] maxWidth;
|
||||
private readonly int[] width;
|
||||
private readonly List<string[]> rows = new List<string[]>();
|
||||
private readonly List<string[]> rows = new();
|
||||
|
||||
public AsciiTable(params string[] columns)
|
||||
{
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace CompatBot.Utils
|
||||
private readonly byte[] writeBuf;
|
||||
private readonly byte[] readBuf;
|
||||
private int bufStart, bufLength;
|
||||
private readonly object sync = new object();
|
||||
private readonly object sync = new();
|
||||
private bool disposed;
|
||||
|
||||
public BufferCopyStream(Stream? baseStream, int bufferSize = 4096)
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace CompatBot.Utils.Extensions
|
||||
{
|
||||
internal static class AzureDevOpsClientExtensions
|
||||
{
|
||||
private static readonly MemoryCache BuildInfoCache = new MemoryCache(new MemoryCacheOptions { ExpirationScanFrequency = TimeSpan.FromHours(1) });
|
||||
private static readonly MemoryCache BuildInfoCache = new(new MemoryCacheOptions { ExpirationScanFrequency = TimeSpan.FromHours(1) });
|
||||
|
||||
public class BuildInfo
|
||||
{
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace CompatBot.Utils
|
||||
{
|
||||
public static class CommandContextExtensions
|
||||
{
|
||||
internal static readonly Regex MessageLinkRegex = new Regex(@"(?:https?://)?discord(app)?\.com/channels/(?<guild>\d+)/(?<channel>\d+)/(?<message>\d+)", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Singleline);
|
||||
internal static readonly Regex MessageLinkRegex = new(@"(?:https?://)?discord(app)?\.com/channels/(?<guild>\d+)/(?<channel>\d+)/(?<message>\d+)", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Singleline);
|
||||
|
||||
public static async Task<DiscordMember?> ResolveMemberAsync(this CommandContext ctx, string word)
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace CompatBot.Utils.Extensions
|
||||
{
|
||||
internal static class Converters
|
||||
{
|
||||
private static readonly ColorSpaceConverter colorSpaceConverter = new ColorSpaceConverter();
|
||||
private static readonly ColorSpaceConverter colorSpaceConverter = new();
|
||||
|
||||
public static Color ToStandardColor(this ColorThiefDotNet.Color c)
|
||||
=> new Rgba32(c.R, c.G, c.B, c.A);
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace CompatBot.Utils
|
||||
|
||||
public static DateTime AsUtc(this long ticks)
|
||||
{
|
||||
return new DateTime(ticks, DateTimeKind.Utc);
|
||||
return new(ticks, DateTimeKind.Utc);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace CompatBot.Utils.Extensions
|
||||
{
|
||||
internal static class FilterActionExtensions
|
||||
{
|
||||
private static readonly Dictionary<FilterAction, char> ActionFlags = new Dictionary<FilterAction, char>
|
||||
private static readonly Dictionary<FilterAction, char> ActionFlags = new()
|
||||
{
|
||||
[FilterAction.RemoveContent] = 'r',
|
||||
[FilterAction.IssueWarning] = 'w',
|
||||
|
||||
@@ -18,13 +18,13 @@ namespace CompatBot.Utils
|
||||
.GetEncoding()
|
||||
?? Encoding.ASCII;
|
||||
private static readonly Encoding Utf8 = new UTF8Encoding(false);
|
||||
private static readonly MemoryCache FuzzyPairCache = new MemoryCache(new MemoryCacheOptions {ExpirationScanFrequency = TimeSpan.FromMinutes(10)});
|
||||
private static readonly MemoryCache FuzzyPairCache = new(new MemoryCacheOptions {ExpirationScanFrequency = TimeSpan.FromMinutes(10)});
|
||||
private static readonly TimeSpan CacheTime = TimeSpan.FromMinutes(30);
|
||||
private const char StrikeThroughChar = '\u0336'; // 0x0335 = short dash, 0x0336 = long dash, 0x0337 = short slash, 0x0338 = long slash
|
||||
public const char InvisibleSpacer = '\u206a';
|
||||
public const char Nbsp = '\u00a0';
|
||||
|
||||
internal static readonly HashSet<char> SpaceCharacters = new HashSet<char>
|
||||
internal static readonly HashSet<char> SpaceCharacters = new()
|
||||
{
|
||||
'\u00a0',
|
||||
'\u2002', '\u2003', '\u2004', '\u2005', '\u2006',
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace CompatBot.Utils
|
||||
internal class FixedLengthBuffer<TKey, TValue>: IList<TValue>
|
||||
where TKey: notnull
|
||||
{
|
||||
internal readonly object syncObj = new object();
|
||||
internal readonly object syncObj = new();
|
||||
|
||||
public FixedLengthBuffer(Func<TValue, TKey> keyGenerator)
|
||||
{
|
||||
@@ -122,7 +122,7 @@ namespace CompatBot.Utils
|
||||
|
||||
private static int MaxLength => Config.ChannelMessageHistorySize;
|
||||
private readonly Func<TValue, TKey> makeKey;
|
||||
private readonly List<TKey> keyList = new List<TKey>();
|
||||
private readonly Dictionary<TKey, TValue> lookup = new Dictionary<TKey, TValue>();
|
||||
private readonly List<TKey> keyList = new();
|
||||
private readonly Dictionary<TKey, TValue> lookup = new();
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ namespace CompatBot.Utils
|
||||
where T: notnull
|
||||
{
|
||||
private readonly int queueLimit;
|
||||
private readonly ConcurrentDictionary<Task, T> taskQueue = new ConcurrentDictionary<Task, T>();
|
||||
private readonly ConcurrentDictionary<Task, T> taskQueue = new();
|
||||
public PoorMansTaskScheduler() : this(Math.Max(1, Environment.ProcessorCount / 2)) { }
|
||||
|
||||
public PoorMansTaskScheduler(int simultaneousTaskCountLimit)
|
||||
|
||||
@@ -11,9 +11,9 @@ namespace CompatBot.Utils.ResultFormatters
|
||||
internal static class FwInfoFormatter
|
||||
{
|
||||
//2019_0828_c975768e5d70e105a72656f498cc9be9/PS3UPDAT.PUP
|
||||
private static readonly Regex fwLinkInfo = new Regex(@"(?<year>\d{4})_(?<month>\d\d)(?<day>\d\d)_(?<md5>[0-9a-f]+)",
|
||||
private static readonly Regex fwLinkInfo = new(@"(?<year>\d{4})_(?<month>\d\d)(?<day>\d\d)_(?<md5>[0-9a-f]+)",
|
||||
RegexOptions.Compiled | RegexOptions.ExplicitCapture | RegexOptions.Singleline | RegexOptions.IgnoreCase);
|
||||
private static readonly Dictionary<string, string> RegionToFlagMap = new Dictionary<string, string>(StringComparer.InvariantCultureIgnoreCase)
|
||||
private static readonly Dictionary<string, string> RegionToFlagMap = new(StringComparer.InvariantCultureIgnoreCase)
|
||||
{
|
||||
["us"] = "🇺🇸",
|
||||
["eu"] = "🇪🇺",
|
||||
|
||||
@@ -16,8 +16,8 @@ namespace CompatBot.Utils.ResultFormatters
|
||||
{
|
||||
internal static partial class LogParserResult
|
||||
{
|
||||
private static readonly Version decompilerIssueStartVersion = new Version(0, 0, 9, 10307);
|
||||
private static readonly Version decompilerIssueEndVersion = new Version(0, 0, 10, 10346);
|
||||
private static readonly Version decompilerIssueStartVersion = new(0, 0, 9, 10307);
|
||||
private static readonly Version decompilerIssueEndVersion = new(0, 0, 10, 10346);
|
||||
|
||||
private static async Task BuildNotesSectionAsync(DiscordEmbedBuilder builder, LogParseState state, DiscordClient discordClient)
|
||||
{
|
||||
|
||||
@@ -484,7 +484,7 @@ namespace CompatBot.Utils.ResultFormatters
|
||||
PageSection(builder, notesContent.ToString().Trim(), "Important Settings to Review");
|
||||
}
|
||||
|
||||
private static readonly HashSet<string> P5Ids = new HashSet<string>
|
||||
private static readonly HashSet<string> P5Ids = new()
|
||||
{
|
||||
"BLES02247", "BLUS31604", "BLJM61346",
|
||||
"NPEB02436", "NPUB31848", "NPJB00769",
|
||||
@@ -565,13 +565,13 @@ namespace CompatBot.Utils.ResultFormatters
|
||||
}
|
||||
}
|
||||
|
||||
private static readonly HashSet<string> AllStarBattleIds = new HashSet<string>
|
||||
private static readonly HashSet<string> AllStarBattleIds = new()
|
||||
{
|
||||
"BLES01986", "BLUS31405", "BLJS10217",
|
||||
"NPEB01922", "NPUB31391", "NPJB00331",
|
||||
};
|
||||
|
||||
private static readonly HashSet<string> KnownJojoPatches = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase)
|
||||
private static readonly HashSet<string> KnownJojoPatches = new(StringComparer.InvariantCultureIgnoreCase)
|
||||
{
|
||||
"6875682ab309df32307c5305c43bb132c4e261fa",
|
||||
"18cf9a4e8196684ed9ee816f82649561fd1bf182",
|
||||
@@ -628,7 +628,7 @@ namespace CompatBot.Utils.ResultFormatters
|
||||
}
|
||||
}
|
||||
|
||||
private static readonly HashSet<string> KnownNierPatches = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase)
|
||||
private static readonly HashSet<string> KnownNierPatches = new(StringComparer.InvariantCultureIgnoreCase)
|
||||
{
|
||||
"13950b2e29e05a115fe317815d3da9d2b2baee65",
|
||||
"f098ee8410599c81c89f90d698340a078dc69a90",
|
||||
@@ -696,18 +696,18 @@ namespace CompatBot.Utils.ResultFormatters
|
||||
}
|
||||
}
|
||||
|
||||
private static readonly HashSet<string> Gow3Ids = new HashSet<string>
|
||||
private static readonly HashSet<string> Gow3Ids = new()
|
||||
{
|
||||
"BCAS25003", "BCES00510", "BCES00516", "BCES00799", "BCJS37001", "BCUS98111", "BCKS15003",
|
||||
};
|
||||
|
||||
private static readonly HashSet<string> GowHDIds = new HashSet<string>
|
||||
private static readonly HashSet<string> GowHDIds = new()
|
||||
{
|
||||
"BCAS20102", "BCES00791", "BCES00800", "BLJM60200", "BCUS98229", // collection except volume II
|
||||
"NPUA80491", "NPUA80490", "NPEA00255", "NPEA00256", "NPJA00062", "NPJA00061", "NPJA00066",
|
||||
};
|
||||
|
||||
private static readonly HashSet<string> GowAscIds = new HashSet<string>
|
||||
private static readonly HashSet<string> GowAscIds = new()
|
||||
{
|
||||
"BCAS25016", "BCES01741", "BCES01742", "BCUS98232",
|
||||
"NPEA00445", "NPEA90123", "NPUA70216", "NPUA70269", "NPUA80918",
|
||||
@@ -739,13 +739,13 @@ namespace CompatBot.Utils.ResultFormatters
|
||||
generalNotes.Add("ℹ This game is known to be very unstable");
|
||||
}
|
||||
|
||||
private static readonly HashSet<string> DesIds = new HashSet<string>
|
||||
private static readonly HashSet<string> DesIds = new()
|
||||
{
|
||||
"BLES00932", "BLUS30443", "BCJS30022", "BCJS70013",
|
||||
"NPEB01202", "NPUB30910", "NPJA00102",
|
||||
};
|
||||
|
||||
private static readonly HashSet<string> KnownDesPatches = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase)
|
||||
private static readonly HashSet<string> KnownDesPatches = new(StringComparer.InvariantCultureIgnoreCase)
|
||||
{
|
||||
"83681f6110d33442329073b72b8dc88a2f677172",
|
||||
"5446a2645880eefa75f7e374abd6b7818511e2ef",
|
||||
@@ -808,14 +808,14 @@ namespace CompatBot.Utils.ResultFormatters
|
||||
}
|
||||
}
|
||||
|
||||
private static readonly HashSet<string> Dod3Ids = new HashSet<string>
|
||||
private static readonly HashSet<string> Dod3Ids = new()
|
||||
{
|
||||
"BLUS31197", "NPUB31251",
|
||||
"NPEB01407",
|
||||
"BLJM61043", "BCAS20311",
|
||||
};
|
||||
|
||||
private static readonly HashSet<string> KnownDod3Patches = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase)
|
||||
private static readonly HashSet<string> KnownDod3Patches = new(StringComparer.InvariantCultureIgnoreCase)
|
||||
{
|
||||
"f2f7f7ea0444353884bb715152147c3a29f4e790",
|
||||
"2b393f064786e5895d5a576621deb4c9107a8f0b",
|
||||
@@ -858,7 +858,7 @@ namespace CompatBot.Utils.ResultFormatters
|
||||
}
|
||||
}
|
||||
|
||||
private static readonly HashSet<string> TlouIds = new HashSet<string>
|
||||
private static readonly HashSet<string> TlouIds = new()
|
||||
{
|
||||
"BCAS20270", "BCES01584", "BCES01585", "BCJS37010", "BCUS98174",
|
||||
"NPEA00435", "NPEA90122", "NPHA80243", "NPHA80279", "NPJA00096", "NPJA00129", "NPUA70257", "NPUA80960", "NPUA81175",
|
||||
@@ -912,7 +912,7 @@ namespace CompatBot.Utils.ResultFormatters
|
||||
}
|
||||
}
|
||||
|
||||
private static readonly HashSet<string> Killzone3Ids = new HashSet<string>
|
||||
private static readonly HashSet<string> Killzone3Ids = new()
|
||||
{
|
||||
"BCAS20157", "BCAS25008", "BCES01007", "BCJS30066", "BCJS37003", "BCJS70016", "BCJS75002", "BCUS98234",
|
||||
"NPEA00321", "NPEA90084", "NPEA90085", "NPEA90086", "NPHA80140", "NPJA90178", "NPUA70133",
|
||||
@@ -934,7 +934,7 @@ namespace CompatBot.Utils.ResultFormatters
|
||||
notes.Add("⚠ Please enable MLAA patch (recommended) or `Write Color Buffers`");
|
||||
}
|
||||
}
|
||||
private static readonly HashSet<string> RdrIds = new HashSet<string>
|
||||
private static readonly HashSet<string> RdrIds = new()
|
||||
{
|
||||
"BLAS50296", "BLES00680", "BLES01179", "BLES01294", "BLUS30418", "BLUS30711", "BLUS30758",
|
||||
"BLJM60314", "BLJM60403", "BLJM61181", "BLKS20315",
|
||||
@@ -951,7 +951,7 @@ namespace CompatBot.Utils.ResultFormatters
|
||||
notes.Add("ℹ `Write Color Buffers` is required for proper visuals at night");
|
||||
}
|
||||
|
||||
private static readonly HashSet<string> Mgs4Ids = new HashSet<string>
|
||||
private static readonly HashSet<string> Mgs4Ids = new()
|
||||
{
|
||||
"BLAS55005", "BLES00246", "BLJM57001", "BLJM67001", "BLKS25001", "BLUS30109", "BLUS30148",
|
||||
"NPEB00027", "NPEB02182", "NPEB90116", "NPJB00698", "NPJB90149", "NPUB31633",
|
||||
@@ -976,27 +976,27 @@ namespace CompatBot.Utils.ResultFormatters
|
||||
}
|
||||
}
|
||||
|
||||
private static readonly HashSet<string> PdfIds = new HashSet<string>
|
||||
private static readonly HashSet<string> PdfIds = new()
|
||||
{
|
||||
"BLJM60527", "BLUS31319", "BLAS50576",
|
||||
"NPEB01393", "NPUB31241", "NPHB00559", "NPJB00287"
|
||||
};
|
||||
|
||||
|
||||
private static readonly HashSet<string> KnownPdfPatches = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase)
|
||||
private static readonly HashSet<string> KnownPdfPatches = new(StringComparer.InvariantCultureIgnoreCase)
|
||||
{
|
||||
"f3227f57ec001582b253035fd90de77f05ead470",
|
||||
"c02e3b52e3d75f52f76fb8f0fb5be7ca4d921949",
|
||||
"1105af0a4d6a4a1481930c6f3090c476cde06c4c",
|
||||
};
|
||||
|
||||
private static readonly HashSet<string> Pdf2ndIds = new HashSet<string>
|
||||
private static readonly HashSet<string> Pdf2ndIds = new()
|
||||
{
|
||||
"BCAS50693", "BLAS50693", "BLES02029", "BLJM61079",
|
||||
"NPUB31488", "NPHB00671", "NPHB00662", "NPEB02013", "NPJB00435",
|
||||
};
|
||||
|
||||
private static readonly HashSet<string> KnownPdf2ndPatches = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase)
|
||||
private static readonly HashSet<string> KnownPdf2ndPatches = new(StringComparer.InvariantCultureIgnoreCase)
|
||||
{
|
||||
"092c43e2bcacccfe3cdc22b0ab8062b91d4e1cf9",
|
||||
"67e0e7c9b2a7a340c914a0d078e25aac1047e4d4",
|
||||
@@ -1024,7 +1024,7 @@ namespace CompatBot.Utils.ResultFormatters
|
||||
notes.Add("⚠ `Frame Limiter` should be `Off`");
|
||||
}
|
||||
|
||||
private static readonly HashSet<string> Gt5Ids = new HashSet<string>
|
||||
private static readonly HashSet<string> Gt5Ids = new()
|
||||
{
|
||||
"BCAS20108", "BCAS20151", "BCAS20154", "BCAS20164", "BCAS20229", "BCAS20267",
|
||||
"BCES00569",
|
||||
@@ -1043,7 +1043,7 @@ namespace CompatBot.Utils.ResultFormatters
|
||||
generalNotes.Add("ℹ Game versions between 1.05 and 1.10 can fail to boot with HDD space error");
|
||||
}
|
||||
|
||||
private static readonly HashSet<string> Gt6Ids = new HashSet<string>
|
||||
private static readonly HashSet<string> Gt6Ids = new()
|
||||
{
|
||||
"BCAS20519", "BCAS20520", "BCAS20521", "BCAS25018", "BCAS25019",
|
||||
"BCES01893", "BCES01905", "BCJS37016", "BCUS98296", "BCUS99247",
|
||||
@@ -1115,7 +1115,7 @@ namespace CompatBot.Utils.ResultFormatters
|
||||
}
|
||||
}
|
||||
|
||||
private static readonly HashSet<string> Sly4Ids = new HashSet<string>
|
||||
private static readonly HashSet<string> Sly4Ids = new()
|
||||
{
|
||||
"BCES01284", "BCUS98247", "BCUS99142",
|
||||
"NPEA00429", "NPUA80875",
|
||||
@@ -1137,7 +1137,7 @@ namespace CompatBot.Utils.ResultFormatters
|
||||
}
|
||||
}
|
||||
|
||||
private static readonly HashSet<string> DragonsCrownIds = new HashSet<string>
|
||||
private static readonly HashSet<string> DragonsCrownIds = new()
|
||||
{
|
||||
"BCAS20290", "BCAS20298", "BLES01950", "BLJM61041", "BLUS30767",
|
||||
"NPEB01836", "NPUB31235",
|
||||
@@ -1152,25 +1152,25 @@ namespace CompatBot.Utils.ResultFormatters
|
||||
notes.Add("⚠ Please disable `SPU Loop Detection` for this game");
|
||||
}
|
||||
|
||||
private static readonly HashSet<string> Lbp1Ids = new HashSet<string>
|
||||
private static readonly HashSet<string> Lbp1Ids = new()
|
||||
{
|
||||
"BCAS20058", "BCAS20078", "BCAS20091", "BCES00611", "BCES00141", "BCJS70009", "BCKS10059", "BCUS98148", "BCUS98199", "BCUS98208",
|
||||
"NPEA00241", "NPHA80093", "NPUA80472", "NPUA80479",
|
||||
};
|
||||
|
||||
private static readonly HashSet<string> Lbp2Ids = new HashSet<string>
|
||||
private static readonly HashSet<string> Lbp2Ids = new()
|
||||
{
|
||||
"BCAS20201", "BCES00850", "BCES01086", "BCES01345", "BCES01346", "BCES01693", "BCES01694", "BCJS70024", "BCUS90260", "BCUS98249", "BCUS98372",
|
||||
"NPEA00324", "NPHA80161", "NPUA80662",
|
||||
};
|
||||
|
||||
private static readonly HashSet<string> Lbp3Ids = new HashSet<string>
|
||||
private static readonly HashSet<string> Lbp3Ids = new()
|
||||
{
|
||||
"BCAS20322", "BCES01663", "BCES02068", "BCUS98245", "BCUS98362",
|
||||
"NPEA00515", "NPHA80277", "NPUA81116",
|
||||
};
|
||||
|
||||
private static readonly HashSet<string> AllLbpGames = new HashSet<string>(Lbp1Ids.Concat(Lbp2Ids).Concat(Lbp3Ids))
|
||||
private static readonly HashSet<string> AllLbpGames = new(Lbp1Ids.Concat(Lbp2Ids).Concat(Lbp3Ids))
|
||||
{
|
||||
"NPEA00147", "NPJA90074", "NPJA90097", "NPUA70045", // lbp1 demos and betas
|
||||
"NPUA70117", "NPHA80163", // lbp2 demo and beta
|
||||
|
||||
@@ -19,47 +19,47 @@ namespace CompatBot.Utils.ResultFormatters
|
||||
{
|
||||
internal static partial class LogParserResult
|
||||
{
|
||||
private static readonly Client compatClient = new Client();
|
||||
private static readonly IrdClient irdClient = new IrdClient();
|
||||
private static readonly PsnClient.Client psnClient = new PsnClient.Client();
|
||||
private static readonly Client compatClient = new();
|
||||
private static readonly IrdClient irdClient = new();
|
||||
private static readonly PsnClient.Client psnClient = new();
|
||||
|
||||
private static readonly RegexOptions DefaultSingleLine = RegexOptions.Compiled | RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase | RegexOptions.Singleline;
|
||||
// RPCS3 v0.0.3-3-3499d08 Alpha | HEAD
|
||||
// RPCS3 v0.0.4-6422-95c6ac699 Alpha | HEAD
|
||||
// RPCS3 v0.0.5-7104-a19113025 Alpha | HEAD
|
||||
// RPCS3 v0.0.5-42b4ce13a Alpha | minor
|
||||
private static readonly Regex BuildInfoInLog = new Regex(
|
||||
private static readonly Regex BuildInfoInLog = new(
|
||||
@"RPCS3 v(?<version_string>(?<version>(\d|\.)+)(-(?<build>\d+))?-(?<commit>[0-9a-f]+|unknown)) (?<stage>\w+)( \| (?<branch>[^|]+))?( \| Firmware version: (?<fw_version_installed>[^|\r\n]+)( \| (?<unknown>.*))?)?\r?$",
|
||||
DefaultSingleLine);
|
||||
private static readonly Regex CpuInfoInLog = new Regex(
|
||||
private static readonly Regex CpuInfoInLog = new(
|
||||
@"(?<cpu_model>[^|@]+?)\s*(((CPU\s*)?@\s*(?<cpu_speed>.+)\s*GHz\s*)|((APU|(with )?Radeon) [^|]+)|((\w+[\- ]Core )?Processor))?\s* \| (?<thread_count>\d+) Threads \| (?<memory_amount>[0-9\.\,]+) GiB RAM( \| TSC: (?<tsc>\S+))?( \| (?<cpu_extensions>.*?))?\r?$",
|
||||
DefaultSingleLine);
|
||||
internal static readonly Regex OsInfoInLog = new Regex(
|
||||
internal static readonly Regex OsInfoInLog = new(
|
||||
@"Operating system: (?<os_type>[^,]+), (Name: (?<posix_name>[^,]+), Release: (?<posix_release>[^,]+), Version: (?<posix_version>[^\r\n]+)|Major: (?<os_version_major>\d+), Minor: (?<os_version_minor>\d+), Build: (?<os_version_build>\d+), Service Pack: (?<os_service_pack>[^,]+), Compatibility mode: (?<os_compat_mode>[^,\r\n]+))\r?$",
|
||||
DefaultSingleLine);
|
||||
private static readonly Regex LinuxKernelVersion = new Regex(@"(?<version>\d+\.\d+\.\d+(-\d+)?)", DefaultSingleLine);
|
||||
private static readonly Regex ProgramHashPatch = new Regex(@"(?<hash>\w+) \(<-\s*(?<patch_count>\d+)\)", DefaultSingleLine);
|
||||
private static readonly Regex LinuxKernelVersion = new(@"(?<version>\d+\.\d+\.\d+(-\d+)?)", DefaultSingleLine);
|
||||
private static readonly Regex ProgramHashPatch = new(@"(?<hash>\w+) \(<-\s*(?<patch_count>\d+)\)", DefaultSingleLine);
|
||||
private static readonly char[] NewLineChars = {'\r', '\n'};
|
||||
|
||||
// rpcs3-v0.0.5-7105-064d0619_win64.7z
|
||||
// rpcs3-v0.0.5-7105-064d0619_linux64.AppImage
|
||||
private static readonly Regex BuildInfoInUpdate = new Regex(@"rpcs3-v(?<version>(\d|\.)+)(-(?<build>\d+))?-(?<commit>[0-9a-f]+)_", DefaultSingleLine);
|
||||
private static readonly Regex VulkanDeviceInfo = new Regex(@"'(?<device_name>.+)' running on driver (?<version>.+)\r?$", DefaultSingleLine);
|
||||
private static readonly Regex IntelGpuModel = new Regex(@"Intel\s?(®|\(R\))? (?<gpu_model>((?<gpu_family>(\w|®| )+) Graphics)( (?<gpu_model_number>P?\d+))?)(\s+\(|$)", DefaultSingleLine);
|
||||
private static readonly Regex InstallPath = new Regex(@"[A-Z]:/(?<program_files>Program Files( \(x86\))?/)?(?<desktop>([^/]+/)+Desktop/)?(?<rpcs3_folder>[^/]+/)*GuiConfigs/", DefaultSingleLine);
|
||||
private static readonly Regex BuildInfoInUpdate = new(@"rpcs3-v(?<version>(\d|\.)+)(-(?<build>\d+))?-(?<commit>[0-9a-f]+)_", DefaultSingleLine);
|
||||
private static readonly Regex VulkanDeviceInfo = new(@"'(?<device_name>.+)' running on driver (?<version>.+)\r?$", DefaultSingleLine);
|
||||
private static readonly Regex IntelGpuModel = new(@"Intel\s?(®|\(R\))? (?<gpu_model>((?<gpu_family>(\w|®| )+) Graphics)( (?<gpu_model_number>P?\d+))?)(\s+\(|$)", DefaultSingleLine);
|
||||
private static readonly Regex InstallPath = new(@"[A-Z]:/(?<program_files>Program Files( \(x86\))?/)?(?<desktop>([^/]+/)+Desktop/)?(?<rpcs3_folder>[^/]+/)*GuiConfigs/", DefaultSingleLine);
|
||||
|
||||
private static readonly Version MinimumOpenGLVersion = new Version(4, 3);
|
||||
private static readonly Version MinimumFirmwareVersion = new Version(4, 80);
|
||||
private static readonly Version NvidiaFullscreenBugMinVersion = new Version(400, 0);
|
||||
private static readonly Version NvidiaFullscreenBugMaxVersion = new Version(499, 99);
|
||||
private static readonly Version NvidiaRecommendedWindowsVersion = new Version(452, 28);
|
||||
private static readonly Version NvidiaRecommendedLinuxVersion = new Version(450, 56);
|
||||
private static readonly Version AmdRecommendedOldWindowsVersion = new Version(20, 1, 4);
|
||||
private static readonly Version AmdLastGoodOpenGLWindowsVersion = new Version(20, 1, 4);
|
||||
private static readonly Version NvidiaFullscreenBugFixed = new Version(0, 0, 6, 8204);
|
||||
private static readonly Version TsxFaFixedVersion = new Version(0, 0, 12, 10995);
|
||||
private static readonly Version MinimumOpenGLVersion = new(4, 3);
|
||||
private static readonly Version MinimumFirmwareVersion = new(4, 80);
|
||||
private static readonly Version NvidiaFullscreenBugMinVersion = new(400, 0);
|
||||
private static readonly Version NvidiaFullscreenBugMaxVersion = new(499, 99);
|
||||
private static readonly Version NvidiaRecommendedWindowsVersion = new(452, 28);
|
||||
private static readonly Version NvidiaRecommendedLinuxVersion = new(450, 56);
|
||||
private static readonly Version AmdRecommendedOldWindowsVersion = new(20, 1, 4);
|
||||
private static readonly Version AmdLastGoodOpenGLWindowsVersion = new(20, 1, 4);
|
||||
private static readonly Version NvidiaFullscreenBugFixed = new(0, 0, 6, 8204);
|
||||
private static readonly Version TsxFaFixedVersion = new(0, 0, 12, 10995);
|
||||
|
||||
private static readonly Dictionary<string, string> RsxPresentModeMap = new Dictionary<string, string>
|
||||
private static readonly Dictionary<string, string> RsxPresentModeMap = new()
|
||||
{
|
||||
["0"] = "VK_PRESENT_MODE_IMMEDIATE_KHR", // no vsync
|
||||
["1"] = "VK_PRESENT_MODE_MAILBOX_KHR", // fast sync
|
||||
@@ -67,7 +67,7 @@ namespace CompatBot.Utils.ResultFormatters
|
||||
["3"] = "VK_PRESENT_MODE_FIFO_RELAXED_KHR", // adaptive vsync
|
||||
};
|
||||
|
||||
private static readonly HashSet<string> KnownSyncFolders = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase)
|
||||
private static readonly HashSet<string> KnownSyncFolders = new(StringComparer.InvariantCultureIgnoreCase)
|
||||
{
|
||||
"OneDrive",
|
||||
"MEGASync",
|
||||
@@ -78,7 +78,7 @@ namespace CompatBot.Utils.ResultFormatters
|
||||
"Dropbox",
|
||||
};
|
||||
|
||||
private static readonly Dictionary<string, string> KnownDiscOnPsnIds = new Dictionary<string, string>(StringComparer.InvariantCultureIgnoreCase)
|
||||
private static readonly Dictionary<string, string> KnownDiscOnPsnIds = new(StringComparer.InvariantCultureIgnoreCase)
|
||||
{
|
||||
// Demon's Souls
|
||||
{"BLES00932", "NPEB01202"},
|
||||
@@ -101,13 +101,13 @@ namespace CompatBot.Utils.ResultFormatters
|
||||
"NPEB00303", "NPUB30242", "NPHB00229", // crazy taxi
|
||||
};
|
||||
|
||||
private static readonly HashSet<string> KnownNoApproximateXFloatIds = new HashSet<string>
|
||||
private static readonly HashSet<string> KnownNoApproximateXFloatIds = new()
|
||||
{
|
||||
"BLES02247", "BLUS31604", "BLJM61346", "NPEB02436", "NPUB31848", "NPJB00769", // p5
|
||||
"BLES00932", "BLUS30443", // DeS
|
||||
};
|
||||
|
||||
private static readonly HashSet<string> KnownFpsUnlockPatchIds = new HashSet<string>
|
||||
private static readonly HashSet<string> KnownFpsUnlockPatchIds = new()
|
||||
{
|
||||
"BLES00932", "BLUS30443", // DeS
|
||||
"BLUS30481", "BLES00826", "BLJM60223", // Nier
|
||||
@@ -116,7 +116,7 @@ namespace CompatBot.Utils.ResultFormatters
|
||||
"BLJS10318", // jojo eoh
|
||||
};
|
||||
|
||||
private static readonly HashSet<string> KnownWriteColorBuffersIds = new HashSet<string>
|
||||
private static readonly HashSet<string> KnownWriteColorBuffersIds = new()
|
||||
{
|
||||
"BLES00932", "BLUS30443", "BCJS70013", "BCJS30022", // DeS
|
||||
"BLUS30481", "BLES00826", "BLJM60223", // Nier
|
||||
@@ -139,13 +139,13 @@ namespace CompatBot.Utils.ResultFormatters
|
||||
|
||||
};
|
||||
|
||||
private static readonly HashSet<string> KnownResScaleThresholdIds = new HashSet<string>
|
||||
private static readonly HashSet<string> KnownResScaleThresholdIds = new()
|
||||
{
|
||||
"BCAS20270", "BCES01584", "BCES01585", "BCJS37010", "BCUS98174", // The Last of Us
|
||||
"NPEA00435", "NPEA90122", "NPHA80243", "NPHA80279", "NPJA00096", "NPJA00129", "NPUA70257", "NPUA80960", "NPUA81175",
|
||||
};
|
||||
|
||||
private static readonly HashSet<string> KnownMotionControlsIds = new HashSet<string>
|
||||
private static readonly HashSet<string> KnownMotionControlsIds = new()
|
||||
{
|
||||
"BCES00797", "BCES00802", "BCUS98164", "BCJS30040", "NPEA90053", "NPEA90076", "NPUA70088", "NPUA70112", // heavy rain
|
||||
"BCAS25017", "BCES01121", "BCES01122", "BCES01123", "BCUS98298", "NPEA00513", "NPUA81087", "NPEA90127", "NPJA90259", "NPUA72074", "NPJA00097", // beyond two souls
|
||||
@@ -155,13 +155,13 @@ namespace CompatBot.Utils.ResultFormatters
|
||||
"BCAS20112", "BCAS20189", "BCKS10112", "BLES01101", "BLJS10072", "BLJS10114", "BLJS50026", "BLUS30652", "NPEB90321", // no more heroes
|
||||
};
|
||||
|
||||
private static readonly HashSet<string> KnownGamesThatRequireInterpreter = new HashSet<string>
|
||||
private static readonly HashSet<string> KnownGamesThatRequireInterpreter = new()
|
||||
{
|
||||
"NPEB00630", "NPUB30493", "NPJB00161", // daytona usa
|
||||
"BCAS25017", "BCES01121", "BCES01122", "BCES01123", "BCUS98298", "NPEA00513", "NPUA81087", "NPEA90127", "NPJA90259", "NPUA72074", "NPJA00097", // beyond two souls
|
||||
};
|
||||
|
||||
private static readonly HashSet<string> KnownGamesThatRequireAccurateXfloat = new HashSet<string>
|
||||
private static readonly HashSet<string> KnownGamesThatRequireAccurateXfloat = new()
|
||||
{
|
||||
"BLES00229", "BLES00258", "BLES00887", "BLES01128", // gta4 + efls
|
||||
"BLJM55011", "BLJM60235", "BLJM60459", "BLJM60525", "BLJM61180", "BLKS20073", "BLKS20198", // gta4 + efls
|
||||
@@ -169,7 +169,7 @@ namespace CompatBot.Utils.ResultFormatters
|
||||
"NPEB00882", "NPUB30702", "NPUB30704", "NPEB00511", // gta4 + efls
|
||||
};
|
||||
|
||||
private static readonly HashSet<string> KnownGamesThatWorkWithRelaxedZcull = new HashSet<string>
|
||||
private static readonly HashSet<string> KnownGamesThatWorkWithRelaxedZcull = new()
|
||||
{
|
||||
"BLAS50296", "BLES00680", "BLES01179", "BLES01294", "BLUS30418", "BLUS30711", "BLUS30758", //rdr
|
||||
"BLJM60314", "BLJM60403", "BLJM61181", "BLKS20315",
|
||||
@@ -181,20 +181,20 @@ namespace CompatBot.Utils.ResultFormatters
|
||||
"BCAS20100", "BCES00664", "NPEA00057", "NPJA00031", "NPUA80105", // wipeout hd
|
||||
};
|
||||
|
||||
private static readonly HashSet<string> KnownBogusLicenses = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase)
|
||||
private static readonly HashSet<string> KnownBogusLicenses = new(StringComparer.InvariantCultureIgnoreCase)
|
||||
{
|
||||
"UP0700-NPUB30932_00-NNKDLFULLGAMEPTB.rap",
|
||||
"EP0700-NPEB01158_00-NNKDLFULLGAMEPTB.rap",
|
||||
};
|
||||
|
||||
private static readonly HashSet<string> KnownCustomLicenses = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase)
|
||||
private static readonly HashSet<string> KnownCustomLicenses = new(StringComparer.InvariantCultureIgnoreCase)
|
||||
{
|
||||
"EP4062-NPEB02436_00-PPERSONA5X000000.rap",
|
||||
"UP2611-NPUB31848_00-PPERSONA5X000000.rap",
|
||||
};
|
||||
|
||||
// v1.5 https://wiki.rpcs3.net/index.php?title=Help:Game_Patches#Disable_SPU_MLAA
|
||||
private static readonly HashSet<string> KnownMlaaSpuHashes = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase)
|
||||
private static readonly HashSet<string> KnownMlaaSpuHashes = new(StringComparer.InvariantCultureIgnoreCase)
|
||||
{
|
||||
"1549476fe258150ff9f902229ffaed69a932a9c1",
|
||||
"191fe1c92c8360992b3240348e70ea37d50812d4",
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace CompatBot.Utils.ResultFormatters
|
||||
{
|
||||
internal static class TitleInfoFormatter
|
||||
{
|
||||
private static readonly Dictionary<string, DiscordColor> StatusColors = new Dictionary<string, DiscordColor>(StringComparer.InvariantCultureIgnoreCase)
|
||||
private static readonly Dictionary<string, DiscordColor> StatusColors = new(StringComparer.InvariantCultureIgnoreCase)
|
||||
{
|
||||
{"Unknown", Config.Colors.CompatStatusUnknown},
|
||||
{"Nothing", Config.Colors.CompatStatusNothing},
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace CompatBot.Utils.ResultFormatters
|
||||
{
|
||||
internal static class UpdateInfoFormatter
|
||||
{
|
||||
private static readonly GithubClient.Client githubClient = new GithubClient.Client();
|
||||
private static readonly GithubClient.Client githubClient = new();
|
||||
|
||||
public static async Task<DiscordEmbedBuilder> AsEmbedAsync(this UpdateInfo? info, DiscordClient client, bool includePrBody = false, DiscordEmbedBuilder? builder = null, PrInfo? currentPrInfo = null)
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace CompatBot.Utils
|
||||
{
|
||||
public static readonly Dictionary<string, TimeZoneInfo> TimeZoneMap;
|
||||
|
||||
public static readonly Dictionary<string, string[]> TimeZoneAcronyms = new Dictionary<string, string[]>
|
||||
public static readonly Dictionary<string, string[]> TimeZoneAcronyms = new()
|
||||
{
|
||||
["PT"] = new[] { "Pacific Standard Time", "America/Los_Angeles" },
|
||||
["PST"] = new[] { "Pacific Standard Time", "America/Los_Angeles" },
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace CompatBot
|
||||
internal static class Watchdog
|
||||
{
|
||||
private static readonly TimeSpan CheckInterval = TimeSpan.FromSeconds(10);
|
||||
public static readonly ConcurrentQueue<DateTime> DisconnectTimestamps = new ConcurrentQueue<DateTime>();
|
||||
public static readonly ConcurrentQueue<DateTime> DisconnectTimestamps = new();
|
||||
public static readonly Stopwatch TimeSinceLastIncomingMessage = Stopwatch.StartNew();
|
||||
private static bool IsOk => DisconnectTimestamps.IsEmpty && TimeSinceLastIncomingMessage.Elapsed < Config.IncomingMessageCheckIntervalInMin;
|
||||
private static DiscordClient? discordClient = null;
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace HomoglyphConverter
|
||||
private static readonly Dictionary<uint, uint[]> Mapping = ConfusablesBuilder.Build();
|
||||
private static readonly Encoding Utf32 = new UTF32Encoding(false, false, true);
|
||||
|
||||
private static readonly Dictionary<string, string> HomoglyphSequences = new Dictionary<string, string>
|
||||
private static readonly Dictionary<string, string> HomoglyphSequences = new()
|
||||
{
|
||||
["rn"] = "m",
|
||||
["cl"] = "d",
|
||||
|
||||
Reference in New Issue
Block a user