Could someone help me out?
I know I adjust the buffer length but it PlayerInfo(1006) / SpawnPlayer(10014)?
Heres what I got for SpawnPlayer
Code:
public static implicit operator byte[](SpawnPlayerPacket packet)
{
var buffer = new byte[220 + packet.Strings.Length + 8];
fixed (byte* ptr = buffer)
{
PacketBuilder.AppendHeader(ptr, buffer.Length, 10014);
*((uint*) (ptr + 4)) = packet.Lookface;
*((uint*) (ptr + 8)) = packet.Id;
*((uint*) (ptr + 12)) = packet.GuildId;
*((GuildRank*) (ptr + 16)) = packet.GuildRank;
*((uint*) (ptr + 18)) = packet.Unknown18;
*((ulong*) (ptr + 22)) = packet.Effect1;
*((ulong*) (ptr + 30)) = packet.Effect2;
//all up 2
*((uint*)(ptr + 44)) = packet.HelmetType;
*((uint*)(ptr + 48)) = packet.GarmentType;
*((uint*) (ptr + 52)) = packet.ArmorType;
*((uint*) (ptr + 56)) = packet.WeaponLType;
*((uint*) (ptr + 60)) = packet.WeaponRType;
*((uint*) (ptr + 68)) = packet.AccessoryRType;
*((uint*) (ptr + 64)) = packet.AccessoryLType;
*((uint*)(ptr + 72)) = packet.MountType;
*((uint*)(ptr + 76)) = packet.MountArmor;
*((ushort*)(ptr + 86)) = packet.Life;
*((ushort*)(ptr + 82)) = packet.MobLevel;
*((ushort*)(ptr + 98)) = packet.Hair;
*((ushort*)(ptr + 94)) = packet.PositionX;
*((ushort*)(ptr + 96)) = packet.PositionY;
*(ptr + 100) = packet.Direction;
*(ptr + 101) = packet.Action;
*((ushort*) (ptr + 94)) = packet.Unknown86;
*((uint*) (ptr + 96)) = packet.Unknown88;
*(ptr + 108) = packet.Rebirth;
*((ushort*) (ptr + 109)) = packet.Level;
*((uint*)(ptr + 112)) = packet.Away;
*(ptr + 133) = (byte) packet.Nobility;
*((ushort*)(ptr + 137)) = packet.ArmorColor;
*((ushort*)(ptr + 139)) = packet.ShieldColor;
*((ushort*)(ptr + 141)) = packet.HelmetColor;
*((uint*)(ptr + 142)) = packet.QuizPoints;
*((byte*)(ptr + 147)) = packet.MountPlus;
*((uint*)(ptr + 153)) = packet.MountColor;
*((PlayerTitle*)(ptr + 181)) = packet.Title;
if (packet.Boss)
*((byte*)(ptr + 181)) = 1;
*((uint*)(ptr + 196)) = packet.HelmetArtifactType;
*((uint*)(ptr + 200)) = packet.ArmorArtifactType;
*((uint*)(ptr + 204)) = packet.WeaponLArtifactType;
*((uint*)(ptr + 208)) = packet.WeaponRArtifactType;
//*((uint*)(ptr + 212)) = packet.ActiveSubClass;
//*((byte*)(ptr + 221)) = packet.FirstRebornClass;
//*((byte*) (ptr + 223)) = packet.SecondRebornClass;
*((byte*)(ptr + 225)) = packet.Profession;
PacketBuilder.AppendNetStringPacker(ptr + 220, packet.Strings);
}
return buffer;
}
Code:
public static implicit operator byte[](PlayerInfoPacket packet)
{//108
var buffer = new byte[112 + packet.StringPacker.Length + 8];
fixed (byte* ptr = buffer)
{
PacketBuilder.AppendHeader(ptr, buffer.Length, 1006);
*((uint*)(ptr + 4)) = packet.Id;
//new ushort for what?
*((uint*)(ptr + 10)) = packet.Lookface;
*((ushort*)(ptr + 14)) = packet.Hair;
*((uint*)(ptr + 16)) = packet.Money;
*((uint*)(ptr + 20)) = packet.EMoney;
*((ulong*)(ptr + 24)) = packet.Experience;
*((uint*)(ptr + 32)) = packet.Unknown1;
*((uint*)(ptr + 36)) = packet.Unknown2;
*((uint*)(ptr + 40)) = packet.Unknown3;
*((uint*)(ptr + 44)) = packet.Unknown4;
*((uint*)(ptr + 48)) = packet.Unknown5;
*((ushort*)(ptr + 52)) = packet.Strength;
*((ushort*)(ptr + 54)) = packet.Agility;
*((ushort*)(ptr + 56)) = packet.Vitality;
*((ushort*)(ptr + 58)) = packet.Spirit;
*((ushort*)(ptr + 60)) = packet.AdditionalPoint;
*((ushort*)(ptr + 62)) = packet.Life;
*((ushort*)(ptr + 64)) = packet.Mana;
*((short*)(ptr + 66)) = packet.Pk;
*(ptr + 68) = packet.Level;
*(ptr + 69) = packet.Profession;
*(ptr + 70) = packet.Metempsychosis;
*(ptr + 71) = packet.Unknown6;
*(ptr + 72) = packet.Unknown7;
*(ptr + 73) = packet.Unknown8;
*(ptr + 74) = packet.NamesDisplayed;
*(ptr + 75) = packet.Unknown18;
*(ptr + 76) = packet.Unknown19;
*((uint*)(ptr + 77)) = packet.Unknown9;
*((uint*)(ptr + 81)) = packet.Unknown10;
*((uint*)(ptr + 85)) = packet.Unknown11;
*((ushort*)(ptr + 89)) = packet.Unknown87;
*((PlayerTitle*)(ptr + 91)) = packet.Title;
*(ptr + 92) = packet.Unknown90;
*((uint*)(ptr + 93)) = packet.Unknown91;
*((uint*)(ptr + 97)) = packet.Unknown95;
*((uint*)(ptr + 101)) = packet.Unknown99;
*((uint*)(ptr + 105)) = packet.Unknown103;
*(ptr + 109) = packet.Unknown107;
PacketBuilder.AppendNetStringPacker(ptr + 110, packet.StringPacker);
}
return buffer;
}






