Konichu wrote: Wed Aug 23, 2023 3:15 pm
On Comet you don't need to set the packet size, it will be done when the packet is being sent.
An example is not using PacketWriter. It just shows an imported packet structure from another source that doesn't work either.
Using the PackteWriter I have same result
Code: Select all
public override byte[] Encode()
{
Console.WriteLine("Sending MsgPlayer packet");
string name = "Pheasant";
var writer = new PacketWriter();
writer.Write((ushort)1014); //PacketType.MsgPlayer);// 2 - packet type
uint newId = (uint)new Random().Next(200000, 600000);
writer.Write(newId); // 4 - UID
writer.Write(104); //Pheasant 8 - MODEL
writer.Write((uint)0); // character status // 12 - STATUS FLAG
//guild
writer.Write((ushort)0); // Guild // 16 - GuildID
writer.Write((byte)0); // // 18 ??
writer.Write((byte)0); // guild rank // 19 - guild position
//items
writer.Write((uint)0); // 20 - left
writer.Write((uint)0); // 24 - right
writer.Write((uint)0); // 28 - arrmor
writer.Write((uint)0); // 32 - head
//unknown?
writer.Write((uint)0); // 36
// hp
writer.Write((ushort)33); // 40 - hitpoints
writer.Write((ushort)1); // 42 - level
//cords
writer.Write((ushort)65); // 44 - X
writer.Write((ushort)105); //46 - Y
//hairstyle
writer.Write((ushort)0); // 48 - Hairstyle
writer.Write((byte)3); // direction // 50 - facinng angle
writer.Write((byte)100); // 51 - action
//writer.Write((byte)1); // 52 - How many strings?
//writer.Write(name);// Legth + 53
// name = 54 + 8 = 62
writer.Write(new List<string>{
name
});
return writer.ToArray();
}
Code: Select all
Length:62
0000: 3E 00 F6 03 B6 0B 06 00 68 00 00 00 00 00 00 00 | >.......h....... |
0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................ |
0020: 00 00 00 00 00 00 00 00 21 00 01 00 41 00 69 00 | ........!...A.i. |
0030: 00 00 03 64 01 08 50 68 65 61 73 61 6E 74 | ...d..Pheasant |