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:
4656
SVSim.Database/Migrations/20260613152024_ConfigViewerOverrides.Designer.cs
generated
Normal file
4656
SVSim.Database/Migrations/20260613152024_ConfigViewerOverrides.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,51 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace SVSim.Database.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class ConfigViewerOverrides : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<long>(
|
||||
name: "Info_ChallengeTwoPickSleeveId",
|
||||
table: "Viewers",
|
||||
type: "bigint",
|
||||
nullable: false,
|
||||
defaultValue: 0L);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "Info_IsSkipGachaEffect",
|
||||
table: "Viewers",
|
||||
type: "boolean",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "Info_UseChallengeTwoPickPremiumCard",
|
||||
table: "Viewers",
|
||||
type: "boolean",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Info_ChallengeTwoPickSleeveId",
|
||||
table: "Viewers");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Info_IsSkipGachaEffect",
|
||||
table: "Viewers");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Info_UseChallengeTwoPickPremiumCard",
|
||||
table: "Viewers");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4336,6 +4336,9 @@ namespace SVSim.Database.Migrations
|
||||
b1.Property<DateTime>("BirthDate")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b1.Property<long>("ChallengeTwoPickSleeveId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<string>("CountryCode")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
@@ -4352,6 +4355,9 @@ namespace SVSim.Database.Migrations
|
||||
b1.Property<bool>("IsPrizePreferred")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b1.Property<bool>("IsSkipGachaEffect")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b1.Property<int>("MaxFriends")
|
||||
.HasColumnType("integer");
|
||||
|
||||
@@ -4361,6 +4367,9 @@ namespace SVSim.Database.Migrations
|
||||
b1.Property<int>("SelectedEmblemId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b1.Property<bool>("UseChallengeTwoPickPremiumCard")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b1.HasKey("ViewerId");
|
||||
|
||||
b1.HasIndex("SelectedDegreeId");
|
||||
|
||||
@@ -3,9 +3,6 @@ namespace SVSim.Database.Models.Config;
|
||||
[ConfigSection("Challenge")]
|
||||
public class ChallengeConfig
|
||||
{
|
||||
public bool UseTwoPickPremiumCard { get; set; }
|
||||
public long TwoPickSleeveId { get; set; }
|
||||
|
||||
// Wire-mirrored fields from format_info (ChallengeData.cs parser)
|
||||
public int LastCardPackSetId { get; set; }
|
||||
public string CardPoolName { get; set; } = "";
|
||||
|
||||
@@ -12,6 +12,9 @@ public class ViewerInfo
|
||||
public bool IsOfficialMarkDisplayed { get; set; }
|
||||
public bool IsFoilPreferred { get; set; }
|
||||
public bool IsPrizePreferred { get; set; }
|
||||
public bool IsSkipGachaEffect { get; set; }
|
||||
public bool UseChallengeTwoPickPremiumCard { get; set; }
|
||||
public long ChallengeTwoPickSleeveId { get; set; }
|
||||
|
||||
#region Navigation Properties
|
||||
|
||||
|
||||
Reference in New Issue
Block a user