Skip to content

Centralize time calculation and recovery - #299

Merged
BenCodez merged 4 commits into
masterfrom
refactor/time-calculation
Aug 25, 2026
Merged

BenCodez merged 4 commits into
masterfrom
refactor/time-calculation

Conversation

@BenCodez

Copy link
Copy Markdown
Owner

Summary

Consolidate the duplicated Bukkit/proxy time arithmetic and harden time-change lifecycle handling without changing configured offsets or event order.

  • add TimeCalculation as the shared timezone/hour-offset/week-number implementation
  • add clock-aware constructor overloads so time behavior can be tested deterministically while existing constructors keep system-clock behavior
  • use the shared calculation in both TimeChecker and BungeeTimeChecker
  • retain locale-based week numbering and the existing week-day offset semantics
  • fall back to the local clock zone with a warning when a configured zone is invalid
  • guarantee Bukkit activeProcessing and proxy processing flags are reset in finally
  • fix the proxy failure mode where an exception from timeChanged(...) could leave processing permanently stuck
  • make proxy shutdown null-safe and timer-load logging independent of the Bukkit singleton
  • replace raw time-processing stack traces with contextual logging/debug paths

Tests

  • fixed-clock timezone/DST and hour-offset calculation
  • week calculation with configured day offset
  • regression proving a failed proxy time-change does not leave future processing blocked

Existing day/week/month public APIs and event ordering remain intact.

@BenCodez
BenCodez marked this pull request as ready for review August 24, 2026 23:12
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@BenCodez
BenCodez merged commit fe90996 into master Aug 25, 2026
4 checks passed
@BenCodez
BenCodez deleted the refactor/time-calculation branch August 25, 2026 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant