TrinityCore / WowPacketParser

World of Warcraft Packet Parser
GNU General Public License v3.0
431 stars 357 forks source link

Moving from a text-based to an XML-based output representation #293

Open ennioVisco opened 7 years ago

ennioVisco commented 7 years ago

Hi all,

since I wanted to work on the topic discussed on Trinitycore - Tool for Scripters/DB devs , I think that a first preparation step needed is to format the output in a more efficient and machine-readable way.

XML seems to be a good candidate since it is tree based (and therefore efficiently explorable) and can be compressed really well (ever heard about EXI)?

I'm doing some experiments on my fork, any ideas about this?

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/42653671-moving-from-a-text-based-to-an-xml-based-output-representation?utm_campaign=plugin&utm_content=tracker%2F457228&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F457228&utm_medium=issues&utm_source=github).
DDuarte commented 7 years ago

I would agree with XML, if we were in 2005. I prefer JSON by a large margin.

However, we do not need to commit to a single output format, we can support both output writers, that use the same intermediate format.

binary PKT -> intermediate format -> output (text, xml, json, etc.)

I'm happy do discuss this so drop by the IRC some time :)

ennioVisco commented 7 years ago

Clearly my idea was not to bound the output to xml but to properly abstract it. Btw XML and JSON are not just two equivalent alternatives.... JSON is way better for data transfer but not that good for languages description, it is not just a metter of syntax :)

I'll be glad to discuss about it on IRC :)

DDuarte commented 7 years ago

First part: moving handlers to proper structs/classes https://github.com/TrinityCore/WowPacketParser/tree/handlers_refactor

Second part: Serialization of structs to other formats https://github.com/TrinityCore/WowPacketParser/pull/296