Skip to content

feat(update): in-game notice when a newer release is available#2

Merged
ResurrectedTrader merged 2 commits into
mainfrom
update-checker
Jun 17, 2026
Merged

feat(update): in-game notice when a newer release is available#2
ResurrectedTrader merged 2 commits into
mainfrom
update-checker

Conversation

@ResurrectedTrader

Copy link
Copy Markdown
Owner

Poll the GitHub releases API on a background thread and surface a one-line in-game notice on game entry when a newer release exists.

  • components/update/UpdateChecker: a jthread polls the hardcoded ResurrectedTrader/d2bsng releases/latest every 6h (30s settle delay), parses tag_name (non-throwing nlohmann-json), and semver-compares it against the build-baked D2BS_VERSION to latch an atomic flag. stop_token-interruptible waits so Stop() joins promptly. Reuses the V8-free api::classes::PerformHttpRequest (documented components->api exception).
  • GameLoop::OnSleep: on the session-entry latch transition, print the notice via game::PrintGameString. Plain ASCII, no URL.
  • Framework Init/Shutdown: Start()/Stop().
  • tests: fake UpdateChecker shim (the test set has no nlohmann-json or HTTP engine), mirroring the CharacterState fake.

Poll the GitHub releases API on a background thread and surface a
one-line in-game notice on game entry when a newer release exists.

- components/update/UpdateChecker: a jthread polls the hardcoded
  ResurrectedTrader/d2bsng releases/latest every 6h (30s settle delay),
  parses tag_name (non-throwing nlohmann-json), and semver-compares it
  against the build-baked D2BS_VERSION to latch an atomic flag.
  stop_token-interruptible waits so Stop() joins promptly. Reuses the
  V8-free api::classes::PerformHttpRequest (documented components->api
  exception).
- GameLoop::OnSleep: on the session-entry latch transition, print the
  notice via game::PrintGameString. Plain ASCII, no URL.
- Framework Init/Shutdown: Start()/Stop().
- tests: fake UpdateChecker shim (the test set has no nlohmann-json or
  HTTP engine), mirroring the CharacterState fake.
@ResurrectedTrader ResurrectedTrader merged commit 056dfd2 into main Jun 17, 2026
5 checks passed
@ResurrectedTrader ResurrectedTrader deleted the update-checker branch June 17, 2026 22:03
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