Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
Denormalize map and time of match result into player result
Browse files Browse the repository at this point in the history
  • Loading branch information
Jannis Lehmann committed Jan 14, 2022
1 parent d928b51 commit f4c5e06
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/demoparser/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
log "github.com/sirupsen/logrus"
)

const ParserVersion = 11
const ParserVersion = 12

var configService *config.Service
var matchService *match.Service
Expand Down Expand Up @@ -128,6 +128,8 @@ func worker(matches <-chan *match.Match) {
}

playerResult.MatchID = m.ID
playerResult.Map = m.Result.Map
playerResult.Time = m.Result.Time
playerResult.MatchRounds = byte(len(m.Result.Rounds))
playerResult.ScoreOwnTeam = t.Wins

Expand Down
2 changes: 2 additions & 0 deletions internal/domain/player/entity.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ type Player struct {
// PlayerResult holds different performance metrics from one game.
type PlayerResult struct {
MatchID entity.ID `json:"matchId" bson:"matchId" validation:"required"`
Time time.Time `json:"time" bson:"time" validate:"required"`
Map string `json:"map" bson:"map" validate:"required"`
MatchRounds byte `json:"matchRounds" bson:"matchRounds" validation:"required"`
ScoreOwnTeam byte `json:"scoreOwnTeam" bson:"scoreOwnTeam"`
ScoreEnemyTeam byte `json:"scoreEnemyTeam" bson:"scoreEnemyTeam"`
Expand Down

0 comments on commit f4c5e06

Please sign in to comment.