mirror of
https://github.com/prosolis/gogobee.git
synced 2026-07-16 08:52:42 +00:00
Adv 2.0 L5b: babysit state migration off AdvCharacter to player_meta
Five player_meta columns (babysit_active, babysit_expires_at, babysit_skill_focus, auto_babysit, auto_babysit_focus). BabysitState struct with IsActive() marker mirrors SkillState/HouseState shape. loadBabysitState / upsertPlayerMetaBabysitState / backfillPlayerMetaBabysitState / babysitStateFromAdvChar helpers. Dual-writes wired at handleBabysitStart, handleBabysitCancel, checkBabysitExpiry. Backfill is idempotent — only fills inactive rows whose legacy counterpart is active. AutoBabysit / AutoBabysitFocus / BabysitSkillFocus are dormant in current code but preserved for the schema migration. Tests: TestPlayerMetaBabysitStateBackfill_Idempotent, TestLoadBabysitState_FallsBackToAdvCharacter, TestUpsertPlayerMetaBabysitState_RoundTrip. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -230,6 +230,11 @@ func (p *AdventurePlugin) Init() error {
|
||||
if err := backfillPlayerMetaSkillState(); err != nil {
|
||||
slog.Error("player_meta: skill state backfill failed", "err", err)
|
||||
}
|
||||
// Adv 2.0 Phase L5b — one-shot babysit state backfill into player_meta.
|
||||
// Idempotent (only fills inactive rows whose legacy counterpart is active).
|
||||
if err := backfillPlayerMetaBabysitState(); err != nil {
|
||||
slog.Error("player_meta: babysit state 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