mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
Add movement packed GUID, inventory money display, and character screen buttons
Fix movement packets to include packed player GUID prefix so the server tracks position. Fix inventory money display being clipped by child panels. Add Back and Delete Character buttons to character selection screen with two-step delete confirmation.
This commit is contained in:
parent
82e63fc95d
commit
fbeb14fc98
9 changed files with 156 additions and 15 deletions
|
|
@ -517,16 +517,33 @@ bool PongParser::parse(network::Packet& packet, PongData& data) {
|
|||
return true;
|
||||
}
|
||||
|
||||
network::Packet MovementPacket::build(Opcode opcode, const MovementInfo& info) {
|
||||
network::Packet MovementPacket::build(Opcode opcode, const MovementInfo& info, uint64_t playerGuid) {
|
||||
network::Packet packet(static_cast<uint16_t>(opcode));
|
||||
|
||||
// Movement packet format (WoW 3.3.5a):
|
||||
// packed GUID
|
||||
// uint32 flags
|
||||
// uint16 flags2
|
||||
// uint32 time
|
||||
// float x, y, z
|
||||
// float orientation
|
||||
|
||||
// Write packed GUID
|
||||
uint8_t mask = 0;
|
||||
uint8_t guidBytes[8];
|
||||
int guidByteCount = 0;
|
||||
for (int i = 0; i < 8; i++) {
|
||||
uint8_t byte = static_cast<uint8_t>((playerGuid >> (i * 8)) & 0xFF);
|
||||
if (byte != 0) {
|
||||
mask |= (1 << i);
|
||||
guidBytes[guidByteCount++] = byte;
|
||||
}
|
||||
}
|
||||
packet.writeUInt8(mask);
|
||||
for (int i = 0; i < guidByteCount; i++) {
|
||||
packet.writeUInt8(guidBytes[i]);
|
||||
}
|
||||
|
||||
// Write movement flags
|
||||
packet.writeUInt32(info.flags);
|
||||
packet.writeUInt16(info.flags2);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue