Beispiel #1
0
        public global::UnityEngine.BoundsInt Deserialize(ref MessagePackReader reader, global::MessagePack.IFormatterResolver formatterResolver)
        {
            if (reader.IsNil)
            {
                throw new InvalidOperationException("typecode is null, struct not supported");
            }
            var length       = reader.ReadArrayHeader();
            var __position__ = default(global::UnityEngine.Vector3Int);
            var __size__     = default(global::UnityEngine.Vector3Int);

            for (int i = 0; i < length; i++)
            {
                var key = i;
                switch (key)
                {
                case 0:
                    __position__ = formatterResolver.GetFormatterWithVerify <global::UnityEngine.Vector3Int>().Deserialize(ref reader, formatterResolver);
                    break;

                case 1:
                    __size__ = formatterResolver.GetFormatterWithVerify <global::UnityEngine.Vector3Int>().Deserialize(ref reader, formatterResolver);
                    break;

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

            var ____result = new global::UnityEngine.BoundsInt(__position__, __size__);

            ____result.position = __position__;
            ____result.size     = __size__;
            return(____result);
        }
Beispiel #2
0
        public global::UnityEngine.Bounds Deserialize(ref MessagePackReader reader, global::MessagePack.IFormatterResolver formatterResolver)
        {
            if (reader.IsNil)
            {
                throw new InvalidOperationException("typecode is null, struct not supported");
            }
            var length = reader.ReadArrayHeader();
            var center = default(global::UnityEngine.Vector3);
            var size   = default(global::UnityEngine.Vector3);

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

                case 1:
                    size = formatterResolver.GetFormatterWithVerify <global::UnityEngine.Vector3>().Deserialize(ref reader, formatterResolver);
                    break;

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

            var result = new global::UnityEngine.Bounds(center, size);

            return(result);
        }
Beispiel #3
0
        public int Serialize(ref byte[] bytes, int offset, global::IMessagePackUnion value, global::MessagePack.IFormatterResolver formatterResolver)
        {
            KeyValuePair <int, int> keyValuePair;

            if (value != null && this.typeToKeyAndJumpMap.TryGetValue(value.GetType().TypeHandle, out keyValuePair))
            {
                var startOffset = offset;
                offset += MessagePackBinary.WriteFixedArrayHeaderUnsafe(ref bytes, offset, 2);
                offset += MessagePackBinary.WriteInt32(ref bytes, offset, keyValuePair.Key);
                switch (keyValuePair.Value)
                {
                case 0:
                    offset += formatterResolver.GetFormatterWithVerify <global::PackableARWorldMap>().Serialize(ref bytes, offset, (global::PackableARWorldMap)value, formatterResolver);
                    break;

                case 1:
                    offset += formatterResolver.GetFormatterWithVerify <global::PackableARUserAnchor>().Serialize(ref bytes, offset, (global::PackableARUserAnchor)value, formatterResolver);
                    break;

                default:
                    break;
                }

                return(offset - startOffset);
            }

            return(MessagePackBinary.WriteNil(ref bytes, offset));
        }
Beispiel #4
0
        public global::TestData2.A Deserialize(byte[] bytes, int offset, global::MessagePack.IFormatterResolver formatterResolver, out int readSize)
        {
            if (global::MessagePack.MessagePackBinary.IsNil(bytes, offset))
            {
                readSize = 1;
                return(null);
            }

            var startOffset = offset;
            var length      = global::MessagePack.MessagePackBinary.ReadMapHeader(bytes, offset, out readSize);

            offset += readSize;

            var __a__  = default(int);
            var __bs__ = default(global::System.Collections.Generic.List <global::TestData2.B>);
            var __c__  = default(global::TestData2.C);

            for (int i = 0; i < length; i++)
            {
                var stringKey = global::MessagePack.MessagePackBinary.ReadStringSegment(bytes, offset, out readSize);
                offset += readSize;
                int key;
                if (!____keyMapping.TryGetValueSafe(stringKey, out key))
                {
                    readSize = global::MessagePack.MessagePackBinary.ReadNextBlock(bytes, offset);
                    goto NEXT_LOOP;
                }

                switch (key)
                {
                case 0:
                    __a__ = MessagePackBinary.ReadInt32(bytes, offset, out readSize);
                    break;

                case 1:
                    __bs__ = formatterResolver.GetFormatterWithVerify <global::System.Collections.Generic.List <global::TestData2.B> >().Deserialize(bytes, offset, formatterResolver, out readSize);
                    break;

                case 2:
                    __c__ = formatterResolver.GetFormatterWithVerify <global::TestData2.C>().Deserialize(bytes, offset, formatterResolver, out readSize);
                    break;

                default:
                    readSize = global::MessagePack.MessagePackBinary.ReadNextBlock(bytes, offset);
                    break;
                }

NEXT_LOOP:
                offset += readSize;
            }

            readSize = offset - startOffset;

            var ____result = new global::TestData2.A();

            ____result.a  = __a__;
            ____result.bs = __bs__;
            ____result.c  = __c__;
            return(____result);
        }
Beispiel #5
0
            internal static global::MagicSpritz.IAction Deserialize(byte[] bytes, int offset, global::MessagePack.IFormatterResolver formatterResolver, out int readSize)
            {
                int startOffset = offset;
                int typeId      = MessagePackBinary.ReadArrayHeader(bytes, offset, out readSize);

                if (typeId == -1)
                {
                    MessagePackBinary.ReadNil(bytes, offset, out readSize);
                    return(null);
                }
                offset += readSize;

                var result = (global::MagicSpritz.IAction)null;

                switch (typeId)
                {
                case 0: result = formatterResolver.GetFormatterWithVerify <global::RM.Hotel.NewGameAction>().Deserialize(bytes, offset, formatterResolver, out readSize); break;

                case 1: result = formatterResolver.GetFormatterWithVerify <global::RM.Hotel.BuyDecoAction>().Deserialize(bytes, offset, formatterResolver, out readSize); break;

                case 2: result = formatterResolver.GetFormatterWithVerify <global::RM.Hotel.UpgradeRoomAction>().Deserialize(bytes, offset, formatterResolver, out readSize); break;

                default: result = null; MessagePackBinary.ReadNil(bytes, offset, out readSize); break;
                }
                offset  += readSize;
                readSize = offset - startOffset;
                return(result);
            }
Beispiel #6
0
        public global::Michelangelo.Models.MichelangeloApi.TriangularMesh Deserialize(byte[] bytes, int offset, global::MessagePack.IFormatterResolver formatterResolver, out int readSize)
        {
            if (global::MessagePack.MessagePackBinary.IsNil(bytes, offset))
            {
                readSize = 1;
                return(null);
            }

            var startOffset = offset;
            var length      = global::MessagePack.MessagePackBinary.ReadMapHeader(bytes, offset, out readSize);

            offset += readSize;

            var __Indexed__ = default(bool);
            var __Indices__ = default(int[]);
            var __Points__  = default(double[]);

            for (int i = 0; i < length; i++)
            {
                var stringKey = global::MessagePack.MessagePackBinary.ReadStringSegment(bytes, offset, out readSize);
                offset += readSize;
                int key;
                if (!____keyMapping.TryGetValueSafe(stringKey, out key))
                {
                    readSize = global::MessagePack.MessagePackBinary.ReadNextBlock(bytes, offset);
                    goto NEXT_LOOP;
                }

                switch (key)
                {
                case 0:
                    __Indexed__ = MessagePackBinary.ReadBoolean(bytes, offset, out readSize);
                    break;

                case 1:
                    __Indices__ = formatterResolver.GetFormatterWithVerify <int[]>().Deserialize(bytes, offset, formatterResolver, out readSize);
                    break;

                case 2:
                    __Points__ = formatterResolver.GetFormatterWithVerify <double[]>().Deserialize(bytes, offset, formatterResolver, out readSize);
                    break;

                default:
                    readSize = global::MessagePack.MessagePackBinary.ReadNextBlock(bytes, offset);
                    break;
                }

NEXT_LOOP:
                offset += readSize;
            }

            readSize = offset - startOffset;

            var ____result = new global::Michelangelo.Models.MichelangeloApi.TriangularMesh();

            ____result.Indexed = __Indexed__;
            ____result.Indices = __Indices__;
            ____result.Points  = __Points__;
            return(____result);
        }
        public int Serialize(ref byte[] bytes, int offset, global::ChatApp.Shared.MessagePackObjects.MessageResponse value, global::MessagePack.IFormatterResolver formatterResolver)
        {
            var startOffset = offset;

            offset += global::MessagePack.MessagePackBinary.WriteFixedArrayHeaderUnsafe(ref bytes, offset, 2);
            offset += formatterResolver.GetFormatterWithVerify <string>().Serialize(ref bytes, offset, value.UserName, formatterResolver);
            offset += formatterResolver.GetFormatterWithVerify <string>().Serialize(ref bytes, offset, value.Message, formatterResolver);
            return(offset - startOffset);
        }
Beispiel #8
0
        public int Serialize(ref byte[] bytes, int offset, global::UnityEngine.Bounds value, global::MessagePack.IFormatterResolver formatterResolver)
        {
            var startOffset = offset;

            offset += global::MessagePack.MessagePackBinary.WriteFixedArrayHeaderUnsafe(ref bytes, offset, 1);
            offset += formatterResolver.GetFormatterWithVerify <global::UnityEngine.Vector3>().Serialize(ref bytes, offset, value.center, formatterResolver);
            offset += formatterResolver.GetFormatterWithVerify <global::UnityEngine.Vector3>().Serialize(ref bytes, offset, value.size, formatterResolver);
            return(offset - startOffset);
        }
Beispiel #9
0
        public global::Michelangelo.Models.MichelangeloApi.MaterialModel Deserialize(byte[] bytes, int offset, global::MessagePack.IFormatterResolver formatterResolver, out int readSize)
        {
            if (global::MessagePack.MessagePackBinary.IsNil(bytes, offset))
            {
                readSize = 1;
                return(null);
            }

            var startOffset = offset;
            var length      = global::MessagePack.MessagePackBinary.ReadMapHeader(bytes, offset, out readSize);

            offset += readSize;

            var __Albedo__  = default(global::System.Collections.Generic.IReadOnlyList <double>);
            var __Scalars__ = default(global::System.Collections.Generic.IReadOnlyDictionary <string, double>);
            var __Vectors__ = default(global::System.Collections.Generic.IReadOnlyDictionary <string, double[]>);

            for (int i = 0; i < length; i++)
            {
                var stringKey = global::MessagePack.MessagePackBinary.ReadStringSegment(bytes, offset, out readSize);
                offset += readSize;
                int key;
                if (!____keyMapping.TryGetValueSafe(stringKey, out key))
                {
                    readSize = global::MessagePack.MessagePackBinary.ReadNextBlock(bytes, offset);
                    goto NEXT_LOOP;
                }

                switch (key)
                {
                case 0:
                    __Albedo__ = formatterResolver.GetFormatterWithVerify <global::System.Collections.Generic.IReadOnlyList <double> >().Deserialize(bytes, offset, formatterResolver, out readSize);
                    break;

                case 1:
                    __Scalars__ = formatterResolver.GetFormatterWithVerify <global::System.Collections.Generic.IReadOnlyDictionary <string, double> >().Deserialize(bytes, offset, formatterResolver, out readSize);
                    break;

                case 2:
                    __Vectors__ = formatterResolver.GetFormatterWithVerify <global::System.Collections.Generic.IReadOnlyDictionary <string, double[]> >().Deserialize(bytes, offset, formatterResolver, out readSize);
                    break;

                default:
                    readSize = global::MessagePack.MessagePackBinary.ReadNextBlock(bytes, offset);
                    break;
                }

NEXT_LOOP:
                offset += readSize;
            }

            readSize = offset - startOffset;

            var ____result = new global::Michelangelo.Models.MichelangeloApi.MaterialModel(__Albedo__, __Scalars__, __Vectors__);

            return(____result);
        }
Beispiel #10
0
        public int Serialize(ref byte[] bytes, int offset, global::Assets.Scripts.ServerShared.MessagePackObjects.JoinRequest value, global::MessagePack.IFormatterResolver formatterResolver)
        {
            var startOffset = offset;

            offset += global::MessagePack.MessagePackBinary.WriteFixedArrayHeaderUnsafe(ref bytes, offset, 2);
            offset += formatterResolver.GetFormatterWithVerify <string>().Serialize(ref bytes, offset, value.RoomName, formatterResolver);
            offset += formatterResolver.GetFormatterWithVerify <string>().Serialize(ref bytes, offset, value.UserName, formatterResolver);
            return(offset - startOffset);
        }
        public int Serialize(ref byte[] bytes, int offset, global::RM.Hotel.Models.PlayerData value, global::MessagePack.IFormatterResolver formatterResolver)
        {
            var startOffset = offset;

            offset += global::MessagePack.MessagePackBinary.WriteFixedArrayHeaderUnsafe(ref bytes, offset, 2);
            offset += formatterResolver.GetFormatterWithVerify <global::RM.Hotel.Models.Stats>().Serialize(ref bytes, offset, value.Stats, formatterResolver);
            offset += formatterResolver.GetFormatterWithVerify <global::RM.Hotel.Models.Hotel>().Serialize(ref bytes, offset, value.Hotel, formatterResolver);
            return(offset - startOffset);
        }
Beispiel #12
0
        public int Serialize(ref byte[] bytes, int offset, global::PackableARUserAnchor value, global::MessagePack.IFormatterResolver formatterResolver)
        {
            var startOffset = offset;

            offset += global::MessagePack.MessagePackBinary.WriteFixedArrayHeaderUnsafe(ref bytes, offset, 2);
            offset += formatterResolver.GetFormatterWithVerify <string>().Serialize(ref bytes, offset, value.Identifier, formatterResolver);
            offset += formatterResolver.GetFormatterWithVerify <global::UnityEngine.Matrix4x4>().Serialize(ref bytes, offset, value.Transform, formatterResolver);
            return(offset - startOffset);
        }
Beispiel #13
0
        public global::UniP2P.LLAPI.UdpPacketObject Deserialize(byte[] bytes, int offset, global::MessagePack.IFormatterResolver formatterResolver, out int readSize)
        {
            if (global::MessagePack.MessagePackBinary.IsNil(bytes, offset))
            {
                throw new InvalidOperationException("typecode is null, struct not supported");
            }

            var startOffset = offset;
            var length      = global::MessagePack.MessagePackBinary.ReadArrayHeader(bytes, offset, out readSize);

            offset += readSize;

            var __P2PEventType__ = default(global::UniP2P.LLAPI.P2PEventType);
            var __Value__        = default(byte[]);
            var __QosType__      = default(global::UniP2P.LLAPI.SocketQosType);
            var __sequence_no__  = default(ulong);

            for (int i = 0; i < length; i++)
            {
                var key = i;

                switch (key)
                {
                case 0:
                    __P2PEventType__ = formatterResolver.GetFormatterWithVerify <global::UniP2P.LLAPI.P2PEventType>().Deserialize(bytes, offset, formatterResolver, out readSize);
                    break;

                case 1:
                    __Value__ = formatterResolver.GetFormatterWithVerify <byte[]>().Deserialize(bytes, offset, formatterResolver, out readSize);
                    break;

                case 2:
                    __QosType__ = formatterResolver.GetFormatterWithVerify <global::UniP2P.LLAPI.SocketQosType>().Deserialize(bytes, offset, formatterResolver, out readSize);
                    break;

                case 3:
                    __sequence_no__ = MessagePackBinary.ReadUInt64(bytes, offset, out readSize);
                    break;

                default:
                    readSize = global::MessagePack.MessagePackBinary.ReadNextBlock(bytes, offset);
                    break;
                }
                offset += readSize;
            }

            readSize = offset - startOffset;

            var ____result = new global::UniP2P.LLAPI.UdpPacketObject();

            ____result.P2PEventType = __P2PEventType__;
            ____result.Value        = __Value__;
            ____result.QosType      = __QosType__;
            ____result.sequence_no  = __sequence_no__;
            return(____result);
        }
Beispiel #14
0
        public int Serialize(ref byte[] bytes, int offset, global::UniP2P.HLAPI.StreamPacketInstance value, global::MessagePack.IFormatterResolver formatterResolver)
        {
            var startOffset = offset;

            offset += global::MessagePack.MessagePackBinary.WriteFixedArrayHeaderUnsafe(ref bytes, offset, 3);
            offset += formatterResolver.GetFormatterWithVerify <global::UnityEngine.Vector3>().Serialize(ref bytes, offset, value.Position, formatterResolver);
            offset += formatterResolver.GetFormatterWithVerify <global::UnityEngine.Quaternion>().Serialize(ref bytes, offset, value.Quaternion, formatterResolver);
            offset += formatterResolver.GetFormatterWithVerify <string>().Serialize(ref bytes, offset, value.NetInstanceID, formatterResolver);
            return(offset - startOffset);
        }
        public int Serialize(ref byte[] bytes, int offset, global::RM.Hotel.Models.Hotel value, global::MessagePack.IFormatterResolver formatterResolver)
        {
            var startOffset = offset;

            offset += global::MessagePack.MessagePackBinary.WriteFixedArrayHeaderUnsafe(ref bytes, offset, 4);
            offset += formatterResolver.GetFormatterWithVerify <string>().Serialize(ref bytes, offset, value.Name, formatterResolver);
            offset += MessagePackBinary.WriteInt32(ref bytes, offset, value.Level);
            offset += global::MessagePack.MessagePackBinary.WriteNil(ref bytes, offset);
            offset += formatterResolver.GetFormatterWithVerify <global::System.Collections.Immutable.ImmutableList <global::RM.Hotel.Models.Room> >().Serialize(ref bytes, offset, value.Rooms, formatterResolver);
            return(offset - startOffset);
        }
Beispiel #16
0
        public global::TestData2.PropNameCheck2 Deserialize(byte[] bytes, int offset, global::MessagePack.IFormatterResolver formatterResolver, out int readSize)
        {
            if (global::MessagePack.MessagePackBinary.IsNil(bytes, offset))
            {
                readSize = 1;
                return(null);
            }

            var startOffset = offset;
            var length      = global::MessagePack.MessagePackBinary.ReadMapHeader(bytes, offset, out readSize);

            offset += readSize;

            var __MyProperty1__ = default(string);
            var __MyProperty2__ = default(string);

            for (int i = 0; i < length; i++)
            {
                var stringKey = global::MessagePack.MessagePackBinary.ReadStringSegment(bytes, offset, out readSize);
                offset += readSize;
                int key;
                if (!____keyMapping.TryGetValueSafe(stringKey, out key))
                {
                    readSize = global::MessagePack.MessagePackBinary.ReadNextBlock(bytes, offset);
                    goto NEXT_LOOP;
                }

                switch (key)
                {
                case 0:
                    __MyProperty1__ = formatterResolver.GetFormatterWithVerify <string>().Deserialize(bytes, offset, formatterResolver, out readSize);
                    break;

                case 1:
                    __MyProperty2__ = formatterResolver.GetFormatterWithVerify <string>().Deserialize(bytes, offset, formatterResolver, out readSize);
                    break;

                default:
                    readSize = global::MessagePack.MessagePackBinary.ReadNextBlock(bytes, offset);
                    break;
                }

NEXT_LOOP:
                offset += readSize;
            }

            readSize = offset - startOffset;

            var ____result = new global::TestData2.PropNameCheck2();

            ____result.MyProperty1 = __MyProperty1__;
            ____result.MyProperty2 = __MyProperty2__;
            return(____result);
        }
Beispiel #17
0
        public int Serialize(ref byte[] bytes, int offset, global::UniP2P.LLAPI.UdpPacketObject value, global::MessagePack.IFormatterResolver formatterResolver)
        {
            var startOffset = offset;

            offset += global::MessagePack.MessagePackBinary.WriteFixedArrayHeaderUnsafe(ref bytes, offset, 4);
            offset += formatterResolver.GetFormatterWithVerify <global::UniP2P.LLAPI.P2PEventType>().Serialize(ref bytes, offset, value.P2PEventType, formatterResolver);
            offset += formatterResolver.GetFormatterWithVerify <byte[]>().Serialize(ref bytes, offset, value.Value, formatterResolver);
            offset += formatterResolver.GetFormatterWithVerify <global::UniP2P.LLAPI.SocketQosType>().Serialize(ref bytes, offset, value.QosType, formatterResolver);
            offset += MessagePackBinary.WriteUInt64(ref bytes, offset, value.sequence_no);
            return(offset - startOffset);
        }
Beispiel #18
0
        public int Serialize(ref byte[] bytes, int offset, global::UniP2P.HLAPI.StreamPacket value, global::MessagePack.IFormatterResolver formatterResolver)
        {
            var startOffset = offset;

            offset += global::MessagePack.MessagePackBinary.WriteFixedArrayHeaderUnsafe(ref bytes, offset, 5);
            offset += formatterResolver.GetFormatterWithVerify <string>().Serialize(ref bytes, offset, value.NetInstanceID, formatterResolver);
            offset += formatterResolver.GetFormatterWithVerify <string>().Serialize(ref bytes, offset, value.OutComponentType, formatterResolver);
            offset += MessagePackBinary.WriteBoolean(ref bytes, offset, value.isInstantiate);
            offset += formatterResolver.GetFormatterWithVerify <string>().Serialize(ref bytes, offset, value.InstantiateResourcePath, formatterResolver);
            offset += formatterResolver.GetFormatterWithVerify <byte[]>().Serialize(ref bytes, offset, value.value, formatterResolver);
            return(offset - startOffset);
        }
Beispiel #19
0
 public void Serialize(ref MessagePackWriter writer, global::UnityEngine.Gradient value, global::MessagePack.IFormatterResolver formatterResolver)
 {
     if (value == null)
     {
         writer.WriteNil();
         return;
     }
     writer.WriteFixedArrayHeaderUnsafe(3);
     formatterResolver.GetFormatterWithVerify <global::UnityEngine.GradientColorKey[]>().Serialize(ref writer, value.colorKeys, formatterResolver);
     formatterResolver.GetFormatterWithVerify <global::UnityEngine.GradientAlphaKey[]>().Serialize(ref writer, value.alphaKeys, formatterResolver);
     formatterResolver.GetFormatterWithVerify <global::UnityEngine.GradientMode>().Serialize(ref writer, value.mode, formatterResolver);
 }
Beispiel #20
0
 public void Serialize(ref MessagePackWriter writer, global::UnityEngine.AnimationCurve value, global::MessagePack.IFormatterResolver formatterResolver)
 {
     if (value == null)
     {
         writer.WriteNil();
         return;
     }
     writer.WriteFixedArrayHeaderUnsafe(3);
     formatterResolver.GetFormatterWithVerify <global::UnityEngine.Keyframe[]>().Serialize(ref writer, value.keys, formatterResolver);
     formatterResolver.GetFormatterWithVerify <global::UnityEngine.WrapMode>().Serialize(ref writer, value.postWrapMode, formatterResolver);
     formatterResolver.GetFormatterWithVerify <global::UnityEngine.WrapMode>().Serialize(ref writer, value.preWrapMode, formatterResolver);
 }
        public global::RM.Hotel.ActionEvent Deserialize(byte[] bytes, int offset, global::MessagePack.IFormatterResolver formatterResolver, out int readSize)
        {
            if (global::MessagePack.MessagePackBinary.IsNil(bytes, offset))
            {
                readSize = 1;
                return(null);
            }

            var startOffset = offset;
            var length      = global::MessagePack.MessagePackBinary.ReadArrayHeader(bytes, offset, out readSize);

            offset += readSize;

            var __Id__     = default(uint);
            var __Hash__   = default(string);
            var __Action__ = default(global::MagicSpritz.IAction);

            for (int i = 0; i < length; i++)
            {
                var key = i;

                switch (key)
                {
                case 0:
                    __Id__ = MessagePackBinary.ReadUInt32(bytes, offset, out readSize);
                    break;

                case 1:
                    __Hash__ = formatterResolver.GetFormatterWithVerify <string>().Deserialize(bytes, offset, formatterResolver, out readSize);
                    break;

                case 2:
                    __Action__ = formatterResolver.GetFormatterWithVerify <global::MagicSpritz.IAction>().Deserialize(bytes, offset, formatterResolver, out readSize);
                    break;

                default:
                    readSize = global::MessagePack.MessagePackBinary.ReadNextBlock(bytes, offset);
                    break;
                }
                offset += readSize;
            }

            readSize = offset - startOffset;

            var ____result = new global::RM.Hotel.ActionEvent();

            ____result.Id     = __Id__;
            ____result.Hash   = __Hash__;
            ____result.Action = __Action__;
            return(____result);
        }
Beispiel #22
0
        public global::UniP2P.LLAPI.UdpPacketObjects Deserialize(byte[] bytes, int offset, global::MessagePack.IFormatterResolver formatterResolver, out int readSize)
        {
            if (global::MessagePack.MessagePackBinary.IsNil(bytes, offset))
            {
                readSize = 1;
                return(null);
            }

            var startOffset = offset;
            var length      = global::MessagePack.MessagePackBinary.ReadArrayHeader(bytes, offset, out readSize);

            offset += readSize;

            var __UdpPacketObjectArray__ = default(global::UniP2P.LLAPI.UdpPacketObject[]);
            var __PeerID__ = default(string);
            var __ack_no__ = default(ulong);

            for (int i = 0; i < length; i++)
            {
                var key = i;

                switch (key)
                {
                case 0:
                    __UdpPacketObjectArray__ = formatterResolver.GetFormatterWithVerify <global::UniP2P.LLAPI.UdpPacketObject[]>().Deserialize(bytes, offset, formatterResolver, out readSize);
                    break;

                case 1:
                    __PeerID__ = formatterResolver.GetFormatterWithVerify <string>().Deserialize(bytes, offset, formatterResolver, out readSize);
                    break;

                case 2:
                    __ack_no__ = MessagePackBinary.ReadUInt64(bytes, offset, out readSize);
                    break;

                default:
                    readSize = global::MessagePack.MessagePackBinary.ReadNextBlock(bytes, offset);
                    break;
                }
                offset += readSize;
            }

            readSize = offset - startOffset;

            var ____result = new global::UniP2P.LLAPI.UdpPacketObjects();

            ____result.UdpPacketObjectArray = __UdpPacketObjectArray__;
            ____result.PeerID = __PeerID__;
            ____result.ack_no = __ack_no__;
            return(____result);
        }
        public global::Shared.MessagePackObjects.Player Deserialize(byte[] bytes, int offset, global::MessagePack.IFormatterResolver formatterResolver, out int readSize)
        {
            if (global::MessagePack.MessagePackBinary.IsNil(bytes, offset))
            {
                readSize = 1;
                return(null);
            }

            var startOffset = offset;
            var length      = global::MessagePack.MessagePackBinary.ReadArrayHeader(bytes, offset, out readSize);

            offset += readSize;

            var __Name__     = default(string);
            var __Position__ = default(global::UnityEngine.Vector3);
            var __Rotation__ = default(global::UnityEngine.Quaternion);

            for (int i = 0; i < length; i++)
            {
                var key = i;

                switch (key)
                {
                case 0:
                    __Name__ = formatterResolver.GetFormatterWithVerify <string>().Deserialize(bytes, offset, formatterResolver, out readSize);
                    break;

                case 1:
                    __Position__ = formatterResolver.GetFormatterWithVerify <global::UnityEngine.Vector3>().Deserialize(bytes, offset, formatterResolver, out readSize);
                    break;

                case 2:
                    __Rotation__ = formatterResolver.GetFormatterWithVerify <global::UnityEngine.Quaternion>().Deserialize(bytes, offset, formatterResolver, out readSize);
                    break;

                default:
                    readSize = global::MessagePack.MessagePackBinary.ReadNextBlock(bytes, offset);
                    break;
                }
                offset += readSize;
            }

            readSize = offset - startOffset;

            var ____result = new global::Shared.MessagePackObjects.Player();

            ____result.Name     = __Name__;
            ____result.Position = __Position__;
            ____result.Rotation = __Rotation__;
            return(____result);
        }
Beispiel #24
0
        public int Serialize(ref byte[] bytes, int offset, global::LocalizationUnit value, global::MessagePack.IFormatterResolver formatterResolver)
        {
            if (value == null)
            {
                return(global::MessagePack.MessagePackBinary.WriteNil(ref bytes, offset));
            }

            var startOffset = offset;

            offset += global::MessagePack.MessagePackBinary.WriteFixedArrayHeaderUnsafe(ref bytes, offset, 2);
            offset += formatterResolver.GetFormatterWithVerify <string>().Serialize(ref bytes, offset, value.Name, formatterResolver);
            offset += formatterResolver.GetFormatterWithVerify <global::System.Collections.Generic.Dictionary <string, string> >().Serialize(ref bytes, offset, value.Values, formatterResolver);
            return(offset - startOffset);
        }
Beispiel #25
0
        public global::UniP2P.HLAPI.StreamPacketInstance Deserialize(byte[] bytes, int offset, global::MessagePack.IFormatterResolver formatterResolver, out int readSize)
        {
            if (global::MessagePack.MessagePackBinary.IsNil(bytes, offset))
            {
                throw new InvalidOperationException("typecode is null, struct not supported");
            }

            var startOffset = offset;
            var length      = global::MessagePack.MessagePackBinary.ReadArrayHeader(bytes, offset, out readSize);

            offset += readSize;

            var __Position__      = default(global::UnityEngine.Vector3);
            var __Quaternion__    = default(global::UnityEngine.Quaternion);
            var __NetInstanceID__ = default(string);

            for (int i = 0; i < length; i++)
            {
                var key = i;

                switch (key)
                {
                case 0:
                    __Position__ = formatterResolver.GetFormatterWithVerify <global::UnityEngine.Vector3>().Deserialize(bytes, offset, formatterResolver, out readSize);
                    break;

                case 1:
                    __Quaternion__ = formatterResolver.GetFormatterWithVerify <global::UnityEngine.Quaternion>().Deserialize(bytes, offset, formatterResolver, out readSize);
                    break;

                case 2:
                    __NetInstanceID__ = formatterResolver.GetFormatterWithVerify <string>().Deserialize(bytes, offset, formatterResolver, out readSize);
                    break;

                default:
                    readSize = global::MessagePack.MessagePackBinary.ReadNextBlock(bytes, offset);
                    break;
                }
                offset += readSize;
            }

            readSize = offset - startOffset;

            var ____result = new global::UniP2P.HLAPI.StreamPacketInstance();

            ____result.Position      = __Position__;
            ____result.Quaternion    = __Quaternion__;
            ____result.NetInstanceID = __NetInstanceID__;
            return(____result);
        }
        public global::RM.Hotel.Models.Hotel Deserialize(byte[] bytes, int offset, global::MessagePack.IFormatterResolver formatterResolver, out int readSize)
        {
            if (global::MessagePack.MessagePackBinary.IsNil(bytes, offset))
            {
                throw new InvalidOperationException("typecode is null, struct not supported");
            }

            var startOffset = offset;
            var length      = global::MessagePack.MessagePackBinary.ReadArrayHeader(bytes, offset, out readSize);

            offset += readSize;

            var __Name__  = default(string);
            var __Level__ = default(int);
            var __Rooms__ = default(global::System.Collections.Immutable.ImmutableList <global::RM.Hotel.Models.Room>);

            for (int i = 0; i < length; i++)
            {
                var key = i;

                switch (key)
                {
                case 0:
                    __Name__ = formatterResolver.GetFormatterWithVerify <string>().Deserialize(bytes, offset, formatterResolver, out readSize);
                    break;

                case 1:
                    __Level__ = MessagePackBinary.ReadInt32(bytes, offset, out readSize);
                    break;

                case 3:
                    __Rooms__ = formatterResolver.GetFormatterWithVerify <global::System.Collections.Immutable.ImmutableList <global::RM.Hotel.Models.Room> >().Deserialize(bytes, offset, formatterResolver, out readSize);
                    break;

                default:
                    readSize = global::MessagePack.MessagePackBinary.ReadNextBlock(bytes, offset);
                    break;
                }
                offset += readSize;
            }

            readSize = offset - startOffset;

            var ____result = new global::RM.Hotel.Models.Hotel();

            ____result.Name  = __Name__;
            ____result.Level = __Level__;
            ____result.Rooms = __Rooms__;
            return(____result);
        }
Beispiel #27
0
        public int Serialize(ref byte[] bytes, int offset, global::UniP2P.LLAPI.UdpPacketObjects value, global::MessagePack.IFormatterResolver formatterResolver)
        {
            if (value == null)
            {
                return(global::MessagePack.MessagePackBinary.WriteNil(ref bytes, offset));
            }

            var startOffset = offset;

            offset += global::MessagePack.MessagePackBinary.WriteFixedArrayHeaderUnsafe(ref bytes, offset, 3);
            offset += formatterResolver.GetFormatterWithVerify <global::UniP2P.LLAPI.UdpPacketObject[]>().Serialize(ref bytes, offset, value.UdpPacketObjectArray, formatterResolver);
            offset += formatterResolver.GetFormatterWithVerify <string>().Serialize(ref bytes, offset, value.PeerID, formatterResolver);
            offset += MessagePackBinary.WriteUInt64(ref bytes, offset, value.ack_no);
            return(offset - startOffset);
        }
        public int Serialize(ref byte[] bytes, int offset, global::RM.Hotel.ActionEvent value, global::MessagePack.IFormatterResolver formatterResolver)
        {
            if (value == null)
            {
                return(global::MessagePack.MessagePackBinary.WriteNil(ref bytes, offset));
            }

            var startOffset = offset;

            offset += global::MessagePack.MessagePackBinary.WriteFixedArrayHeaderUnsafe(ref bytes, offset, 3);
            offset += MessagePackBinary.WriteUInt32(ref bytes, offset, value.Id);
            offset += formatterResolver.GetFormatterWithVerify <string>().Serialize(ref bytes, offset, value.Hash, formatterResolver);
            offset += formatterResolver.GetFormatterWithVerify <global::MagicSpritz.IAction>().Serialize(ref bytes, offset, value.Action, formatterResolver);
            return(offset - startOffset);
        }
        public int Serialize(ref byte[] bytes, int offset, global::Shared.MessagePackObjects.Player value, global::MessagePack.IFormatterResolver formatterResolver)
        {
            if (value == null)
            {
                return(global::MessagePack.MessagePackBinary.WriteNil(ref bytes, offset));
            }

            var startOffset = offset;

            offset += global::MessagePack.MessagePackBinary.WriteFixedArrayHeaderUnsafe(ref bytes, offset, 3);
            offset += formatterResolver.GetFormatterWithVerify <string>().Serialize(ref bytes, offset, value.Name, formatterResolver);
            offset += formatterResolver.GetFormatterWithVerify <global::UnityEngine.Vector3>().Serialize(ref bytes, offset, value.Position, formatterResolver);
            offset += formatterResolver.GetFormatterWithVerify <global::UnityEngine.Quaternion>().Serialize(ref bytes, offset, value.Rotation, formatterResolver);
            return(offset - startOffset);
        }
Beispiel #30
0
        public global::IMessagePackUnion Deserialize(byte[] bytes, int offset, global::MessagePack.IFormatterResolver formatterResolver, out int readSize)
        {
            if (MessagePackBinary.IsNil(bytes, offset))
            {
                readSize = 1;
                return(null);
            }

            var startOffset = offset;

            if (MessagePackBinary.ReadArrayHeader(bytes, offset, out readSize) != 2)
            {
                throw new InvalidOperationException("Invalid Union data was detected. Type:global::IMessagePackUnion");
            }
            offset += readSize;

            var key = MessagePackBinary.ReadInt32(bytes, offset, out readSize);

            offset += readSize;

            if (!this.keyToJumpMap.TryGetValue(key, out key))
            {
                key = -1;
            }

            global::IMessagePackUnion result = null;

            switch (key)
            {
            case 0:
                result  = (global::IMessagePackUnion)formatterResolver.GetFormatterWithVerify <global::PackableARWorldMap>().Deserialize(bytes, offset, formatterResolver, out readSize);
                offset += readSize;
                break;

            case 1:
                result  = (global::IMessagePackUnion)formatterResolver.GetFormatterWithVerify <global::PackableARUserAnchor>().Deserialize(bytes, offset, formatterResolver, out readSize);
                offset += readSize;
                break;

            default:
                offset += MessagePackBinary.ReadNextBlock(bytes, offset);
                break;
            }

            readSize = offset - startOffset;

            return(result);
        }