mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-20 15:44:18 +01:00
fix(IPC): serialize with type info
This commit is contained in:
parent
abe256ec9a
commit
3fd1637cf0
1 changed files with 9 additions and 3 deletions
|
|
@ -116,12 +116,18 @@ namespace Dalamud.Plugin.Ipc.Internal
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private object ConvertObject(object? obj, Type type)
|
private object? ConvertObject(object? obj, Type type)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var json = JsonConvert.SerializeObject(obj);
|
var settings = new JsonSerializerSettings
|
||||||
return JsonConvert.DeserializeObject(json, type);
|
{
|
||||||
|
TypeNameAssemblyFormatHandling = TypeNameAssemblyFormatHandling.Simple,
|
||||||
|
TypeNameHandling = TypeNameHandling.Objects,
|
||||||
|
};
|
||||||
|
|
||||||
|
var json = JsonConvert.SerializeObject(obj, settings);
|
||||||
|
return JsonConvert.DeserializeObject(json, type, settings);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue