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