Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bradleybonitatibus/frostparse
World of Warcraft 3.3.5a Combat Log Parser.
https://github.com/bradleybonitatibus/frostparse
combatlog go world-of-warcraft wrath-of-the-lich-king
Last synced: 27 days ago
JSON representation
World of Warcraft 3.3.5a Combat Log Parser.
- Host: GitHub
- URL: https://github.com/bradleybonitatibus/frostparse
- Owner: bradleybonitatibus
- License: apache-2.0
- Created: 2024-01-03T21:03:37.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-18T21:16:01.000Z (7 months ago)
- Last Synced: 2024-07-19T05:46:15.778Z (7 months ago)
- Topics: combatlog, go, world-of-warcraft, wrath-of-the-lich-king
- Language: Go
- Homepage:
- Size: 483 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# `frostparse`
World of Warcraft 3.3.5a Combat Log Parser library, tested against several raids on Warmane's Icecrown server.
## Overview
This combat log parser is written in `go` and provides a way to structure the
[COMBAT_LOG_EVENT](https://wowpedia.fandom.com/wiki/COMBAT_LOG_EVENT) into
well-known structures.## Data Model
The `CombatLogRecord` struct aggregates a `BaseCombatEvent`, a `Prefix` and a `Suffix`.
The `Prefix` struct is an aggregate to various prefixes, `SpellAndRangePrefix`, `EnchantPrefix`, and `EnvironmentalPrefix`. The member fields of the struct
are pointers because some properties are not populated based on the `BaseCombatEvent.EventType` field of the log record.## Usage
Basic usage will provide a means to parse the combat log file into a slice of pointers
to a `frostparse.CombatLogRecord` and you can do with the data as you please:
```go
package mainimport (
"log"
"github.com/bradleybonitatibus/frostparse"
)func main() {
pth := "C:\\Program Files (x86)\\World of Warcraft 3.3.5a\\Logs\\WoWCombatLog.txt"
p := frostparse.New(
frostparse.WithLogFile(pth),
)
data, err := p.Parse()
if err != nil {
log.Fatal("failed to parse combatlog: ", err)
}
// handle []*frostparse.CombatLogRecord how you please
}
```If you want basic summary statistics from the combat log, you can use the `Collector` struct:
```go
package mainimport (
"log"
"github.com/bradleybonitatibus/frostparse"
)func main() {
pth := "C:\\Program Files (x86)\\World of Warcraft 3.3.5a\\Logs\\WoWCombatLog.txt"
p := frostparse.New(
frostparse.WithLogFile(pth),
)
data, err := p.Parse()
if err != nil {
log.Fatal("failed to parse combatlog: ", err)
}
coll := frostparse.NewCollector(
frostparse.WithTimeresolution((time.Second*5)),
)
stats := coll.Run(data)
fmt.Println("DamageBySource: ", stats.DamageBySource)
fmt.Println("HealingBySource: ", stats.HealingBySource)
fmt.Println("DamageTakenBySource: ", stats.DamageTakenBySource)
fmt.Println("DamageTakenBySpell: ", stats.DamageTakenBySpell)
}
```