first :- 0x7021 is not encrypted .
second :-u must use
p1.WriteUInt8(0x01); Not
p1.WriteInt8(0x01);
it is unsigned integers not signed .
Third and your problem source :-
u must reverse the bytes order when u read or write from a stream that's how streams works .example lets build sit down packet 0x704f
its opcode is =0x704f
its security bytes =xxxx (dont care about those bytes for now)
its data is =0x04
its data size = 0001 byte
packet build = data size + opcode +security bytes +data
packet = 0x 0100 4f70 xxxx 04
so in your case the code is :-
Code:
Packet p1 = new Packet(0x7021,false,false);
p1.WriteUInt8(0x01);
p1.WriteUInt16(0x6699);
p1.WriteUInt16(0x02de);
p1.WriteUInt16(0xff98);
p1.WriteUInt16(0x01b9);