mirror of
https://github.com/burrow-dev/burrow-client.git
synced 2026-11-19 09:37:50 -05:00
feat: discord rich presence
Client 1.3.0 shows "Playing Burrow" on the player's Discord profile while the game is open: where they are (the game's ajPresence, dens and player parties never named), the time since they started and a button to the download page. It goes through the Discord app's local IPC socket (no packages; Windows pipe, Linux and macOS sockets, Flatpak and Snap too) and retries quietly while Discord is not running. The server names its Discord application in its flashvars (discordAppId); none, no presence.
This commit is contained in:
1 parent
164e2e8adc
commit
92c5042c5e
5 files changed
+218
No files matched your search
@@ -26,6 +26,8 @@ contextBridge.exposeInMainWorld("client", {
|
||||
showFile: file => ipcRenderer.send("showFile", file),
|
||||
toggleFullscreen: () => ipcRenderer.send("toggleFullscreen"),
|
||||
openPage: url => ipcRenderer.send("openPage", url),
|
||||
// Discord rich presence (discord.js): {appId, state, start, url}, or null.
|
||||
presence: info => ipcRenderer.send("presence", info),
|
||||
onFullscreen: listener => ipcRenderer.on("fullscreen", (event, on) => listener(on)),
|
||||
onShortcut: listener => ipcRenderer.on("shortcut", (event, key) => listener(key)),
|
||||
});
|
||||
Reference in new issue
Block a user