Skip to content

Discord Rich Presence - #79

Merged
schindlershadow merged 4 commits into
mainfrom
discord-presence
Nov 16, 2026
Merged

schindlershadow merged 4 commits into
mainfrom
discord-presence

Conversation

@schindlershadow

Copy link
Copy Markdown
Owner

Discord Rich Presence: while the Discord desktop app runs on the same computer, the player's Discord profile shows what they are doing in the game.

  • runtime/src/psp_discord.cpp (generic, no Discord SDK): talks to the desktop app's local IPC (Unix socket discord-ipc-N incl. Flatpak / Snap / Vesktop folders, Windows named pipe). One background thread, sends only changes, at most one per 4 s (Discord's rate limit), reconnects with back-off when Discord starts later or restarts, clears the status on quit and when switched off. No-op on Android.
  • Settings > Network > Discord Status on / off (saved as discord=) and a connection line.
  • games/dissidia/runtime/discord_presence.cpp: title screen, main menu, the chosen mode (read from the start menu cursors), stage, fighters (manikins by their own names, roster mods by nm=), fight timer.
  • Communications Mode: the save's player name (Data Config > Player Name, UTF-16 at 0x08BCEB40) is now the ad-hoc nickname other players see (was "Player"); the status names the other players ("With Zack", "Ender (Lightning) vs. Zack (Laguna)") and everyone in a room shares one Discord party. The player's own fighter is actor +0x5B0 bit 0x04 (online the other players' fighters are in human mode too).
  • Docs: games/dissidia/docs/discord.md, ARCHITECTURE, READMEs, settings and multiplayer docs.

Tested:

  • ctest -R discord: JSON checks plus a full session against a fake Discord app (handshake, rate limit, ping, off / on, Discord restarting, clear on quit) on Linux, and the Windows build of the test under Wine (named pipe).
  • Real Discord 1.0.169 on Linux: every update accepted, icon shown from the repo URL, status cleared on quit.
  • In game: menus → Quick Battle → "Quick Battle (1-on-1) · Order's Sanctuary / Squall vs. Lightning".
  • Two copies over LAN in a Group Battle with different names and characters: both name themselves and the other player correctly.
  • Not tested: Internet (relay) mode, 3+ players, Windows/macOS against a real Discord client.

Release notes

  • Discord shows what you are playing: the mode, the stage, your fighter and opponent, and how long the fight has run (Settings > Network > Discord Status to turn it off).
  • In Communications Mode other players see your save's player name instead of "Player", and Discord shows who you are playing with.

🤖 Generated with Claude Code

schindlershadow and others added 4 commits November 16, 2026 15:21
…rd profile

- runtime/src/psp_discord.cpp: Discord desktop IPC client without the SDK (Unix socket
  discord-ipc-N incl. Flatpak/Snap/Vesktop paths, Windows named pipe), one background
  thread, sends only changes, at most one per 4 s, reconnects with back-off, clears on
  quit and when switched off; no-op on Android
- Settings > Network > Discord: on/off (saved as discord=) and a connection line
- games/dissidia/runtime/discord_presence.cpp: title screen, main menu, the chosen mode
  (from the start menu cursors), fighters (manikins by name, roster.txt nm= labels),
  stage, fight timer, Communications Mode party size
- runtime/tests/test_discord.cpp: JSON checks and a full session against a fake Discord
  app (Unix socket and Windows named pipe)
- docs: games/dissidia/docs/discord.md, ARCHITECTURE, READMEs

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ing sides (the real-speed intro outlasted 6 s)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The save's player name (UTF-16 at 0x08BCEB40) is this copy's ad-hoc nickname
  (psp_adhoc_set_nickname, was "Player"; PSPRECOMP_ADHOC_NICK still wins)
- Status: "With Zack" in rooms, "Ender (Lightning) vs. Zack (Laguna)" one on one,
  every player on hover, one Discord party per room (psp_adhoc_group_key)
- Own fighter = actor +0x5B0 bit 0x04: online the other players' fighters are in
  human mode too, so the brain flag picked the wrong side on one of the two copies
- Tested with two copies in a LAN Group Battle (Ender vs Zack, different characters)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@schindlershadow
schindlershadow merged commit 869b660 into main Nov 16, 2026
2 checks passed
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