tf2logparser
tf2logparser copied to clipboard
Refine API to Work in Realtime Environment
Have the parser object inherit from EventEmitter.
Possible Events:
line
: when each line has been parsed, set a callback that could return the log object (or delta, see below) and scrubbed line (scrubbed of potentially sensitive information, ie. IPs, sourcemod commands, corrupted lines)
complete
: when processing is completed, return full log object.
error
: when any error ocurrs (this may be automatically provided by EventEmitter
Deltas
In order to conserve memory consumption, at least when processing logs in real time, it might be wise for each line to only report back a list of changes that should occur on a log object, as opposed to actually doing the changes on the log object. This way, we can hook the line
event, get the deltas, and just commit those to mongoDB, instead of throwing it a gigantic object. This will probably only need to be present in the real time context, where multiple log parser objects could be present, and if huge objects were being saved to memory, this would present an issue with memory overuse.
EventEmitter conversion is done. Instead of complete
using the done
event.
Todo this weekend:
Add deltas for events and positions - this should be a return value from parseLine. Add support for the player spawn portion of the supp stats plugin Add events for score changes, team swaps Update docs for 0.2.0 - mainly real time aspect
I know this is super old, but... I hacked together a tf2 log replayer that you may find useful.