Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NameToPath ¶
func ProcessGame ¶
func ProcessGame(dctx *DocumentContext) error
Types ¶
type ChatChannel ¶
type ChatMessage ¶
type DocumentContext ¶
type DocumentContext struct { TX *firestore.Transaction ReprocessAt func(time.Time) error Ref *firestore.DocumentRef }
type Game ¶
type Game struct { CreatorUID string `{ "get": "", "create": "post.CreatorUID == request.auth.uid" }` // GM OwnerUID string `` /* 591-byte string literal not displayed */ // New GM ReplacementOwnerUID string `{ "create": "", "update": "" }` // Latest phase metadata PhaseMeta PhaseMeta // GM action necessary to join InvitationRequired bool `{ "create": "", "update": "" }` Desc string `{ "create": "", "update": "" }` NationSelection string `` /* 139-byte string literal not displayed */ // Roll call required to start MusteringRequired bool `{ "create": "", "update": "" }` // Make players replaceable automatically after this many NMRs NMRsBeforeReplaceable int `{ "create": "", "update": "" }` NMRsPerPlayer map[string]int // Time added if someone NMRs GraceLengthMinutes int `{ "create": "", "update": "" }` // Nr of times allowed per player per game GracesPerPlayer int `{ "create": "", "update": "" }` // Memory of above GracesUsedPerPlayer map[string]int // Nr ot times allowed per phase GracesPerPhase int `{ "create": "", "update": "" }` // Max time added on request MaxExtensionLengthMinutes int `{ "create": "", "update": "" }` // Nr of times allowed per player per game ExtensionsPerPlayer int `{ "create": "", "update": "" }` // Memory of above ExtensionsUsedPerPlayer map[string]int // Nr of times allowed per phase ExtensionsPerPhase int `{ "create": "", "update": "" }` // Vote ratio required for extensions not of the above type PlayerRatioForExtraExtensionVote float64 `{ "create": "", "update": "" }` PhaseLengthMinutes int `{ "create": "post.get(\"PhaseLengthMinutes\", 0) >= 0", "update": "post.get(\"PhaseLengthMinutes\", 0) >= 0" }` // ALL phases not regular movement NonMovementPhaseLengthMinutes int `` /* 135-byte string literal not displayed */ // Use this timezone when deciding if it's an OK time to start. DontStartLimitTimezone string `{ "create": "", "update": "" }` // Don't start before this time. DontStartBeforeMinuteInDay int `` /* 239-byte string literal not displayed */ // Don't start after this time. DontStartAfterMinuteInDay int `` /* 235-byte string literal not displayed */ // (Non-NMR phases + 1) / (NMR phases + 1) MinReliability float64 `{ "create": "post.get(\"MinReliability\", 0) >= 0", "update": "post.get(\"MinReliability\", 0) >= 0" }` // (Submitted phases + 1) / (Non-submitted phases + 1) MinQuickness float64 `{ "create": "post.get(\"MinQuickness\", 0) >= 0", "update": "post.get(\"MinQuickness\", 0) >= 0" }` // TrueSkill, probably MinRating float64 `{ "create": "post.get(\"MinRating\", 0) >= 0", "update": "post.get(\"MinRating\", 0) >= 0" }` // Unlisted Private bool `{ "create": "", "update": "" }` // All player chat DisableConferenceChat bool `{ "create": "", "update": "" }` // > 2 < all player chat DisableGroupChat bool `{ "create": "", "update": "" }` // 2 player chat DisablePrivateChat bool `{ "create": "", "update": "" }` Variant string `{ "create": "exists(/databases/$(database)/documents/Variant/$(post.Variant)) // variant must exist" }` // Players replaceable according to GM or NMR counter ReplaceablePlayers []string `{ "update": "{{Unique}}" }` // Controlled by `Players` InvitedPlayers []string `{ "create": "{{Unique}}", "update": "{{Unique}}" }` InvitedNations []string `{ "create": "", "update": "" }` MusteredPlayers []string `` /* 261-byte string literal not displayed */ // Owner and all players Members []string `` /* 973-byte string literal not displayed */ Players []string `` /* 3259-byte string literal not displayed */ PlayerNations map[string]string // 1000 for unstarted games, 100 for started games, and 10000 for finished games, for the global game list of a player. CategorySortKey int `{ "create": "post.CategorySortKey == 1000 // created games must have category sort key 1000" }` // Estimated start time for seeded games, next phase deadline for live games, or finished-at for finished games. TimeSortKey time.Time CreatedAt time.Time // Game has received the first phase from the cloud functions. Seeded bool SeededAt time.Time // All necessary players have reported as ready to play (or game didn't require that to happen). Mustered bool MusteredAt time.Time // Game is possible to join. Open bool // Game has all necessary players. Started bool StartedAt time.Time // Game has finished. Finished bool FinishedAt time.Time // Last error that happened to the game. ErrorMessage string }
type Phase ¶
type Preference ¶
type Preference struct {
Prefs []string `` /* 751-byte string literal not displayed */
}
type User ¶
type User struct { Username string `{ "create": "", "update": "" }` PictureURL string `{ "create": "", "update": "" }` Rating float64 `` /* 179-byte string literal not displayed */ Reliability float64 NMRPhases int NonNMRPhases int Quickness float64 CommittedPhases int NonCommittedPhases int BannedUsers []string `{ "create": "{{Absent}} && {{Unique}}", "update": "{{Unchanged}} && {{Unique}}" }` BannedByUsers []string }
Click to show internal directories.
Click to hide internal directories.