From 86a922327c42d940da132b5d3faae8797c235e94 Mon Sep 17 00:00:00 2001 From: CWX Date: Sat, 2 Nov 2024 17:04:10 +0000 Subject: [PATCH] Add Additional changes needed for new patch --- DumpLib/Helpers/ReflectionHelper.cs | 45 +++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/DumpLib/Helpers/ReflectionHelper.cs b/DumpLib/Helpers/ReflectionHelper.cs index 1a449ba..08c9420 100644 --- a/DumpLib/Helpers/ReflectionHelper.cs +++ b/DumpLib/Helpers/ReflectionHelper.cs @@ -220,6 +220,9 @@ namespace DumpLib.Helpers } } + /// + /// DONT USE ANYMORE, USE GETPROFILECOMPLETEDATA() + /// public static object GetPlayerProfile() { try @@ -235,5 +238,47 @@ namespace DumpLib.Helpers throw; } } + + /// + /// TODO: Rename as its not an actual shim + /// + /// + /// + public static object GetProfileShim() + { + try + { + var typeToUse = TypeHelper.GetProfileShimType(); + var instance = Activator.CreateInstance(typeToUse, + new object[] + { + DataHelper.Session.GetType().GetProperty("Profile").GetValue(DataHelper.Session), + TypeHelper.GetProfileSearchControllerType().GetField("Instance").GetValue(null) + }); + return instance; + } + catch (Exception e) + { + Utils.LogError("GetProfileShim"); + Utils.LogError(e); + throw; + } + } + + public static object GetProfileCompleteData() + { + try + { + var completeData = ReflectionHelper.GetProfileShim(); + var converterMethod = CreateGenericMethod(MethodHelper.GetToUnparsedDataMethod(), TypeHelper.GetProfileShimType()); + return converterMethod.Invoke(null, new[] { completeData, Array.Empty() }); + } + catch (Exception e) + { + Utils.LogError("GetProfileCompleteData"); + Utils.LogError(e); + throw; + } + } } } \ No newline at end of file