Orange Stats is a Python script that will parse Team Fortress 2 server log files in order to aggregate the data for later use. Regular expressions capture events as written to the log file by the game server. Each event has a corresponding structure containing various information such as : date , time, victim, aggressor, weapon type, event type and other event specific information. Team Fortress 2 adds a vast array of new gameplay and class specific events which extend the Half-Life 2 log file structure. More information can be obtained from Valve Developer Community here.
Orange Stats will insert extracted data into a database for later use by a web front-end or a Team Fortress 2 in-game plugin. The table schema is a bare bones implementation that supports CP map style gameplay. Design requirements focused on simplicity and light weight code implementation. Following game events are captured and categorized :
- Map load
- Join Team
- Point Capture
- Point Capture Block
- Pick Character Class
- Player Death
- Player Assist
- Built Object
- Destroy Object
- Steam user events ( user ticket validation )
Character class specific data extraction works for events such as:
- Sapper events, Uber charge events, Engineer object events
Back end runs a light PHP script.
Python script is located here .