Add Additional changes needed for new patch

This commit is contained in:
CWX 2024-11-02 17:04:10 +00:00
parent bb2c43e9ec
commit 86a922327c

View File

@ -220,6 +220,9 @@ namespace DumpLib.Helpers
} }
} }
/// <summary>
/// DONT USE ANYMORE, USE GETPROFILECOMPLETEDATA()
/// </summary>
public static object GetPlayerProfile() public static object GetPlayerProfile()
{ {
try try
@ -235,5 +238,47 @@ namespace DumpLib.Helpers
throw; throw;
} }
} }
/// <summary>
/// TODO: Rename as its not an actual shim
///
/// </summary>
/// <returns></returns>
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<JsonConverter>() });
}
catch (Exception e)
{
Utils.LogError("GetProfileCompleteData");
Utils.LogError(e);
throw;
}
}
} }
} }