From 97caa98578a43b0d65914ffc9b44a39035a3dd9d Mon Sep 17 00:00:00 2001 From: = <=> Date: Thu, 13 Jun 2024 11:55:01 +0100 Subject: [PATCH] Fix datastore types --- game/game.go | 59 +++++++++++++++++++++++----------------------------- 1 file changed, 26 insertions(+), 33 deletions(-) diff --git a/game/game.go b/game/game.go index 0bcbbe0..6aaf6cc 100644 --- a/game/game.go +++ b/game/game.go @@ -424,16 +424,6 @@ func (g Games) Item(r Request, user *auth.User, cursor *datastore.Cursor, limit return gamesItem } -type DiscordWebhook struct { - Id string - Token string -} - -type DiscordWebhooks struct { - GameStarted DiscordWebhook - PhaseStarted DiscordWebhook -} - type Game struct { ID *datastore.Key `datastore:"-"` @@ -442,29 +432,32 @@ type Game struct { Closed bool // Game is no longer joinable. Finished bool // Game has reached its end. - Desc string `methods:"POST,PUT" datastore:",noindex"` - Variant string `methods:"POST"` - PhaseLengthMinutes time.Duration `methods:"POST,PUT"` - NonMovementPhaseLengthMinutes time.Duration `methods:"POST,PUT"` - MaxHated float64 `methods:"POST"` - MaxHater float64 `methods:"POST"` - MinRating float64 `methods:"POST"` - MaxRating float64 `methods:"POST"` - MinReliability float64 `methods:"POST"` - MinQuickness float64 `methods:"POST"` - Private bool `methods:"POST"` - NoMerge bool `methods:"POST"` - DisableConferenceChat bool `methods:"POST,PUT"` - DisableGroupChat bool `methods:"POST,PUT"` - DisablePrivateChat bool `methods:"POST,PUT"` - NationAllocation AllocationMethod `methods:"POST"` - Anonymous bool `methods:"POST"` - LastYear int `methods:"POST,PUT"` - SkipMuster bool `methods:"POST,PUT"` - ChatLanguageISO639_1 string `methods:"POST,PUT"` - GameMasterEnabled bool `methods:"POST"` - RequireGameMasterInvitation bool `methods:"POST,PUT"` - DiscordWebhooks *DiscordWebhooks `methods:"POST" datastore:",noindex"` + Desc string `methods:"POST,PUT" datastore:",noindex"` + Variant string `methods:"POST"` + PhaseLengthMinutes time.Duration `methods:"POST,PUT"` + NonMovementPhaseLengthMinutes time.Duration `methods:"POST,PUT"` + MaxHated float64 `methods:"POST"` + MaxHater float64 `methods:"POST"` + MinRating float64 `methods:"POST"` + MaxRating float64 `methods:"POST"` + MinReliability float64 `methods:"POST"` + MinQuickness float64 `methods:"POST"` + Private bool `methods:"POST"` + NoMerge bool `methods:"POST"` + DisableConferenceChat bool `methods:"POST,PUT"` + DisableGroupChat bool `methods:"POST,PUT"` + DisablePrivateChat bool `methods:"POST,PUT"` + NationAllocation AllocationMethod `methods:"POST"` + Anonymous bool `methods:"POST"` + LastYear int `methods:"POST,PUT"` + SkipMuster bool `methods:"POST,PUT"` + ChatLanguageISO639_1 string `methods:"POST,PUT"` + GameMasterEnabled bool `methods:"POST"` + RequireGameMasterInvitation bool `methods:"POST,PUT"` + GameStartedDiscordWebhookId string `json:",omitempty" methods:"POST" datastore:",noindex"` + GameStartedDiscordWebhookToken string `json:",omitempty" methods:"POST" datastore:",noindex"` + PhaseStartedDiscordWebhookId string `json:",omitempty" methods:"POST" datastore:",noindex"` + PhaseStartedDiscordWebhookToken string `json:",omitempty" methods:"POST" datastore:",noindex"` GameMasterInvitations GameMasterInvitations GameMaster auth.User