fix(buff): 앱 재시작 시 배속/자동부활 버프 초기화
Some checks failed
CI / analyze-and-test (push) Has been cancelled

- loadAndStart에서 speedBoostEndMs, autoReviveEndMs를 null로 클리어
- 임시 버프는 세션 한정, 앱 재시작 시 깨끗한 상태로 시작
- 불필요한 restoreFromMonetization 메서드 제거
This commit is contained in:
JiWoong Sul
2026-03-30 23:19:05 +09:00
parent b240cd2626
commit e2a9032009
2 changed files with 4 additions and 28 deletions

View File

@@ -294,10 +294,10 @@ class GameSessionController extends ChangeNotifier {
// 비모바일 플랫폼 또는 테스트 환경에서는 무시 // 비모바일 플랫폼 또는 테스트 환경에서는 무시
} }
// 속도 부스트 상태 복원 (앱 재시작 대응) // 앱 재시작 시 임시 버프 초기화 (배속, 자동부활은 세션 한정)
_speedBoostManager.restoreFromMonetization( _monetization = _monetization.copyWith(
monetization: _monetization, speedBoostEndMs: null,
loop: null, // startNew에서 loop 생성 후 적용됨 autoReviveEndMs: null,
); );
// 복귀 보상 체크 (Phase 7) // 복귀 보상 체크 (Phase 7)

View File

@@ -194,30 +194,6 @@ class SpeedBoostManager {
return monetization.copyWith(speedBoostEndMs: null); return monetization.copyWith(speedBoostEndMs: null);
} }
/// 세이브에서 복원된 MonetizationState 기반으로 배속 상태 복원
///
/// 앱 재시작 후 로드 시 호출. speedBoostEndMs가 미래면 배속 재활성화.
void restoreFromMonetization({
required MonetizationState monetization,
required ProgressLoop? loop,
}) {
final endMs = monetization.speedBoostEndMs;
if (endMs == null) return;
final now = DateTime.now().millisecondsSinceEpoch;
if (now < endMs) {
// 아직 만료되지 않음 → 배속 재활성화
_isSpeedBoostActive = true;
if (loop != null) {
savedSpeedMultiplier = loop.speedMultiplier;
loop.updateAvailableSpeeds([speedBoostMultiplier]);
}
debugPrint(
'[SpeedBoost] Restored from save, ${(endMs - now) ~/ 1000}s remaining',
);
}
}
/// 부스트 상태에 따른 초기 배속 설정 계산 /// 부스트 상태에 따른 초기 배속 설정 계산
/// ///
/// startNew() 호출 시 사용 /// startNew() 호출 시 사용