- Parse Quake 3 Arena Log Files: Efficiently processes large log files generated by the Quake 3 Arena server.
- Game Grouping: Automatically detects and groups data by game sessions.
- Player Statistics: Tracks players, their kills, and how they were killed.
- Kill Method Analysis: Groups kills by the method of death for each match.
- Flexible Input: Can read log data from various sources using the
io.Reader
interface.
- Go 1.16 or later
git clone https://github.com/Rarfael/quake-log-parser.git
cd quake-log-parser
To run the parser and generate reports, ensure that you have a log file (quake.log
) in the project directory:
go run main.go
main.go
: Entry point of the application. Handles file input and invokes the parsing and reporting functions.parser.go
: Contains the logic for parsing the log file and extracting game-related data.reports.go
: Responsible for generating structured reports from the parsed data.parser_test.go
: Contains unit tests for the game parsing functionality.reports_test.go
: Contains unit tests for the report generation functionality.
Here’s an example of the structured output generated by the parser:
"game_1": {
"total_kills": 45,
"players": ["Dono da bola", "Isgalamido", "Zeh"],
"kills": {
"Dono da bola": 5,
"Isgalamido": 18,
"Zeh": 20
},
"kills_by_means": {
"MOD_SHOTGUN": 10,
"MOD_RAILGUN": 2,
"MOD_GAUNTLET": 1
}
}
The project includes a suite of unit tests to ensure the accuracy and reliability of the log parser.
To run the test suite, use the following command:
go test ./...
The tests cover various scenarios including:
- Multiple games within a single log file
- Games with no kills
- Handling of kills by
<world>
- Edge cases such as no players in a game