diff --git a/Oxide.Ext.GamingApi/GamingApiExtension.cs b/Oxide.Ext.GamingApi/GamingApiExtension.cs index bf41f95..378e3b2 100644 --- a/Oxide.Ext.GamingApi/GamingApiExtension.cs +++ b/Oxide.Ext.GamingApi/GamingApiExtension.cs @@ -41,19 +41,12 @@ public GamingApiExtension(ExtensionManager manager) : base(manager) Player p = new Player() { Name = "Test", Id = "TEST", Address = "123", AdditionalProperties = new Dictionary()}; p.AdditionalProperties.Add("TEST", 123); - JsonSerializerSettings settings = new JsonSerializerSettings - { - TypeNameHandling = TypeNameHandling.Auto, - ContractResolver = OmitTypeNamesOnDynamicsResolver.Instance, - Formatting = Formatting.Indented, - Converters= new List { new PlayerConverter() } - }; - var json = JsonConvert.SerializeObject(p, settings); + var json = JsonConvert.SerializeObject(p); Interface.Oxide.LogInfo("[GamingApi Ext] Serialized message " + json); Asyncapi.Nats.Client.Models.Player p2 = new Asyncapi.Nats.Client.Models.Player() { Name = "Test", Id = "TEST", Address = "123", AdditionalProperties = new Dictionary() }; p2.AdditionalProperties.Add("TEST", 123); - var json3 = JsonConvert.SerializeObject(p2, settings); + var json3 = JsonConvert.SerializeObject(p2); Interface.Oxide.LogInfo("[GamingApi Ext] Serialized message " + json3); } diff --git a/Oxide.Ext.GamingApi/OmitTypeNamesOnDynamicsResolver.cs b/Oxide.Ext.GamingApi/OmitTypeNamesOnDynamicsResolver.cs deleted file mode 100644 index fcf3fac..0000000 --- a/Oxide.Ext.GamingApi/OmitTypeNamesOnDynamicsResolver.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using System.Reflection; -using NewtonsoftAlias.Json; -using NewtonsoftAlias.Json.Serialization; - -namespace Oxide.Ext.GamingApi -{ - public class OmitTypeNamesOnDynamicsResolver : DefaultContractResolver - { - - public static readonly OmitTypeNamesOnDynamicsResolver Instance = new OmitTypeNamesOnDynamicsResolver(); - - protected override JsonProperty CreateProperty(MemberInfo member, MemberSerialization memberSerialization) - { - JsonProperty prop = base.CreateProperty(member, memberSerialization); - if (member.GetCustomAttribute() != null) - { - prop.TypeNameHandling = TypeNameHandling.None; - } - return prop; - } - } -} diff --git a/Oxide.Ext.GamingApi/Oxide.Ext.GamingApi.csproj b/Oxide.Ext.GamingApi/Oxide.Ext.GamingApi.csproj index 62a5957..0ecdf05 100644 --- a/Oxide.Ext.GamingApi/Oxide.Ext.GamingApi.csproj +++ b/Oxide.Ext.GamingApi/Oxide.Ext.GamingApi.csproj @@ -18,7 +18,7 @@ - ..\..\rust-csharp-game-api\NewtonsoftAlias.Json.dll + ..\NewtonsoftAlias.Json.dll False