Small debugging changes.

This commit is contained in:
Ottermandias 2022-03-26 14:59:21 +01:00
parent 9f6729dd0b
commit 2877e9f22f
5 changed files with 12 additions and 15 deletions

View file

@ -1,7 +1,6 @@
using System;
using System.IO;
using Dalamud.Utility;
using Microsoft.VisualBasic.CompilerServices;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;

View file

@ -150,7 +150,6 @@ public unsafe partial class ResourceLoader
return ReadSqPackHook.Original( resourceManager, fileDescriptor, priority, isSync );
}
byte ret = 0;
// Paths starting with a '|' are handled separately to allow for special treatment.
// They are expected to also have a closing '|'.
if( ResourceLoadCustomization == null || gamePath.Path[ 0 ] != ( byte )'|' )
@ -160,7 +159,8 @@ public unsafe partial class ResourceLoader
// Split the path into the special-treatment part (between the first and second '|')
// and the actual path.
var split = gamePath.Path.Split( ( byte )'|', 3, false );
byte ret = 0;
var split = gamePath.Path.Split( ( byte )'|', 3, false );
fileDescriptor->ResourceHandle->FileNameData = split[ 2 ].Path;
fileDescriptor->ResourceHandle->FileNameLength = split[ 2 ].Length;
var funcFound = ResourceLoadCustomization.GetInvocationList()

View file

@ -1,5 +1,6 @@
using System;
using Dalamud.Hooking;
using Dalamud.Logging;
using Dalamud.Utility.Signatures;
using FFXIVClientStructs.FFXIV.Client.System.Resource;
using Penumbra.GameData.ByteString;
@ -79,8 +80,14 @@ public unsafe partial class PathResolver
if( Penumbra.CollectionManager.ByName( split.ToString(), out var collection ) )
{
PluginLog.Verbose( "Using MtrlLoadHandler with collection {$Split:l} for path {$Path:l}.", split, path );
SetCollection( path, collection );
}
else
{
PluginLog.Verbose( "Using MtrlLoadHandler with no collection for path {$Path:l}.", path );
}
ret = Penumbra.ResourceLoader.DefaultLoadResource( path, resourceManager, fileDescriptor, priority, isSync );
PathCollections.TryRemove( path, out _ );

View file

@ -132,6 +132,7 @@ public partial class MetaManager
return false;
}
PluginLog.Verbose( "Using ImcLoadHandler for path {$Path:l}.", path );
ret = Penumbra.ResourceLoader.ReadSqPackHook.Original( resourceManager, fileDescriptor, priority, isSync );
if( Penumbra.CollectionManager.ByName( split.ToString(), out var collection )
&& collection.Cache != null

View file

@ -1,21 +1,9 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Reflection;
using System.Runtime.InteropServices;
using Dalamud.Game.ClientState.Objects.Types;
using Dalamud.Interface;
using ImGuiNET;
using Lumina.Excel.GeneratedSheets;
using Penumbra.Api;
using Penumbra.GameData.Enums;
using Penumbra.GameData.Structs;
using Penumbra.Interop;
using Penumbra.Interop.Structs;
using Penumbra.Meta.Files;
using Penumbra.Meta.Manipulations;
using Penumbra.UI.Custom;
using CharacterUtility = Penumbra.Interop.CharacterUtility;
using ResourceHandle = Penumbra.Interop.Structs.ResourceHandle;
@ -60,8 +48,10 @@ public partial class SettingsInterface
PrintValue( "Mod Manager BasePath IsRooted", Path.IsPathRooted( Penumbra.Config.ModDirectory ).ToString() );
PrintValue( "Mod Manager BasePath Exists", Directory.Exists( manager.BasePath.FullName ).ToString() );
PrintValue( "Mod Manager Valid", manager.Valid.ToString() );
PrintValue( "Path Resolver Enabled", _penumbra.PathResolver.Enabled.ToString() );
//PrintValue( "Resource Loader Enabled", _penumbra.ResourceLoader.IsEnabled.ToString() );
}
private void DrawDebugTabIpc()
{
if( !ImGui.CollapsingHeader( "IPC##Debug" ) )