Discord rich presence (#4500)
* WIP RPC support * Might have windows support now, don't peek * Windows support * RichPresence: __SWITCH__ => DISABLE_RPC (for MOBILE_STK support) * RichPresence: Handle JSON strings according to spec, support for addons icon * RichPresence: use translated difficulty name * RichPresence: disable when client_id=-1 * RichPresence: thread connection, show server name on RPC * RichPresence: destroy on close * RichPresence: don't compile methods at all if DISABLE_RPC * RichPresence: fix windows compile (untested) * RichPresence: fix for mac * RichPresence: Linux needs MSG_NOSIGNAL still * RichPresence: fix memory leaks, don't spam update while not connected * RichPresence: free thread on terminate * RichPresence: handle initial registration * RichPresence: fix compiler warning
This commit is contained in:
@@ -56,6 +56,7 @@
|
||||
#include "utils/string_utils.hpp"
|
||||
#include "utils/time.hpp"
|
||||
#include "utils/translation.hpp"
|
||||
#include "io/rich_presence.hpp"
|
||||
|
||||
#ifndef WIN32
|
||||
#include <unistd.h>
|
||||
@@ -714,6 +715,8 @@ void MainLoop::run()
|
||||
}
|
||||
}
|
||||
|
||||
RichPresenceNS::RichPresence::get()->update(false);
|
||||
|
||||
if (auto gp = GameProtocol::lock())
|
||||
{
|
||||
gp->sendActions();
|
||||
|
||||
Reference in New Issue
Block a user