From c390b57b0f5d9edc43b11cd4173d9288eefc291f Mon Sep 17 00:00:00 2001 From: Ottermandias Date: Fri, 29 Apr 2022 21:22:54 +0200 Subject: [PATCH] Force IsSync in certain situations. --- Penumbra/Interop/Loader/ResourceLoader.Replacement.cs | 9 +++++++-- Penumbra/Interop/Structs/FileMode.cs | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Penumbra/Interop/Loader/ResourceLoader.Replacement.cs b/Penumbra/Interop/Loader/ResourceLoader.Replacement.cs index 6aaccde5..8969e081 100644 --- a/Penumbra/Interop/Loader/ResourceLoader.Replacement.cs +++ b/Penumbra/Interop/Loader/ResourceLoader.Replacement.cs @@ -163,13 +163,18 @@ public unsafe partial class ResourceLoader var split = gamePath.Path.Split( ( byte )'|', 3, false ); fileDescriptor->ResourceHandle->FileNameData = split[ 2 ].Path; fileDescriptor->ResourceHandle->FileNameLength = split[ 2 ].Length; + + // Force isSync = true for these calls. I don't really understand why, + // or where the difference even comes from. + // Was called with True on my client and with false on other peoples clients, + // which caused problems. var funcFound = ResourceLoadCustomization.GetInvocationList() .Any( f => ( ( ResourceLoadCustomizationDelegate )f ) - .Invoke( split[ 1 ], split[ 2 ], resourceManager, fileDescriptor, priority, isSync, out ret ) ); + .Invoke( split[ 1 ], split[ 2 ], resourceManager, fileDescriptor, priority, true, out ret ) ); if( !funcFound ) { - ret = DefaultLoadResource( split[ 2 ], resourceManager, fileDescriptor, priority, isSync ); + ret = DefaultLoadResource( split[ 2 ], resourceManager, fileDescriptor, priority, true ); } // Return original resource handle path so that they can be loaded separately. diff --git a/Penumbra/Interop/Structs/FileMode.cs b/Penumbra/Interop/Structs/FileMode.cs index 13966e65..1c1914b2 100644 --- a/Penumbra/Interop/Structs/FileMode.cs +++ b/Penumbra/Interop/Structs/FileMode.cs @@ -1,6 +1,6 @@ namespace Penumbra.Interop.Structs; -public enum FileMode : uint +public enum FileMode : byte { LoadUnpackedResource = 0, LoadFileResource = 1, // The config files in MyGames use this.