feat(config): wire /config/update + /config/update_challenge_config (closes family 4/4)

is_skip_gacha_effect, use_challenge_two_pick_premium_card, and
challenge_two_pick_sleeve_id all persist on ViewerInfo and round-trip
through /load/index.

The two challenge fields move from the global ChallengeConfig section to
ViewerInfo — they're viewer preferences, not server-wide policy. Premium
card defaults to 0; sleeve falls back to DefaultLoadoutConfig.SleeveId
(3000011) when unset. MatchContextBuilder's TK2 sleeve read switches to
the same viewer-scoped path.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
gamer147
2026-06-13 11:25:40 -04:00
parent b5e13551cd
commit 715dd4dea8
17 changed files with 4860 additions and 16 deletions

View File

@@ -39,7 +39,6 @@ public class MatchContextBuilder : IMatchContextBuilder
var viewer = await _viewers.LoadForMatchContextAsync(viewerId)
?? throw new ArenaTwoPickException("arena_two_pick_no_active_run");
var challenge = _config.Get<ChallengeConfig>();
var defaults = _config.Get<DefaultLoadoutConfig>();
var emblemId = viewer.Info.SelectedEmblem.Id != 0
@@ -51,6 +50,11 @@ public class MatchContextBuilder : IMatchContextBuilder
var charaId = run.LeaderSkinId != 0
? run.LeaderSkinId.ToString()
: run.ClassId.ToString();
// TK2-specific cosmetic source; falls back to the global default sleeve if the
// viewer hasn't set a challenge-specific one via /config/update_challenge_config.
var twoPickSleeveId = viewer.Info.ChallengeTwoPickSleeveId != 0
? viewer.Info.ChallengeTwoPickSleeveId
: defaults.SleeveId;
return new MatchContext(
SelfDeckCardIds: deck,
@@ -61,7 +65,7 @@ public class MatchContextBuilder : IMatchContextBuilder
CountryCode: viewer.Info.CountryCode ?? string.Empty,
UserName: viewer.DisplayName,
// TK2-specific cosmetic source; other modes will use the deck row's SleeveId.
SleeveId: challenge.TwoPickSleeveId.ToString(),
SleeveId: twoPickSleeveId.ToString(),
EmblemId: emblemId,
DegreeId: degreeId,
// Hardcoded v1; needs equipped-MyPageBackground lookup (see spec §Deferred).