Merge branch 'vnext'

This commit is contained in:
13xforever
2025-07-28 22:33:25 +05:00
6 changed files with 92 additions and 3 deletions

View File

@@ -239,6 +239,9 @@ internal partial class LogParser
["undub"] = UndubFlag(),
["Input: Pad"] = InputDeviceGamepad(),
["SDL: Found game controller"] = SdlControllerName(),
["SYS: Failed to remove save data"] = FailedToRemoveSaveData(),
["Trophy: Failed to remove"] = FailedToRemoveTrophy(),
["Failed to install trophy"] = FailedToInstallTrophy(),
},
OnSectionEnd = MarkAsCompleteAndReset,
EndTrigger = ["Stopping emulator...", "All threads stopped...", "LDR: Booting from"],
@@ -273,6 +276,8 @@ internal partial class LogParser
"verification_error_hex",
"verification_error",
"tty_line",
"bad_save_data_path",
"bad_trophy_data_path",
];
private static readonly string[] CountValueItems = ["enqueue_buffer_error"];

View File

@@ -353,4 +353,10 @@ internal partial class LogParser
private static partial Regex InputDeviceGamepad();
[GeneratedRegex(@"Found game controller \d: .+ has_accel=(?<pad_has_accel>.+?), has_gyro=(?<pad_has_gyro>[^\r\n]+?)\r?$", DefaultOptions)]
private static partial Regex SdlControllerName();
[GeneratedRegex(@"Failed to remove save data.+: .+(?<bad_save_data_path>/dev_hdd0/.+) \(.+\)\r?$", DefaultOptions)]
private static partial Regex FailedToRemoveSaveData();
[GeneratedRegex(@"Failed to remove.+ '.+(?<bad_trophy_data_path>/dev_hdd0/.+)' \(.+\)\r?$", DefaultOptions)]
private static partial Regex FailedToRemoveTrophy();
[GeneratedRegex(@"Failed to install .+ '.*(?<bad_trophy_data_path>/dev_hdd0/.+)' \(.+\)\r?$", DefaultOptions)]
private static partial Regex FailedToInstallTrophy();
}

View File

@@ -100,15 +100,24 @@ internal static class Program
}
}
#if DEBUG
Config.Log.Debug("Upgrading databases…");
#endif
if (!await DbImporter.UpgradeAsync(Config.Cts.Token).ConfigureAwait(false))
return;
#if DEBUG
Config.Log.Debug("Restoring configuration and stats…");
#endif
await SqlConfiguration.RestoreAsync().ConfigureAwait(false);
Config.Log.Debug("Restored configuration variables from persistent storage");
await StatsStorage.RestoreAsync().ConfigureAwait(false);
Config.Log.Debug("Restored stats from persistent storage");
#if DEBUG
Config.Log.Debug("Starting background tasks…");
#endif
var backgroundTasks = Task.WhenAll(
AmdDriverVersionProvider.RefreshAsync(),
#if !DEBUG
@@ -125,6 +134,9 @@ internal static class Program
OcrProvider.InitializeAsync(Config.Cts.Token)
);
#if DEBUG
Config.Log.Debug("Checking IRD cache folder…");
#endif
try
{
if (!Directory.Exists(Config.IrdCachePath))
@@ -135,6 +147,9 @@ internal static class Program
Config.Log.Warn(e, $"Failed to create new folder {Config.IrdCachePath}: {e.Message}");
}
#if DEBUG
Config.Log.Debug("Configuring Discord client…");
#endif
var clientInfoLogged = false;
var mediaScreenshotMonitor = new MediaScreenshotMonitor();
var clientBuilder = DiscordClientBuilder
@@ -308,6 +323,7 @@ internal static class Program
try
{
Config.Log.Debug("Connecting…");
await client.ConnectAsync().ConfigureAwait(false);
}
catch (Exception e)
@@ -316,6 +332,9 @@ internal static class Program
throw;
}
#if DEBUG
Config.Log.Info("Checking restart state…");
#endif
ulong? channelId = null;
string? restartMsg = null;
await using (var wdb = await BotDb.OpenWriteAsync().ConfigureAwait(false))

View File

@@ -33,6 +33,7 @@ internal static partial class LogParserResult
items["build_full_version"] = $"{items["build_version"]}.{items["build_number"]}";
items["build_commit"] = buildInfo.Groups["commit"].Value.Trim();
items["build_branch"] = buildInfo.Groups["branch"].Value.Trim();
items["build_unknown"] = buildInfo.Groups["unknown"].Value.Trim();
var fwVersion = buildInfo.Groups["fw_version_installed"].Value;
if (!string.IsNullOrEmpty(fwVersion))
items["fw_version_installed"] = fwVersion;

View File

@@ -176,7 +176,11 @@ internal static partial class LogParserResult
}
var pathSegments = PathUtils.GetSegments(compatDbPath);
var syncFolder = pathSegments.FirstOrDefault(s => KnownSyncFolders.Contains(s) || s.EndsWith("sync", StringComparison.OrdinalIgnoreCase));
var syncFolder = pathSegments.FirstOrDefault(
s => KnownSyncFolders.Contains(s)
|| s.EndsWith("sync", StringComparison.OrdinalIgnoreCase)
|| s.StartsWith("OneDrive - ") // corporate
);
if (!string.IsNullOrEmpty(syncFolder))
notes.Add($"⚠️ RPCS3 is installed in a file sync service folder `{syncFolder}`; may result in data loss or inconsistent state");
var rar = pathSegments.FirstOrDefault(s => s.StartsWith("Rar$"));
@@ -438,6 +442,7 @@ internal static partial class LogParserResult
var updateInfo = await CheckForUpdateAsync(items).ConfigureAwait(false);
var buildBranch = items["build_branch"]?.ToLowerInvariant();
if (updateInfo is not null
&& items["build_unknown"] is not {Length: >0}
&& (buildBranch is "master" or "head" or "spu_perf"
|| buildBranch is not {Length: >0}
&& (updateInfo.X64?.CurrentBuild is not null || updateInfo.Arm?.CurrentBuild is not null)))
@@ -465,6 +470,15 @@ internal static partial class LogParserResult
if (buildBranch == "spu_perf")
notes.Add($"😱 `{buildBranch}` build is obsolete, current master build offers at least the same level of performance and includes many additional improvements");
}
else if (items["build_unknown"] is "local_build")
{
if (items["build_commit"] is { Length: > 0 } commit && commit.Contains("AUR"))
notes.Add("❌ Unofficial AUR builds are not supported");
else if (items["build_number"] is "1" && items["os_type"] is "Linux")
notes.Add("❌ Flatpak builds are not supported");
else
notes.Add("❌ Unofficial builds are not supported");
}
if (DesIds.Contains(serial))
notes.Add(" If you experience infinite load screen, clear game cache via `File` → `All games` → `Remove Disk Cache`");
@@ -632,6 +646,50 @@ internal static partial class LogParserResult
notes.Add("⚠️ PPU desync detected, most likely cause is corrupted save data");
}*/
}
else
{
if (multiItems["bad_save_data_path"] is { Length: > 0 } badSavePaths)
{
if (badSavePaths is [string singlePath])
notes.Add($"❌ Corrupted save data `{singlePath}`");
else
{
var section = new StringBuilder("```");
foreach (var path in badSavePaths)
section.AppendLine(path);
if (section.Length + 3 > EmbedPager.MaxFieldLength)
{
section.Length = EmbedPager.MaxFieldLength - 4;
section.Append("…```");
}
builder.AddField(
$"Corrupted save data (x{badSavePaths.Length})",
section.ToString()
);
}
}
if (multiItems["bad_trophy_data_path"] is { Length: > 0 } badTrophyPaths)
{
if (badTrophyPaths is [string singlePath])
notes.Add($"❌ Corrupted trophy data `{singlePath}`");
else
{
var section = new StringBuilder("```");
foreach (var path in badTrophyPaths)
section.AppendLine(path);
if (section.Length + 3 > EmbedPager.MaxFieldLength)
{
section.Length = EmbedPager.MaxFieldLength - 4;
section.Append("…```");
}
builder.AddField(
$"Corrupted trophy data (x{badTrophyPaths.Length})",
section.ToString()
);
}
}
}
if (items["os_type"] == "Windows")
foreach (var code in win32ErrorCodes)
{

View File

@@ -24,7 +24,7 @@ internal static partial class LogParserResult
// RPCS3 v0.0.5-7104-a19113025 Alpha | HEAD
// RPCS3 v0.0.5-42b4ce13a Alpha | minor
// RPCS3 v0.0.18-local_build Alpha | local_build
[GeneratedRegex(@"RPCS3 v(?<version_string>(?<version>(\d|\.)+)(-(?<build>\d+))?-(?<commit>[0-9a-z_]+|unknown))( (?<stage>\w+))?( \| (?<branch>[^|\r\n]+))?( \| Firmware version: (?<fw_version_installed>[^|\r\n]+))?( \| (?<unknown>.*))?\r?$", DefaultSingleLine)]
[GeneratedRegex(@"RPCS3 v(?<version_string>(?<version>(\d|\.)+)(-(?<build>(\d|\.)+))?-(?<commit>([0-9a-z_]+|unknown)( \S+)??))( (?<stage>\w+))?( \| (?<branch>[^|\r\n]+))?( \| Firmware version: (?<fw_version_installed>[^|\r\n]+))?( \| (?<unknown>.*))?\r?$", DefaultSingleLine)]
private static partial Regex BuildInfoInLog();
[GeneratedRegex(@"(\d{1,2}(th|rd|nd|st) Gen)?(?<cpu_model>[^|@]+?)\s*(((CPU\s*)?@\s*(?<cpu_speed>.+)\s*GHz\s*)|((APU with|((with|w/) )?Radeon|R\d, \d+ Compute) [^|]+)|((\w+[\- ]Core )?Processor))?\s* \| (?<thread_count>\d+) Threads \| (?<memory_amount>[0-9\.\,]+) GiB RAM( \| TSC: (?<tsc>\S+))?( \| (?<cpu_extensions>.*?))?\r?$", DefaultSingleLine)]
private static partial Regex CpuInfoInLog();
@@ -788,7 +788,7 @@ internal static partial class LogParserResult
var link = updateInfo.X64?.LatestBuild.Windows?.Download
?? updateInfo.X64?.LatestBuild.Linux?.Download
?? updateInfo.X64?.LatestBuild.Mac?.Download
??updateInfo.Arm?.LatestBuild.Windows?.Download
?? updateInfo.Arm?.LatestBuild.Windows?.Download
?? updateInfo.Arm?.LatestBuild.Linux?.Download
?? updateInfo.Arm?.LatestBuild.Mac?.Download;
if (updateInfo.ReturnCode is not StatusCode.UpdatesAvailable || link is null)