Skip to content

Commit

Permalink
Merge pull request #426 from 13xforever/vnext
Browse files Browse the repository at this point in the history
Update checks for 60 fps patches
  • Loading branch information
13xforever authored Oct 11, 2019
2 parents 02308af + 081bfa5 commit 67439ed
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 8 deletions.
5 changes: 4 additions & 1 deletion CompatBot/EventHandlers/EmpathySimulationHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace CompatBot.EventHandlers
internal static class EmpathySimulationHandler
{
private static readonly TCache MessageQueue = new TCache();
private static readonly TimeSpan ThrottleDuration = TimeSpan.FromMinutes(30);
private static readonly TimeSpan ThrottleDuration = TimeSpan.FromDays(1);
private static readonly MemoryCache Throttling = new MemoryCache(new MemoryCacheOptions {ExpirationScanFrequency = TimeSpan.FromMinutes(30)});

public static async Task OnMessageCreated(MessageCreateEventArgs args)
Expand All @@ -29,6 +29,9 @@ public static async Task OnMessageCreated(MessageCreateEventArgs args)
if (args.Author.IsCurrent)
return;

if (args.Author.Id == 197163728867688448ul)
return;

if (!MessageQueue.TryGetValue(args.Channel.Id, out var queue))
MessageQueue[args.Channel.Id] = queue = new ConcurrentQueue<DiscordMessage>();
queue.Enqueue(args.Message);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ private static void BuildWeirdSettingsSection(DiscordEmbedBuilder builder, NameV
{
CheckP5Settings(serial, items, notes);
CheckAsurasWrathSettings(serial, items, notes);
CheckJojoSettings(serial, items, notes);
CheckJojoSettings(serial, items, notes, ppuPatches, ppuHashes);
CheckSimpsonsSettings(serial, notes);
CheckNierSettings(serial, items, notes, ppuPatches, ppuHashes);
CheckDod3Settings(serial, items, notes, ppuPatches, ppuHashes);
Expand Down Expand Up @@ -304,17 +304,41 @@ private static void CheckAsurasWrathSettings(string serial, NameValueCollection
"NPEB01922", "NPUB31391", "NPJB00331",
};

private static void CheckJojoSettings(string serial, NameValueCollection items, List<string> notes)
private static readonly HashSet<string> KnownJojoPatches = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase)
{
"6875682ab309df32307c5305c43bb132c4e261fa",
"18cf9a4e8196684ed9ee816f82649561fd1bf182",
};

private static void CheckJojoSettings(string serial, NameValueCollection items, List<string> notes, Dictionary<string, int> ppuPatches, HashSet<string> ppuHashes)
{
if (AllStarBattleIds.Contains(serial) || serial == "BLJS10318" || serial == "NPJB00753")
{
if (items["audio_buffering"] == EnabledMark && items["audio_buffer_duration"] != "20")
{
notes.Add("ℹ If you experience audio issues, set `Audio Buffer Duration` to `20ms`");
}
else if (items["audio_buffering"] == DisabledMark)
{
notes.Add("ℹ If you experience audio issues, check `Enable Buffering` and set `Audio Buffer Duration` to `20ms`");

if ((serial == "BLUS31405" || serial == "BLJS10318")
&& items["vblank_rate"] is string vbrStr
&& int.TryParse(vbrStr, out var vbr))
{
if (ppuPatches.Any())
{
if (vbr == 60)
notes.Add("ℹ `VBlank Rate` is not set; FPS is limited to 30");
else if (vbr == 120)
notes.Add("✅ Settings are set for the 60 FPS patch");
else
notes.Add($"⚠ Settings are configured for the {vbr / 2} FPS patch, which is unsupported");
}
else
{
if (vbr > 60)
notes.Add("ℹ Unlocking FPS requires game patch");
if (ppuHashes.Overlaps(KnownJojoPatches))
notes.Add("ℹ This game has an FPS unlock patch, see [Game Patches](https://github.com/RPCS3/rpcs3/wiki/Game-Patches)");
}
}
}
}
Expand Down Expand Up @@ -490,18 +514,28 @@ private static void CheckDesSettings(string serial, NameValueCollection items, L
}
}

private static readonly HashSet<string> Dod3Ids = new HashSet<string>
{
"BLUS31197", "NPUB31251",
"NPEB01407",
"BLJM61043", "BCAS20311",
};

private static readonly HashSet<string> KnownDod3Patches = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase)
{
"f2f7f7ea0444353884bb715152147c3a29f4e790",
"2b393f064786e5895d5a576621deb4c9107a8f0b",
"b18834a8f21cd29a091b287a66656a279ccba507",
"9c04f427625a0064282432e4edfefe9e0956c303",
"e1a44e5d3fb03a37f0445e92ed13abce8d6efdd4",
"a017576369165f3746730724c8ae762ed9bc64d8",
"c09c496514f6dc591434575b04eb7c003826c11d",
"5eb979631fbbe531db5d20f0622dca5a8b64090e",
};

private static void CheckDod3Settings(string serial, NameValueCollection items, List<string> notes, Dictionary<string, int> ppuPatches, HashSet<string> ppuHashes)
{
if (serial != "NPUB31251" && serial != "NPEB01407" && serial != "BLUS31197")
if (!Dod3Ids.Contains(serial))
return;

if (items["vblank_rate"] is string vbrStr
Expand Down
4 changes: 3 additions & 1 deletion CompatBot/Utils/ResultFormatters/LogParserResultFormatter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ internal static partial class LogParserResult
{
"BLES00932", "BLUS30443", // DeS
"BLUS30481", "BLES00826", "BLJM60223", // Nier
"BLUS31197", "NPUB31251", "NPEB01407", // DoD3
"BLUS31197", "NPUB31251", "NPEB01407", "BLJM61043", "BCAS20311", // DoD3
"BLUS31405", // jojo asb
"BLJS10318", // jojo eoh
};

private static readonly HashSet<string> KnownWriteColorBuffersIds = new HashSet<string>
Expand Down
13 changes: 13 additions & 0 deletions discord-bot-net.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/UserDictionary/Words/=blit/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=framerate/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=liblv/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=lwmutex/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Nier/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=recompiler/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=shaders/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=sprx/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=vblank/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=vsync/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=xfloat/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=zcull/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

0 comments on commit 67439ed

Please sign in to comment.