public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SerializableTransform value, global::MessagePack.MessagePackSerializerOptions options)
 {
     global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
     writer.WriteArrayHeader(2);
     formatterResolver.GetFormatterWithVerify <global::UnityEngine.Vector3>().Serialize(ref writer, value.p, options);
     formatterResolver.GetFormatterWithVerify <global::UnityEngine.Quaternion>().Serialize(ref writer, value.r, options);
 }
 public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::TeamSystem.ChangeTeamRequest value, global::MessagePack.MessagePackSerializerOptions options)
 {
     global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
     writer.WriteArrayHeader(2);
     writer.Write(value.C);
     formatterResolver.GetFormatterWithVerify <global::TeamSystem.Team>().Serialize(ref writer, value.R, options);
 }
 public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::MultiSyncRequest value, global::MessagePack.MessagePackSerializerOptions options)
 {
     global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
     writer.WriteArrayHeader(2);
     writer.Write(value.ID);
     formatterResolver.GetFormatterWithVerify <global::System.Collections.Generic.List <global::SerializableTransform> >().Serialize(ref writer, value.tfs, options);
 }
        public global::MultiSyncRequest Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
        {
            if (reader.TryReadNil())
            {
                throw new global::System.InvalidOperationException("typecode is null, struct not supported");
            }

            options.Security.DepthStep(ref reader);
            global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
            var length     = reader.ReadArrayHeader();
            var ____result = new global::MultiSyncRequest();

            for (int i = 0; i < length; i++)
            {
                switch (i)
                {
                case 0:
                    ____result.ID = reader.ReadInt32();
                    break;

                case 1:
                    ____result.tfs = formatterResolver.GetFormatterWithVerify <global::System.Collections.Generic.List <global::SerializableTransform> >().Deserialize(ref reader, options);
                    break;

                default:
                    reader.Skip();
                    break;
                }
            }

            reader.Depth--;
            return(____result);
        }
示例#5
0
                /// <inheritdoc/>
                public T Deserialize(ref MessagePackReader reader, MessagePackSerializerOptions options)
                {
                    // Read variant from reader
                    var o = MsgPack.Deserialize <object>(ref reader, options);

                    return(new MessagePackVariantValue(o, options, false) as T);
                }
        public global::TeamSystem.TeamAllocationData Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
        {
            if (reader.TryReadNil())
            {
                throw new global::System.InvalidOperationException("typecode is null, struct not supported");
            }

            options.Security.DepthStep(ref reader);
            global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
            var length     = reader.ReadArrayHeader();
            var ____result = new global::TeamSystem.TeamAllocationData();

            for (int i = 0; i < length; i++)
            {
                switch (i)
                {
                case 0:
                    ____result.c = formatterResolver.GetFormatterWithVerify <int[]>().Deserialize(ref reader, options);
                    break;

                case 1:
                    ____result.t = formatterResolver.GetFormatterWithVerify <global::TeamSystem.Team[]>().Deserialize(ref reader, options);
                    break;

                default:
                    reader.Skip();
                    break;
                }
            }

            reader.Depth--;
            return(____result);
        }
 public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::TeamSystem.TeamAllocationData value, global::MessagePack.MessagePackSerializerOptions options)
 {
     global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
     writer.WriteArrayHeader(2);
     formatterResolver.GetFormatterWithVerify <int[]>().Serialize(ref writer, value.c, options);
     formatterResolver.GetFormatterWithVerify <global::TeamSystem.Team[]>().Serialize(ref writer, value.t, options);
 }
示例#8
0
 /// <summary>
 /// Create value
 /// </summary>
 /// <param name="value"></param>
 /// <param name="serializer"></param>
 /// <param name="typed">Whether the object is the
 /// original type or the generated one</param>
 /// <param name="parentUpdate"></param>
 internal MessagePackVariantValue(object value,
                                  MessagePackSerializerOptions serializer, bool typed,
                                  Action <object> parentUpdate = null)
 {
     _options = serializer;
     _update  = parentUpdate;
     _value   = typed ? ToTypeLess(value) : value;
 }
示例#9
0
                /// <inheritdoc/>
                public T Deserialize(byte[] bytes, int offset, MessagePackSerializerOptions options,
                                     out int readSize)
                {
                    var o = MsgPack.Deserialize(typeof(object), bytes, offset, options, out readSize);

                    if (o == null)
                    {
                        return(default);
 public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::MultiSpawnPlayer value, global::MessagePack.MessagePackSerializerOptions options)
 {
     global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
     writer.WriteArrayHeader(4);
     writer.Write(value.T);
     writer.Write(value.C);
     writer.Write(value.t);
     formatterResolver.GetFormatterWithVerify <string>().Serialize(ref writer, value.P, options);
 }
 public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::BaseVRPlayer.PlayerInfo value, global::MessagePack.MessagePackSerializerOptions options)
 {
     global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
     writer.WriteArrayHeader(6);
     formatterResolver.GetFormatterWithVerify <global::UnityEngine.Vector3>().Serialize(ref writer, value.lP, options);
     formatterResolver.GetFormatterWithVerify <global::UnityEngine.Quaternion>().Serialize(ref writer, value.lR, options);
     formatterResolver.GetFormatterWithVerify <global::UnityEngine.Vector3>().Serialize(ref writer, value.hP, options);
     formatterResolver.GetFormatterWithVerify <global::UnityEngine.Quaternion>().Serialize(ref writer, value.hR, options);
     formatterResolver.GetFormatterWithVerify <global::UnityEngine.Vector3>().Serialize(ref writer, value.rP, options);
     formatterResolver.GetFormatterWithVerify <global::UnityEngine.Quaternion>().Serialize(ref writer, value.rR, options);
 }
示例#12
0
 /// <inheritdoc/>
 public int Serialize(ref byte[] bytes, int offset, T value,
                      MessagePackSerializerOptions options)
 {
     if (value is MessagePackVariantValue packed)
     {
         return(MsgPack.Serialize(packed._value?.GetType() ?? typeof(object),
                                  ref bytes, offset, packed._value, options));
     }
     else if (value is null)
     {
         return(MsgPackWriter.WriteNil(ref bytes, offset));
     }
     else if (value is VariantValue variant)
     {
         if (VariantValueEx.IsNull(variant))
         {
             return(MsgPackWriter.WriteNil(ref bytes, offset));
         }
         else if (variant.IsListOfValues)
         {
             var written = MsgPackWriter.WriteArrayHeader(
                 ref bytes, offset, variant.Count);
             foreach (var item in variant.Values)
             {
                 written += MsgPack.Serialize(item?.GetType() ?? typeof(object),
                                              ref bytes, offset + written, item, options);
             }
             return(written);
         }
         else if (variant.IsObject)
         {
             // Serialize objects as key value pairs
             var dict = variant.PropertyNames
                        .ToDictionary(k => k, k => variant[k]);
             return(MsgPack.Serialize(dict.GetType(), ref bytes,
                                      offset, dict, options));
         }
         else if (variant.TryGetValue(out var primitive))
         {
             return(MsgPack.Serialize(primitive?.GetType() ?? typeof(object),
                                      ref bytes, offset, primitive, options));
         }
         else
         {
             return(MsgPack.Serialize(variant.Value?.GetType() ?? typeof(object),
                                      ref bytes, offset, variant.Value, options));
         }
     }
     else
     {
         return(offset);
     }
 }
示例#13
0
        public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::DFrame.WorkloadInfo value, global::MessagePack.MessagePackSerializerOptions options)
        {
            if (value == null)
            {
                writer.WriteNil();
                return;
            }

            global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
            writer.WriteArrayHeader(2);
            formatterResolver.GetFormatterWithVerify <string>().Serialize(ref writer, value.Name, options);
            formatterResolver.GetFormatterWithVerify <global::DFrame.WorkloadParameterInfo[]>().Serialize(ref writer, value.Arguments, options);
        }
示例#14
0
        public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::DFrame.BatchedExecuteResult value, global::MessagePack.MessagePackSerializerOptions options)
        {
            if (value == null)
            {
                writer.WriteNil();
                return;
            }

            global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
            writer.WriteArrayHeader(2);
            formatterResolver.GetFormatterWithVerify <global::DFrame.WorkloadId>().Serialize(ref writer, value.WorkloadId, options);
            formatterResolver.GetFormatterWithVerify <global::DFrame.BatchList>().Serialize(ref writer, value.BatchedElapsed, options);
        }
示例#15
0
        public global::DFrame.ExecuteResult Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
        {
            if (reader.TryReadNil())
            {
                return(null);
            }

            options.Security.DepthStep(ref reader);
            global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
            var length           = reader.ReadArrayHeader();
            var __WorkloadId__   = default(global::DFrame.WorkloadId);
            var __Elapsed__      = default(global::System.TimeSpan);
            var __ExecutionNo__  = default(long);
            var __HasError__     = default(bool);
            var __ErrorMessage__ = default(string);

            for (int i = 0; i < length; i++)
            {
                switch (i)
                {
                case 0:
                    __WorkloadId__ = formatterResolver.GetFormatterWithVerify <global::DFrame.WorkloadId>().Deserialize(ref reader, options);
                    break;

                case 1:
                    __Elapsed__ = formatterResolver.GetFormatterWithVerify <global::System.TimeSpan>().Deserialize(ref reader, options);
                    break;

                case 2:
                    __ExecutionNo__ = reader.ReadInt64();
                    break;

                case 3:
                    __HasError__ = reader.ReadBoolean();
                    break;

                case 4:
                    __ErrorMessage__ = formatterResolver.GetFormatterWithVerify <string>().Deserialize(ref reader, options);
                    break;

                default:
                    reader.Skip();
                    break;
                }
            }

            var ____result = new global::DFrame.ExecuteResult(__WorkloadId__, __Elapsed__, __ExecutionNo__, __HasError__, __ErrorMessage__);

            reader.Depth--;
            return(____result);
        }
        public global::BaseVRPlayer.PlayerInfo Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
        {
            if (reader.TryReadNil())
            {
                throw new global::System.InvalidOperationException("typecode is null, struct not supported");
            }

            options.Security.DepthStep(ref reader);
            global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
            var length     = reader.ReadArrayHeader();
            var ____result = new global::BaseVRPlayer.PlayerInfo();

            for (int i = 0; i < length; i++)
            {
                switch (i)
                {
                case 0:
                    ____result.lP = formatterResolver.GetFormatterWithVerify <global::UnityEngine.Vector3>().Deserialize(ref reader, options);
                    break;

                case 1:
                    ____result.lR = formatterResolver.GetFormatterWithVerify <global::UnityEngine.Quaternion>().Deserialize(ref reader, options);
                    break;

                case 2:
                    ____result.hP = formatterResolver.GetFormatterWithVerify <global::UnityEngine.Vector3>().Deserialize(ref reader, options);
                    break;

                case 3:
                    ____result.hR = formatterResolver.GetFormatterWithVerify <global::UnityEngine.Quaternion>().Deserialize(ref reader, options);
                    break;

                case 4:
                    ____result.rP = formatterResolver.GetFormatterWithVerify <global::UnityEngine.Vector3>().Deserialize(ref reader, options);
                    break;

                case 5:
                    ____result.rR = formatterResolver.GetFormatterWithVerify <global::UnityEngine.Quaternion>().Deserialize(ref reader, options);
                    break;

                default:
                    reader.Skip();
                    break;
                }
            }

            reader.Depth--;
            return(____result);
        }
 public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::MultiInitialData value, global::MessagePack.MessagePackSerializerOptions options)
 {
     global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
     writer.WriteArrayHeader(10);
     writer.Write(value.T);
     formatterResolver.GetFormatterWithVerify <int[]>().Serialize(ref writer, value.sOI, options);
     formatterResolver.GetFormatterWithVerify <int[]>().Serialize(ref writer, value.sOK, options);
     formatterResolver.GetFormatterWithVerify <int[]>().Serialize(ref writer, value.gC, options);
     formatterResolver.GetFormatterWithVerify <int[]>().Serialize(ref writer, value.gT, options);
     formatterResolver.GetFormatterWithVerify <int[]>().Serialize(ref writer, value.gt, options);
     formatterResolver.GetFormatterWithVerify <string[]>().Serialize(ref writer, value.gN, options);
     writer.Write(value.sI);
     writer.Write(value.sOT);
     writer.Write(value.tN);
 }
示例#18
0
        public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::DFrame.ExecuteResult value, global::MessagePack.MessagePackSerializerOptions options)
        {
            if (value == null)
            {
                writer.WriteNil();
                return;
            }

            global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
            writer.WriteArrayHeader(5);
            formatterResolver.GetFormatterWithVerify <global::DFrame.WorkloadId>().Serialize(ref writer, value.WorkloadId, options);
            formatterResolver.GetFormatterWithVerify <global::System.TimeSpan>().Serialize(ref writer, value.Elapsed, options);
            writer.Write(value.ExecutionNo);
            writer.Write(value.HasError);
            formatterResolver.GetFormatterWithVerify <string>().Serialize(ref writer, value.ErrorMessage, options);
        }
示例#19
0
        public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::DFrame.WorkloadParameterInfo value, global::MessagePack.MessagePackSerializerOptions options)
        {
            if (value == null)
            {
                writer.WriteNil();
                return;
            }

            global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
            writer.WriteArrayHeader(7);
            formatterResolver.GetFormatterWithVerify <global::DFrame.AllowParameterType>().Serialize(ref writer, value.ParameterType, options);
            writer.Write(value.IsNullable);
            writer.Write(value.IsArray);
            formatterResolver.GetFormatterWithVerify <object>().Serialize(ref writer, value.DefaultValue, options);
            formatterResolver.GetFormatterWithVerify <string>().Serialize(ref writer, value.ParameterName, options);
            formatterResolver.GetFormatterWithVerify <string[]>().Serialize(ref writer, value.EnumNames, options);
            formatterResolver.GetFormatterWithVerify <string>().Serialize(ref writer, value.EnumTypeName, options);
        }
示例#20
0
 /// <inheritdoc/>
 public void Serialize(ref MessagePackWriter writer, T value,
                       MessagePackSerializerOptions options)
 {
     if (value is MessagePackVariantValue packed)
     {
         MsgPack.Serialize(ref writer, packed._value, options);
     }
     else if (value is null)
     {
         writer.WriteNil();
     }
     else if (value is VariantValue variant)
     {
         if (variant.IsNull())
         {
             writer.WriteNil();
         }
         else if (variant.IsListOfValues)
         {
             writer.WriteArrayHeader(variant.Count);
             foreach (var item in variant.Values)
             {
                 MsgPack.Serialize(ref writer, item, options);
             }
         }
         else if (variant.IsObject)
         {
             // Serialize objects as key value pairs
             var dict = variant.PropertyNames
                        .ToDictionary(k => k, k => variant[k]);
             MsgPack.Serialize(ref writer, dict, options);
         }
         else if (variant.TryGetValue(out var primitive))
         {
             MsgPack.Serialize(ref writer, primitive, options);
         }
         else
         {
             MsgPack.Serialize(ref writer, variant.Value, options);
         }
     }
 }
示例#21
0
        public global::DFrame.WorkloadInfo Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
        {
            if (reader.TryReadNil())
            {
                return(null);
            }

            options.Security.DepthStep(ref reader);
            global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
            var length        = reader.ReadArrayHeader();
            var __Name__      = default(string);
            var __Arguments__ = default(global::DFrame.WorkloadParameterInfo[]);

            for (int i = 0; i < length; i++)
            {
                switch (i)
                {
                case 0:
                    __Name__ = formatterResolver.GetFormatterWithVerify <string>().Deserialize(ref reader, options);
                    break;

                case 1:
                    __Arguments__ = formatterResolver.GetFormatterWithVerify <global::DFrame.WorkloadParameterInfo[]>().Deserialize(ref reader, options);
                    break;

                default:
                    reader.Skip();
                    break;
                }
            }

            var ____result = new global::DFrame.WorkloadInfo(__Name__, __Arguments__);

            reader.Depth--;
            return(____result);
        }
示例#22
0
        public global::DFrame.BatchedExecuteResult Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
        {
            if (reader.TryReadNil())
            {
                return(null);
            }

            options.Security.DepthStep(ref reader);
            global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
            var length             = reader.ReadArrayHeader();
            var __WorkloadId__     = default(global::DFrame.WorkloadId);
            var __BatchedElapsed__ = default(global::DFrame.BatchList);

            for (int i = 0; i < length; i++)
            {
                switch (i)
                {
                case 0:
                    __WorkloadId__ = formatterResolver.GetFormatterWithVerify <global::DFrame.WorkloadId>().Deserialize(ref reader, options);
                    break;

                case 1:
                    __BatchedElapsed__ = formatterResolver.GetFormatterWithVerify <global::DFrame.BatchList>().Deserialize(ref reader, options);
                    break;

                default:
                    reader.Skip();
                    break;
                }
            }

            var ____result = new global::DFrame.BatchedExecuteResult(__WorkloadId__, __BatchedElapsed__);

            reader.Depth--;
            return(____result);
        }
示例#23
0
        public global::DFrame.WorkloadParameterInfo Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
        {
            if (reader.TryReadNil())
            {
                return(null);
            }

            options.Security.DepthStep(ref reader);
            global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
            var length            = reader.ReadArrayHeader();
            var __ParameterType__ = default(global::DFrame.AllowParameterType);
            var __IsNullable__    = default(bool);
            var __IsArray__       = default(bool);
            var __DefaultValue__  = default(object);
            var __ParameterName__ = default(string);
            var __EnumNames__     = default(string[]);
            var __EnumTypeName__  = default(string);

            for (int i = 0; i < length; i++)
            {
                switch (i)
                {
                case 0:
                    __ParameterType__ = formatterResolver.GetFormatterWithVerify <global::DFrame.AllowParameterType>().Deserialize(ref reader, options);
                    break;

                case 1:
                    __IsNullable__ = reader.ReadBoolean();
                    break;

                case 2:
                    __IsArray__ = reader.ReadBoolean();
                    break;

                case 3:
                    __DefaultValue__ = formatterResolver.GetFormatterWithVerify <object>().Deserialize(ref reader, options);
                    break;

                case 4:
                    __ParameterName__ = formatterResolver.GetFormatterWithVerify <string>().Deserialize(ref reader, options);
                    break;

                case 5:
                    __EnumNames__ = formatterResolver.GetFormatterWithVerify <string[]>().Deserialize(ref reader, options);
                    break;

                case 6:
                    __EnumTypeName__ = formatterResolver.GetFormatterWithVerify <string>().Deserialize(ref reader, options);
                    break;

                default:
                    reader.Skip();
                    break;
                }
            }

            var ____result = new global::DFrame.WorkloadParameterInfo(__ParameterType__, __IsNullable__, __IsArray__, __DefaultValue__, __ParameterName__, __EnumNames__, __EnumTypeName__);

            reader.Depth--;
            return(____result);
        }
        public global::MultiInitialData Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
        {
            if (reader.TryReadNil())
            {
                throw new global::System.InvalidOperationException("typecode is null, struct not supported");
            }

            options.Security.DepthStep(ref reader);
            global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
            var length     = reader.ReadArrayHeader();
            var ____result = new global::MultiInitialData();

            for (int i = 0; i < length; i++)
            {
                switch (i)
                {
                case 0:
                    ____result.T = reader.ReadInt32();
                    break;

                case 1:
                    ____result.sOI = formatterResolver.GetFormatterWithVerify <int[]>().Deserialize(ref reader, options);
                    break;

                case 2:
                    ____result.sOK = formatterResolver.GetFormatterWithVerify <int[]>().Deserialize(ref reader, options);
                    break;

                case 3:
                    ____result.gC = formatterResolver.GetFormatterWithVerify <int[]>().Deserialize(ref reader, options);
                    break;

                case 4:
                    ____result.gT = formatterResolver.GetFormatterWithVerify <int[]>().Deserialize(ref reader, options);
                    break;

                case 5:
                    ____result.gt = formatterResolver.GetFormatterWithVerify <int[]>().Deserialize(ref reader, options);
                    break;

                case 6:
                    ____result.gN = formatterResolver.GetFormatterWithVerify <string[]>().Deserialize(ref reader, options);
                    break;

                case 7:
                    ____result.sI = reader.ReadInt32();
                    break;

                case 8:
                    ____result.sOT = reader.ReadInt32();
                    break;

                case 9:
                    ____result.tN = reader.ReadInt32();
                    break;

                default:
                    reader.Skip();
                    break;
                }
            }

            reader.Depth--;
            return(____result);
        }