From 555ee73739e2d46a352f6f30d41cff81bb44a455 Mon Sep 17 00:00:00 2001 From: Anna Date: Fri, 12 Feb 2021 16:51:47 -0500 Subject: [PATCH] feat: output useful information in debug mode --- BetterPartyFinder/GameFunctions.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/BetterPartyFinder/GameFunctions.cs b/BetterPartyFinder/GameFunctions.cs index ac9f430..d903b02 100755 --- a/BetterPartyFinder/GameFunctions.cs +++ b/BetterPartyFinder/GameFunctions.cs @@ -1,5 +1,7 @@ using System; +#if DEBUG using System.Linq; +#endif using System.Runtime.InteropServices; using Dalamud.Hooking; using Dalamud.Plugin; @@ -48,6 +50,15 @@ namespace BetterPartyFinder { var needToRewrite = false; + #if DEBUG + var raw = Marshal.AllocHGlobal(PacketInfo.PacketSize); + Marshal.StructureToPtr(packet, raw, false); + var bytes = new byte[PacketInfo.PacketSize]; + Marshal.Copy(raw, bytes, 0, PacketInfo.PacketSize); + PluginLog.Log(string.Join("", bytes.Select(b => b.ToString("x2")))); + Marshal.FreeHGlobal(raw); + #endif + for (var i = 0; i < packet.listings.Length; i++) { if (packet.listings[i].IsNull()) { continue;