Пример #1
0
        public byte[] Serialize(IntersectPacket pkt)
        {
            var packedPacket = new PackedIntersectPacket(pkt)
            {
                Data = MessagePackSerializer.Serialize((object)pkt, mOptions)
            };

            return(MessagePackSerializer.Serialize((object)packedPacket, mCompressedOptions));
        }
        public PackedIntersectPacket(IntersectPacket packet)
        {
            if (!KnownTypes.TryGetValue(packet.GetType(), out var key))
            {
                throw new ArgumentException($"Type not a known packet type: {packet.GetType().FullName}");
            }

            Key = key;
        }