From 3fd1637cf0c6402faabb21a14d4787681c44480f Mon Sep 17 00:00:00 2001 From: goat <16760685+goaaats@users.noreply.github.com> Date: Sun, 29 Aug 2021 23:49:31 +0200 Subject: [PATCH] fix(IPC): serialize with type info --- Dalamud/Plugin/Ipc/Internal/CallGateChannel.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Dalamud/Plugin/Ipc/Internal/CallGateChannel.cs b/Dalamud/Plugin/Ipc/Internal/CallGateChannel.cs index 21563c1a7..7d2f6ab9a 100644 --- a/Dalamud/Plugin/Ipc/Internal/CallGateChannel.cs +++ b/Dalamud/Plugin/Ipc/Internal/CallGateChannel.cs @@ -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) {