public MessagePackProtocol(MessagePackProtocolSerializationOptions options)
        {
            this.Options = options;

            GameDevWare.Serialization.Json.DefaultSerializers.Clear();
            GameDevWare.Serialization.Json.DefaultSerializers.AddRange(new TypeSerializer[]
            {
                new BinarySerializer(),
                new DateTimeOffsetSerializer(),
                new DateTimeSerializer(),
                new GuidSerializer(),
                new StreamSerializer(),
                new UriSerializer(),
                new VersionSerializer(),
                new TimeSpanSerializer(),
                new DictionaryEntrySerializer(),

                new BestHTTP.SignalRCore.Encoders.Vector2Serializer(),
                new BestHTTP.SignalRCore.Encoders.Vector3Serializer(),
                new BestHTTP.SignalRCore.Encoders.Vector4Serializer(),

                new PrimitiveSerializer(typeof(bool)),
                new PrimitiveSerializer(typeof(byte)),
                new PrimitiveSerializer(typeof(decimal)),
                new PrimitiveSerializer(typeof(double)),
                new PrimitiveSerializer(typeof(short)),
                new PrimitiveSerializer(typeof(int)),
                new PrimitiveSerializer(typeof(long)),
                new PrimitiveSerializer(typeof(sbyte)),
                new PrimitiveSerializer(typeof(float)),
                new PrimitiveSerializer(typeof(ushort)),
                new PrimitiveSerializer(typeof(uint)),
                new PrimitiveSerializer(typeof(ulong)),
                new PrimitiveSerializer(typeof(string)),
            });
        }
Ejemplo n.º 2
0
 public MessagePackProtocol(MessagePackProtocolSerializationOptions options)
 {
     this.Options = options;
 }