namespace SVSim.Database.Services.Replay; /// /// In-memory per-viewer battle context store. Bridges the start-time → finish-time /// gap: the /finish request body carries neither battle_id nor opponent identity, /// so this stash holds everything the finish hook needs to compose a /// ViewerBattleHistory row. /// public interface IBattleContextStore { /// Store the viewer's active battle context. Overwrites any prior entry. void Set(long viewerId, BattleContext ctx); /// Atomic read+clear. Returns null when no context (server restart, /// non-tracked family, already taken). Finish handlers must tolerate null. BattleContext? TakeFor(long viewerId); }