mirror of
https://github.com/prosolis/gogobee.git
synced 2026-07-15 08:32:41 +00:00
Adv 2.0 L5g: DnDCharacter mass-backfill + drop CombatLevel fallbacks
backfillDnDCharactersFromAdv walks adventure_characters rows that have no dnd_character row and inserts an auto-migrated character (race/class inferred from archetypes, Level seeded from dndLevelFromCombatLevel). Idempotent via LEFT JOIN — pending-setup drafts and existing rows are skipped. Wired into Init after the L5f backfill. With every legacy player guaranteed a D&D row, the soak-window fallbacks in dndLevelForUser, rivalLevelForUser, and hospitalCostsForUser are retired (they now floor at level 1). dndLevelFromCombatLevel itself stays — still used by autoBuildCharacter and the !setup seed paths. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -255,6 +255,14 @@ func (p *AdventurePlugin) Init() error {
|
||||
if err := backfillPlayerMetaMiscState(); err != nil {
|
||||
slog.Error("player_meta: misc state backfill failed", "err", err)
|
||||
}
|
||||
// Adv 2.0 Phase L5g — one-shot DnDCharacter mass-backfill. Every legacy
|
||||
// player without a D&D row gets an auto-migrated character seeded from
|
||||
// their CombatLevel, retiring the dndLevelFromCombatLevel fallbacks in
|
||||
// dndLevelForUser / rivalLevelForUser / hospitalCostsForUser. Idempotent
|
||||
// (skips users who already have any dnd_character row).
|
||||
if err := backfillDnDCharactersFromAdv(); err != nil {
|
||||
slog.Error("dnd: L5g character backfill failed", "err", err)
|
||||
}
|
||||
// Phase L3 — cancel any open/active legacy coop dungeon runs and
|
||||
// refund member contributions + unsettled bets. Idempotent.
|
||||
closeAndRefundLegacyCoopRuns(p.euro)
|
||||
|
||||
Reference in New Issue
Block a user