diff --git a/MLEM.Data/NetBufferSerializer.cs b/MLEM.Data/NetBufferSerializer.cs index 0f41bab..90a7d42 100644 --- a/MLEM.Data/NetBufferSerializer.cs +++ b/MLEM.Data/NetBufferSerializer.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.Reflection; using Lidgren.Network; +using Newtonsoft.Json; namespace MLEM.Data { public class NetBufferSerializer { @@ -57,5 +58,9 @@ namespace MLEM.Data { this.readFunctions.Add(typeof(T), buffer => read(buffer)); } + public void AddHandler(JsonSerializer serializer) { + this.AddHandler((buffer, o) => buffer.WriteObject(o, serializer), buffer => buffer.ReadObject(serializer)); + } + } } \ No newline at end of file