Tuesday, July 10, 2012

Achievement Tracker (redone)

Hiho!

The achievement tracker has suffered some vital changes. We are now strictly event driven, which should give a nice performance boost.

XML data gets processed using SAX. This way we can avoid building a DOM tree inside the RAM while extracting data.

The parser knows two different types of data: values and entities. Values are simple values like "key=>value". Entities are dataset that belong together like "pet"=>(x,y,z,sheet_id,satiety,....)

Instead of asking the parser to extract information from the XML, the atom scripts now register which values or entities they are interested in, providing a callback method. Once all atoms have been registered, the parser is started. It will extract the data from top to bottom, sending it to the dispatcher which passes it on to the atoms. Worst case: no atom wants the data => nothing happens.

Well, that's ist basically :)

yours Cotare

No comments:

Post a Comment