Skip to content

Commit

Permalink
sync
Browse files Browse the repository at this point in the history
  • Loading branch information
horcu committed Dec 15, 2024
1 parent 5db01a1 commit f864c70
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (

require (
github.com/google/uuid v1.6.0
github.com/horcu/pm-models v0.0.0-20241211013221-7491125d1129
github.com/horcu/pm-models v0.0.0-20241212232703-3693a7c75a8f
)

require (
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ github.com/horcu/pm-models v0.0.0-20241211012936-6f01b958d7e0 h1:ghrKmRNjBp5rgfR
github.com/horcu/pm-models v0.0.0-20241211012936-6f01b958d7e0/go.mod h1:oGBgHVh9IPvvNulqrHqDZaAj4SRHGZSvO5Q+5AefMNM=
github.com/horcu/pm-models v0.0.0-20241211013221-7491125d1129 h1:N68ic7f0C0U6LO3TxjWPQzt7Nrh1zi2X73/R6VL+0Ko=
github.com/horcu/pm-models v0.0.0-20241211013221-7491125d1129/go.mod h1:oGBgHVh9IPvvNulqrHqDZaAj4SRHGZSvO5Q+5AefMNM=
github.com/horcu/pm-models v0.0.0-20241212232703-3693a7c75a8f h1:ck7kiymP8thZhQwEGxXiXULzmHDTSkMC54xuvdjnIow=
github.com/horcu/pm-models v0.0.0-20241212232703-3693a7c75a8f/go.mod h1:oGBgHVh9IPvvNulqrHqDZaAj4SRHGZSvO5Q+5AefMNM=
github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 h1:GFCKgmp0tecUJ0sJuv4pzYCqS9+RGSn52M3FUwPs+uo=
Expand Down
8 changes: 1 addition & 7 deletions store.go
Original file line number Diff line number Diff line change
Expand Up @@ -1329,18 +1329,12 @@ func (store *Store) ArchiveStepResults(gameId string) error {
// add the step's results to the game's result node with the gamer's bin from the result as the key
for _, result := range step.Result {
for _, res := range result {
var r = game.StepResults[res.GamerId]
r = append(r, res)
game.StepResults[res.GamerId] = append(game.StepResults[res.GamerId], res)
}
}
}
}

//then remove all results from all game steps
for _, step := range game.Steps {
step.Result = nil
}

//publish the changes to the game node
err = store.Update(gameId, map[string]interface{}{
"steps": game.Steps,
Expand Down

0 comments on commit f864c70

Please sign in to comment.