Fix: 피버타임 네트워크 지연 문제 및 일시정지 대응 #231
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
개요
피버타임(FeverTime) 아이템 사용 시 발생하는 네트워크 지연(Latency) 문제와 일시정지(Pause) 후 시간 동기화 문제를 해결하기 위해 도메인 로직을 리팩토링했습니다.
변경 사항
네트워크 지연 버퍼(Latency Buffer) 적용
FeverTime.start() 직후에 클라이언트가 보낸 요청이 서버 시작 시간보다 미세하게 앞서는 경우(Latency)를 고려하여, 시작 시간 기준 3초 전까지의 요청을 유효한 것으로 인정하도록 허용 범위를 조정했습니다.
일시정지/재개(Pause/Resume) 로직 개편
feverEndAt(종료 시점)을 관리하는 방식으로 변경.resume() 시: (현재 시간 - 마지막 정지 시간)만큼 feverEndAt을 뒤로 미루어, 정지했던 시간만큼 피버 타임이 정확히 연장되도록 구현했습니다.