Merge pull request #436 from 13xforever/vnext

Maintenance update
This commit is contained in:
Ilya 2019-10-24 20:11:29 +05:00 committed by GitHub
commit c8322be0f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 35 additions and 22 deletions

View File

@ -20,6 +20,7 @@ using DSharpPlus.Entities;
using DSharpPlus.Interactivity;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Caching.Memory;
using Newtonsoft.Json;
namespace CompatBot.Commands
{
@ -181,10 +182,13 @@ Example usage:
if (emptyBotMsg != null && info?.CurrentBuild != null)
info.LatestBuild = info.CurrentBuild;
var embed = await info.AsEmbedAsync().ConfigureAwait(false);
if (info == null || embed.Color == Config.Colors.Maintenance)
if (info == null || embed.Color.Value.Value == Config.Colors.Maintenance.Value)
{
if (emptyBotMsg != null)
{
Config.Log.Debug($"Failed to get update info for commit {sinceCommit}: {JsonConvert.SerializeObject(info)}");
return false;
}
embed = await CachedUpdateInfo.AsEmbedAsync().ConfigureAwait(false);
}
@ -194,7 +198,7 @@ Example usage:
await channel.SendMessageAsync(embed: embed.Build()).ConfigureAwait(false);
else if (emptyBotMsg != null)
{
if (embed.Color == Config.Colors.Maintenance)
if (embed.Title == "Error")
return false;
Config.Log.Debug($"Restoring update announcement for build {sinceCommit}: {embed.Title}\n{embed.Description}");

View File

@ -23,11 +23,11 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="DSharpPlus" Version="4.0.0-nightly-00625" />
<PackageReference Include="DSharpPlus.CommandsNext" Version="4.0.0-nightly-00625" />
<PackageReference Include="DSharpPlus.Interactivity" Version="4.0.0-nightly-00625" />
<PackageReference Include="DSharpPlus" Version="4.0.0-nightly-00628" />
<PackageReference Include="DSharpPlus.CommandsNext" Version="4.0.0-nightly-00628" />
<PackageReference Include="DSharpPlus.Interactivity" Version="4.0.0-nightly-00628" />
<PackageReference Include="DuoVia.FuzzyStrings" Version="2.0.1" />
<PackageReference Include="Google.Apis.Drive.v3" Version="1.41.1.1715" />
<PackageReference Include="Google.Apis.Drive.v3" Version="1.41.1.1734" />
<PackageReference Include="ksemenenko.ColorThief" Version="1.1.1.4" />
<PackageReference Include="MathParser.org-mXparser" Version="4.3.3" />
<PackageReference Include="MegaApiClient" Version="1.7.1" />
@ -40,10 +40,10 @@
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="3.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.9.5" />
<PackageReference Include="Nerdbank.Streams" Version="2.3.32" />
<PackageReference Include="Nerdbank.Streams" Version="2.4.37" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<PackageReference Include="NLog" Version="4.6.7" />
<PackageReference Include="NLog.Extensions.Logging" Version="1.5.4" />
<PackageReference Include="NLog.Extensions.Logging" Version="1.6.1" />
<PackageReference Include="NReco.Text.AhoCorasickDoubleArrayTrie" Version="1.0.2" />
<PackageReference Include="SharpCompress" Version="0.24.0" />
<PackageReference Include="System.Drawing.Common" Version="4.6.0" />

View File

@ -41,11 +41,11 @@ namespace CompatBot.EventHandlers
if (string.IsNullOrEmpty(content))
return;
if (Throttling.TryGetValue(args.Channel.Id, out object mark) && mark != null)
if (Throttling.TryGetValue(args.Channel.Id, out var mark) && mark != null)
return;
var similarList = queue.Where(msg => content.Equals(msg.Content, StringComparison.InvariantCultureIgnoreCase)).ToList();
if (similarList.Count > 2 && similarList.Select(msg => msg.Author.Id).Distinct().Count() > new Random().Next(2, 5))
if (similarList.Count > 2 && similarList.Select(msg => msg.Author.Id).Distinct().Count() > 2)
{
Throttling.Set(args.Channel.Id, similarList, ThrottleDuration);
var botMsg = await args.Channel.SendMessageAsync(content.ToLowerInvariant()).ConfigureAwait(false);

View File

@ -186,7 +186,7 @@ namespace CompatBot.EventHandlers.LogParsing
["PPU executable hash:"] = new Regex(@"PPU executable hash: PPU-(?<ppu_hash>\w+) \(<-\s*(?<ppu_hash_patch>\d+)\).*?\r?$", DefaultOptions),
["OVL executable hash:"] = new Regex(@"OVL executable hash: OVL-(?<ovl_hash>\w+) \(<-\s*(?<ovl_hash_patch>(?!0)\d+)\).*?\r?$", DefaultOptions),
["Loaded SPU image:"] = new Regex(@"Loaded SPU image: SPU-(?<spu_hash>\w+) \(<-\s*(?<spu_hash_patch>(?!0)\d+)\).*?\r?$", DefaultOptions),
["'sys_fs_open' failed"] = new Regex(@"'sys_fs_open' failed .+\xE2\x80\x9C/dev_bdvd/(?<broken_filename>.+)\xE2\x80\x9D.*?\r?$", DefaultOptions),
["'sys_fs_open' failed"] = new Regex(@"'sys_fs_open' failed .+\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),
["LDR: 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),
@ -215,6 +215,7 @@ namespace CompatBot.EventHandlers.LogParsing
"spu_hash",
"spu_hash_patch",
"broken_filename",
"broken_digital_filename",
"broken_directory",
"edat_block_offset",
"failed_to_verify",
@ -282,17 +283,13 @@ namespace CompatBot.EventHandlers.LogParsing
"vulkan_gpu", "vulkan_driver_version_raw",
"compat_database_path"
);
#if DEBUG
Console.WriteLine("===== cleared");
#endif
Config.Log.Trace("===== cleared");
}
private static void MarkAsComplete(LogParseState state)
{
state.CompleteCollection = state.WipCollection;
#if DEBUG
Console.WriteLine("----- complete section");
#endif
Config.Log.Trace("----- complete section");
}
private static void MarkAsCompleteAndReset(LogParseState state)

View File

@ -72,9 +72,9 @@ namespace CompatBot.Utils.ResultFormatters
if (Config.Colors.CompatStatusNothing.Equals(builder.Color.Value) || Config.Colors.CompatStatusLoadable.Equals(builder.Color.Value))
notes.Add("❌ This game doesn't work on the emulator yet");
if (items["failed_to_decrypt"] is string _)
if (items["failed_to_decrypt"] != null)
notes.Add("❌ Failed to decrypt game content, license file might be corrupted");
if (items["failed_to_boot"] is string _)
if (items["failed_to_boot"] != null)
notes.Add("❌ Failed to boot the game, the dump might be encrypted or corrupted");
if (items["failed_to_verify"] is string verifyFails)
{
@ -445,7 +445,7 @@ namespace CompatBot.Utils.ResultFormatters
notes.Add($"{prefix} This RPCS3 build is {timeDeltaStr}, please consider updating it");
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");
notes.Add($"😱 `{buildBranch}` build is obsolete, current master build offers at least the same level of performance and includes many additional improvements");
}
if (items["failed_pad"] is string failedPad)
@ -504,7 +504,15 @@ namespace CompatBot.Utils.ResultFormatters
return (false, false, defaultLongestPath);
if (!productCode.StartsWith("B") && !productCode.StartsWith("M"))
{
if (P5Ids.Contains(productCode) && items["broken_digital_filename"] is string brokenDigitalFiles)
{
var missingDigitalFiles = brokenDigitalFiles.Split(Environment.NewLine).Distinct().ToList();
if (missingDigitalFiles.Contains("USRDIR/ps3.cpk") || missingDigitalFiles.Contains("USRDIR/data.cpk"))
return (false, true, defaultLongestPath);
}
return (false, false, defaultLongestPath);
}
HashSet<string> knownFiles;
try

View File

@ -83,7 +83,7 @@ namespace CompatBot.Utils.ResultFormatters
CheckSimpsonsSettings(serial, generalNotes);
CheckNierSettings(serial, items, notes, ppuPatches, ppuHashes, generalNotes);
CheckDod3Settings(serial, items, notes, ppuPatches, ppuHashes, generalNotes);
CheckScottPilgrimSettings(serial, items, notes);
CheckScottPilgrimSettings(serial, items, notes, generalNotes);
CheckGoWSettings(serial, items, notes, generalNotes);
CheckDesSettings(serial, items, notes, ppuPatches, ppuHashes, generalNotes);
CheckTlouSettings(serial, items, notes);
@ -410,12 +410,16 @@ namespace CompatBot.Utils.ResultFormatters
}
}
private static void CheckScottPilgrimSettings(string serial, NameValueCollection items, List<string> notes)
private static void CheckScottPilgrimSettings(string serial, NameValueCollection items, List<string> notes, List<string> generalNotes)
{
if (serial == "NPEB00258" || serial == "NPUB30162" || serial == "NPJB00068")
{
if (items["resolution"] is string res && res != "1920x1080")
notes.Add("⚠ For perfect sprite scaling without borders set `Resolution` to `1920x1080`");
if (items["game_version"] is string gameVer
&& Version.TryParse(gameVer, out var v)
&& v < new Version(1, 03))
generalNotes.Add("⚠ Please update game to v1.03 if you experience visual issues");
}
}