mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-13 12:14:16 +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
|
||||
{
|
||||
var json = JsonConvert.SerializeObject(obj);
|
||||
return JsonConvert.DeserializeObject(json, type);
|
||||
var settings = new JsonSerializerSettings
|
||||
{
|
||||
TypeNameAssemblyFormatHandling = TypeNameAssemblyFormatHandling.Simple,
|
||||
TypeNameHandling = TypeNameHandling.Objects,
|
||||
};
|
||||
|
||||
var json = JsonConvert.SerializeObject(obj, settings);
|
||||
return JsonConvert.DeserializeObject(json, type, settings);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue