EverestAPI / Everest

Everest - Celeste Mod Loader / Mod API
https://everestapi.github.io/
MIT License
349 stars 77 forks source link

Replace DiscordRPC with GameSDK #307

Closed coloursofnoise closed 1 year ago

coloursofnoise commented 3 years ago

The Everest DiscordRPC integration is broken on MacOS, and the DiscordRPC Library has been deprecated in favour of Discord's GameSDK.

endorpersand commented 2 years ago

I believe I have figured out why Everest's DiscordRPC integration is broken on macOS.

In the current Everest code, the platform is being checked like so:

if (!string.IsNullOrEmpty(CoreModule.Settings.DiscordLib))
    lib = CoreModule.Settings.DiscordLib;
else if (Environment.OSVersion.Platform == PlatformID.Win32NT)
    lib = "discord-rpc.dll";
else if (Environment.OSVersion.Platform == PlatformID.MacOSX) {
    lib = "libdiscord-rpc.dylib";
    // FIXME: macOS doesn't see libdiscord-rpc.dylib wherever Celeste.exe is.
} else if (Environment.OSVersion.Platform == PlatformID.Unix)
    lib = "libdiscord-rpc.so";

However, on macOS, Environment.OSVersion.Platform is Unix, not MacOSX. So, Everest tries to use libdiscord-rpc.so rather than libdiscord-rpc.dylib, causing rich presence to fail on macOS.

At the moment, a workaround for current macOS users is to open Saves > modsettings-Everest.celeste and replace the line DiscordLib: '' with DiscordLib: libdiscord-rpc.dylib.

A possible permanent solution would be to try libdiscord-rpc.so on Unix platforms and then try libdiscord-rpc.dylib if libdiscord-rpc.so fails.

KTibow commented 1 year ago

reposting this since someone from the discord recommended me to it would be nice if when you folks get around to replacing the discord rich presence component, you could also improve the design a bit, in a couple ways

  1. remove the original rich presence (if possible); having 2 rich presences are bad
  2. use the image; it makes things feel more aligned, gives an opportunity to add art, and lets you add another text field (see https://discord.com/developers/docs/rich-presence/best-practices#use-all-of-the-fields-where-applicable)
  3. consider using words instead of emoji, it makes it more understandable
  4. consider moving around things to match up with the field names; see the page i linked before, also this diagram
Kalobi commented 1 year ago

@KTibow What would you suggest using for the image? The current map icon?

KTibow commented 1 year ago

I'm not sure. Could you give some examples of the icons?

Kalobi commented 1 year ago

@KTibow This would be the icon for Resort, for example: resort

maddie480 commented 1 year ago

I'm not sure how that'd work with arbitrary images 🤔

image

maddie480 commented 1 year ago

From what I understand, you send an image URL, Discord proxies it, and if you read back your presence you get mp:{some_proxy_url} (for example https://media.discordapp.net/external/QtIxTXtNkB4eSkFOQBmaXZ3yZCA9JiuMBWFI1OZ5OHE/https/celestemodupdater.0x0a.de/banana-mirror-images/img_ss_mods_5f53e04d0cf8f.png), so that would probably require mirroring map icons 🤔

maddie480 commented 1 year ago

Started working on it 😄