[DiscordArchive] Hey all, I'm continuing to analyze different parts of the core to get a better understanding on how
[DiscordArchive] Hey all, I'm continuing to analyze different parts of the core to get a better understanding on how
Archived author: Peacy • Posted: 2023-07-13T13:16:30.992000+00:00
Original source
Hey all, I'm continuing to analyze different parts of the core to get a better understanding on how certain things work in TC. I found something I was curious about and was wondering if anyone could help me figure it out.
When analyzing a lot of packets in the game, I noticed that they an order for example:
```c++
WorldPacket data(SMSG_LOOT_ROLL, (8 + 4 + 8 + 4 + 4 + 4 + 1 + 1 + 1));
data << uint64(guid); // guid of the item rolled
data << uint32(slot); // slot
data << uint64(target);
data << uint32(itemid); // the itemEntryId for the item that shall be rolled for
data << uint32(randomSuffix); // randomSuffix
data << uint32(randomPropertyId); // Item random property ID
data << uint8(roll);
```
So the first entry always has to be guid for example because that is what client expects it to be etc.
However, when looking at:
```c++
ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv)
```
I noticed that in this function there is a lot of for loops and checks that can skip whole parts of the packet
so if it should be in order, doesn't that break it?