コード例 #1
0
        public byte[] Serialize(IntersectPacket pkt)
        {
            var packedPacket = new PackedIntersectPacket(pkt)
            {
                Data = MessagePackSerializer.Serialize((object)pkt, mOptions)
            };

            return(MessagePackSerializer.Serialize((object)packedPacket, mCompressedOptions));
        }
コード例 #2
0
        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;
        }