Skip to content

Add Discord Rich Presence support - #94

Open
willshiel wants to merge 2 commits into
flyngmt:masterfrom
willshiel:discord-rich-presence
Open

Add Discord Rich Presence support#94
willshiel wants to merge 2 commits into
flyngmt:masterfrom
willshiel:discord-rich-presence

Conversation

@willshiel

Copy link
Copy Markdown

Shows the player's town name and current location (e.g. "Inside Nook's Cranny") on Discord via the local IPC protocol, closing #78. Opt-in via a discord_client_id in settings.ini (blank disables it, the default). All pipe I/O runs on a dedicated thread so a slow or absent Discord client can never stall the game loop.

Shows the player's town name and current location (e.g. "Inside Nook's
Cranny") on Discord via the local IPC protocol, closing flyngmt#78. Opt-in via
a discord_client_id in settings.ini (blank disables it, the default).
All pipe I/O runs on a dedicated thread so a slow or absent Discord
client can never stall the game loop.
- Map game font codes to ASCII via the CHAR_* table instead of a raw
  range check: heart/music/droplet symbols and accented letters in town
  names were being emitted as the wrong ASCII character (e.g. heart as
  '+'); accented a-variants now map to 'a', symbols are dropped, and
  underscore is kept
- Probe discord-ipc-0 through -9 instead of only -0, so presence works
  when Discord Canary/PTB or another RPC app holds the first pipe
- Throttle updates by wall clock (5s) instead of frame count, which
  scaled with the FPS cap (~0.3s at 960fps) and could hit Discord's
  rate limit; first update now fires immediately instead of after 300
  frames
- Shut the worker thread down on the missing-ROM early-exit path, which
  previously left it running through SDL_Quit
- Clamp snprintf position accumulation so a truncated payload can't
  underflow the remaining-size argument (latent OOB) or masquerade as a
  dropped connection
- Use wrap-safe tick comparisons, drop the has_state flag in favor of
  an empty-string convention, dedupe the default details literal, and
  wrap lines to the repo's 120-column limit
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