Aetheria/Assets/Scripts/ServerShared/CultCache/Serialization/RegisterResolver.cs
Reinier Vens 968783bf9c Database Improvements
Brought in all the myriad improvements to the database tools from the Stream Pixels project
Added configurable nested entry grouping
2021-04-07 01:27:35 +01:00

25 lines
708 B
C#

using System.Collections;
using System.Collections.Generic;
using MessagePack;
using MessagePack.Resolvers;
public static class RegisterResolver
{
private static bool registered = false;
public static void Register()
{
if (registered) return;
// Set extensions to default resolver.
var resolver = CompositeResolver.Create(
MathResolver.Instance,
TypeResolver.Instance,
NativeGuidResolver.Instance,
StandardResolver.Instance
);
var options = MessagePackSerializerOptions.Standard.WithResolver(resolver);
MessagePackSerializer.DefaultOptions = options;
registered = true;
}
}