added discord rpc (#1178)

* added discord rpc

* linting issues

* Revert "linting issues"

This reverts commit 55f4e39506.

* fix clang-format issues

* removed wrong rpc submodule

* added correct rpc submodule

* Moved cmake instructions to correct files.

* added minor suggestions from pr

* Added an option to enable/disable RPC, added rpc to emulator.cpp making it work on nonqt builds

* typo & minor stuff

* Changed getInstance implementation with Singleton class.

* Update discord_rpc_handler.cpp

discord id

* fixed ci clangformat errors

---------

Co-authored-by: georgemoralis <giorgosmrls@gmail.com>
This commit is contained in:
delledev 2024-10-08 18:14:37 +03:00 committed by GitHub
parent aba803bd04
commit 3e7137cc6b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 133 additions and 50 deletions

View file

@ -11,6 +11,7 @@
#include "common/memory_patcher.h"
#endif
#include "common/assert.h"
#include "common/discord_rpc_handler.h"
#include "common/elf_info.h"
#include "common/ntapi.h"
#include "common/path_util.h"
@ -210,6 +211,15 @@ void Emulator::Run(const std::filesystem::path& file) {
}
}
// Discord RPC
if (Config::getEnableDiscordRPC()) {
auto* rpc = Common::Singleton<DiscordRPCHandler::RPC>::Instance();
if (rpc->getRPCEnabled() == false) {
rpc->init();
}
rpc->setStatusPlaying(game_info.title, id);
}
// start execution
std::jthread mainthread =
std::jthread([this](std::stop_token stop_token) { linker->Execute(); });