Exemplo n.º 1
0
 public static Offset <Packet> CreatePacket(FlatBufferBuilder builder,
                                            short opcode = 0)
 {
     builder.StartTable(1);
     Packet.AddOpcode(builder, opcode);
     return(Packet.EndPacket(builder));
 }
        public static byte[] MakePacketBuffer(Opcode opcode)
        {
            var builder = new FlatBufferBuilder(DefaultBufferBytes);

            Packet.StartPacket(builder);

            Packet.AddOpcode(builder, (short)opcode);

            var packetOffset = Packet.EndPacket(builder);

            builder.Finish(packetOffset.Value);

            return(builder.SizedByteArray());
        }