Skip to content

Rarfael/quake-log-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quake Log Parser

Features

  • 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.

Installation

Prerequisites

  • Go 1.16 or later

Clone the Repository

git clone https://github.com/Rarfael/quake-log-parser.git
cd quake-log-parser

Running the 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

Project Structure

  • 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.

Example Output

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
  }
}

Testing

The project includes a suite of unit tests to ensure the accuracy and reliability of the log parser.

Running Tests

To run the test suite, use the following command:

go test ./...

Test Coverage

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

About

Parser Quake 3 Arena server log files

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages