bot4dofus / Datafus

📚🥚 The Dofus database and socket events in JSON files. Includes the source code and more...
https://discord.gg/kNHsFcbUGp
MIT License
50 stars 13 forks source link

feat(U1): add TypeId<> and TypeIdVector<> #42

Closed ledouxm closed 11 months ago

ledouxm commented 11 months ago

This is a copy of the PR #38 which was a copy of the PR #36

Hi, i also developped a tool that does pretty much the same but i think having a single repo which we rely on could be a great thing for the ecosystem.

Sadly, as this https://github.com/bot4dofus/Datafus/issues/29states, the events.json file isn't complete enough to read a message.

This PR aims to fix this by adding two new types along with Vector :

"TypeId" means the entity we have to read can be identified by its id that we get reading a short from the buffer
"TypeIdVector<Short, BaseEntity>" means the buffer contains a vector with a length encoded in a short, and for every item of the array we have to read a short to get the id of the matching entity.
I can clarify any point if needed !