feat(gamemode): make skill and whitelist config per gamemode - #823
Open
garrappachc wants to merge 1 commit into
Open
garrappachc wants to merge 1 commit into
garrappachc wants to merge 1 commit into
Conversation
Make the three gamemode-specific configuration keys — games.whitelist_id, queue.player_skill_threshold, games.default_player_skill — hold an independent value per gamemode, so a multi-gamemode instance can gate each queue and configure each game server on its own settings. A scoped key is stored under its bare name for the default gamemode (existing data and single-gamemode instances are untouched) and namespaced as `key#gamemode` for the rest; every other key stays global. `configuration.get(key, gamemode?)` resolves it. Runtime reads now pass the gamemode in scope: the queue join skill check uses the slot's gamemode, game creation and rcon configure use the game's. Admin pages still edit the default gamemode's value — per-gamemode editing is a follow-up. Also finishes the routing bits deferred from the queue-pages PR: the "Clear queue" button and `DELETE /queue/players` act on the viewed gamemode, and `GET /api/v1/queue` accepts `?gamemode` (defaulting to the instance default). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of the multi-gamemode (5.0.0) stack. Base: #822.
Why
Three config keys are inherently gamemode-specific — a 6v6 and a 9v9 queue want their own skill threshold, default skill and whitelist. Until now
configuration.get(key)was global.What
games.whitelist_id,queue.player_skill_threshold,games.default_player_skillnow hold an independent value per gamemode (no shared base — each falls back to the schema default). Stored under the bare key for the default gamemode (existing data + single-gamemode instances unchanged) andkey#gamemodefor the rest; all other keys stay global.configuration.get(key, gamemode?)resolves the storage key (configuration/gamemode-scoped-keys.ts).DELETE /queue/playersact on the viewed gamemode (?gamemode), andGET /api/v1/queueaccepts?gamemode(default = instance default, so backward-compatible).Scope
Verified: net-new
tsc= 0, unit suite green without.env(438, +2 new scoped-key tests), lint clean.