diff --git a/CompatBot/Commands/Explain.cs b/CompatBot/Commands/Explain.cs index 705935a7..f92cf321 100644 --- a/CompatBot/Commands/Explain.cs +++ b/CompatBot/Commands/Explain.cs @@ -25,7 +25,7 @@ namespace CompatBot.Commands await ctx.TriggerTypingAsync().ConfigureAwait(false); if (string.IsNullOrEmpty(term)) { - await ctx.RespondAsync($"You may want to look at available terms by using `{Config.CommandPrefix}explain list` in any spam channel or bot's DMs").ConfigureAwait(false); + await ctx.RespondAsync($"You may want to look at available terms by using `{Config.CommandPrefix}explain list` in a bot spam channel or bot DMs").ConfigureAwait(false); return; } @@ -66,7 +66,7 @@ namespace CompatBot.Commands } } - await ctx.RespondAsync($"Unknown term `{term.Sanitize()}`. Use `!explain list` to look at defined terms").ConfigureAwait(false); + await ctx.RespondAsync($"Unknown term `{term.Sanitize()}`. Use `!explain list` to look at defined terms in a bot spam channel or bot DMs").ConfigureAwait(false); } [Command("add"), RequiresBotModRole] diff --git a/CompatBot/EventHandlers/LogParsing/LogParser.LogSections.cs b/CompatBot/EventHandlers/LogParsing/LogParser.LogSections.cs index 466772d1..915ec9a0 100644 --- a/CompatBot/EventHandlers/LogParsing/LogParser.LogSections.cs +++ b/CompatBot/EventHandlers/LogParsing/LogParser.LogSections.cs @@ -64,7 +64,8 @@ namespace CompatBot.EventHandlers.LogParsing ["Accurate xfloat:"] = new Regex("Accurate xfloat: (?.*?)\r?$", DefaultOptions), ["Lib Loader:"] = new Regex("[Ll]oader: (?.*?)\r?$", DefaultOptions), ["Hook static functions:"] = new Regex("Hook static functions: (?.*?)\r?$", DefaultOptions), - ["Load libraries:"] = new Regex("libraries:(?.*?)$", DefaultSingleLineOptions), + ["Load libraries:"] = new Regex(@"libraries:\r?\n(?(.*?(- .*?|\[\])\r?\n)+)", DefaultOptions), + ["HLE lwmutex:"] = new Regex(@"HLE lwmutex: (?.*?)\r?$", DefaultOptions), }, EndTrigger = "VFS:", }, @@ -91,6 +92,7 @@ namespace CompatBot.EventHandlers.LogParsing ["Resolution Scale:"] = new Regex("Resolution Scale: (?.*?)\r?$", DefaultOptions), ["Anisotropic Filter"] = new Regex("Anisotropic Filter Override: (?.*?)\r?$", DefaultOptions), ["Scalable Dimension:"] = new Regex("Minimum Scalable Dimension: (?.*?)\r?$", DefaultOptions), + ["Driver Recovery Timeout:"] = new Regex("Driver Recovery Timeout: (?.*?)\r?$", DefaultOptions), ["12:"] = new Regex(@"(D3D12|DirectX 12):\s*\r?\n\s*Adapter: (?.*?)\r?$", DefaultOptions), ["Vulkan:"] = new Regex(@"Vulkan:\s*\r?\n\s*Adapter: (?.*?)\r?$", DefaultOptions), }, diff --git a/CompatBot/EventHandlers/ProductCodeLookup.cs b/CompatBot/EventHandlers/ProductCodeLookup.cs index 838742d8..13804f5c 100644 --- a/CompatBot/EventHandlers/ProductCodeLookup.cs +++ b/CompatBot/EventHandlers/ProductCodeLookup.cs @@ -18,7 +18,7 @@ namespace CompatBot.EventHandlers internal static class ProductCodeLookup { // see http://www.psdevwiki.com/ps3/Productcode - public static readonly Regex ProductCode = new Regex(@"(?(?:[BPSUVX][CL]|P[ETU]|NP)[AEHJKPUIX][ABSM])[ \-]?(?\d{5})", RegexOptions.Compiled | RegexOptions.IgnoreCase); + public static readonly Regex ProductCode = new Regex(@"(?(?:[BPSUVX][CL]|P[ETU]|NP)[AEHJKPUIX][ABSM]|MRTC)[ \-]?(?\d{5})", RegexOptions.Compiled | RegexOptions.IgnoreCase); private static readonly Client compatClient = new Client(); public static async Task OnMessageCreated(MessageCreateEventArgs args) diff --git a/CompatBot/ThumbScrapper/PsnScraper.cs b/CompatBot/ThumbScrapper/PsnScraper.cs index 376cc149..c86b742a 100644 --- a/CompatBot/ThumbScrapper/PsnScraper.cs +++ b/CompatBot/ThumbScrapper/PsnScraper.cs @@ -8,7 +8,6 @@ using System.Threading.Tasks; using CompatBot.Database; using CompatBot.Database.Providers; using CompatBot.EventHandlers; -using DSharpPlus; using DSharpPlus.CommandsNext; using PsnClient.POCOs; using PsnClient.Utils; diff --git a/CompatBot/Utils/EmbedPager.cs b/CompatBot/Utils/EmbedPager.cs index 5bf08999..ce6c3678 100644 --- a/CompatBot/Utils/EmbedPager.cs +++ b/CompatBot/Utils/EmbedPager.cs @@ -95,7 +95,7 @@ namespace CompatBot.Utils return first + last; if (first == last) - return first; + return first.Substring(0, 1); if (last.StartsWith(first)) return $"{first} - {last}"; diff --git a/CompatBot/Utils/ResultFormatters/LogParserResultFormatter.cs b/CompatBot/Utils/ResultFormatters/LogParserResultFormatter.cs index 2a9f8e4e..7943ee23 100644 --- a/CompatBot/Utils/ResultFormatters/LogParserResultFormatter.cs +++ b/CompatBot/Utils/ResultFormatters/LogParserResultFormatter.cs @@ -268,6 +268,17 @@ namespace CompatBot.Utils.ResultFormatters notes.AppendLine("`Force CPU Blit` is enabled, but `Write Color Buffers` is disabled"); if (items["zcull"] is string zcull && zcull == TrueMark) notes.AppendLine("`ZCull Occlusion Queries` are disabled, can result in visual artifacts"); + if (items["driver_recovery_timeout"] is string driverRecoveryTimeout && int.TryParse(driverRecoveryTimeout, out var drtValue) && drtValue != 1000000) + { + if (drtValue == 0) + notes.AppendLine("`Driver Recovery Timeout` is set to 0 (infinite), please use default value of 1000000"); + else if (drtValue < 10_000) + notes.AppendLine($"`Driver Recovery Timeout` is set too low: {GetTimeFormat(drtValue)} (1 frame @ {(1_000_000.0 / drtValue):0.##} fps)"); + else if (drtValue > 10_000_000) + notes.AppendLine($"`Driver Recovery Timeout` is set too high: {GetTimeFormat(drtValue)}"); + } + if (items["hle_lwmutex"] is string hleLwmutex && hleLwmutex == TrueMark) + notes.AppendLine("`HLE lwmutex` is enabled, might affect compatibility"); if (items["spu_block_size"] is string spuBlockSize && spuBlockSize == "Giga") notes.AppendLine("`Giga` mode for `SPU Block Size` is strongly not recommended to use"); @@ -445,5 +456,14 @@ namespace CompatBot.Utils.ResultFormatters return $"{major}.{minor}.{patch}"; } } + + private static string GetTimeFormat(long microseconds) + { + if (microseconds < 1000) + return $"{microseconds} µs"; + if (microseconds < 1_000_000) + return $"{microseconds / 1000.0:0.##} ms"; + return $"{microseconds / 1_000_000.0:0.##} s"; + } } }