Ejemplo n.º 1
0
void rpcs3_app::Init()
{
	setApplicationName("RPCS3");
	setWindowIcon(QIcon(":/rpcs3.ico"));

	Emu.Init();

	guiSettings.reset(new gui_settings());
	emuSettings.reset(new emu_settings());

	// Create the main window
	RPCS3MainWin = new main_window(guiSettings, emuSettings, nullptr);

	// Create callbacks from the emulator, which reference the handlers.
	InitializeCallbacks();

	// Create connects to propagate events throughout Gui.
	InitializeConnects();

	RPCS3MainWin->Init();

	RPCS3MainWin->show();

	// Create the thumbnail toolbar after the main_window is created
	RPCS3MainWin->CreateThumbnailToolbar();

	if (guiSettings->GetValue(gui::ib_show_welcome).toBool())
	{
		welcome_dialog* welcome = new welcome_dialog();
		welcome->exec();
	}
#ifdef WITH_DISCORD_RPC
	// Discord Rich Presence Integration
	if (guiSettings->GetValue(gui::m_richPresence).toBool())
	{
		DiscordEventHandlers handlers = {};
		Discord_Initialize("424004941485572097", &handlers, 1, NULL);
	}
#endif
}
Ejemplo n.º 2
0
	DiscordRPC::DiscordRPC()
	{
		joinString = "";
		detailString = "";
		Utils::Cryptography::RandomPassword(32, matchSecret);

		HMODULE hModule = GetModuleHandleW(NULL);
		WCHAR appPath[MAX_PATH];
		GetModuleFileNameW(hModule, appPath, MAX_PATH);
		Discord_Register("ElDewrito", Utils::String::ThinString(appPath).c_str());

		DiscordEventHandlers handlers;
		memset(&handlers, 0, sizeof(handlers));
		handlers.ready = handleDiscordReady;
		handlers.disconnected = handleDiscordDisconnected;
		handlers.errored = handleDiscordError;
		handlers.joinGame = handleDiscordJoin;
		handlers.spectateGame = handleDiscordSpectate;
		handlers.joinRequest = handleDiscordJoinRequest;
		Discord_Initialize(APPLICATION_ID, &handlers, 1, NULL);

		Patches::Core::OnShutdown(OnShutdown);
	}
Ejemplo n.º 3
0
void discord_init(void)
{
   settings_t *settings = config_get_ptr();
   DiscordEventHandlers handlers;

   RARCH_LOG("[Discord] initializing ..\n");
   start_time            = time(0);

   memset(&handlers, 0, sizeof(handlers));
   handlers.ready        = handle_discord_ready;
   handlers.disconnected = handle_discord_disconnected;
   handlers.errored      = handle_discord_error;
   handlers.joinGame     = handle_discord_join;
   handlers.spectateGame = handle_discord_spectate;
   handlers.joinRequest  = handle_discord_join_request;

   /* To-Do: Add the arguments RetroArch was started with to the register URI*/
   const char command[256] = "retroarch";

   Discord_Initialize(settings->arrays.discord_app_id, &handlers, 0, NULL);
   Discord_Register(settings->arrays.discord_app_id, NULL);

   discord_ready         = true;
}
Ejemplo n.º 4
0
void UDiscordRpc::Initialize(const FString& applicationId,
                             bool autoRegister,
                             const FString& optionalSteamId)
{
    self = this;
    IsConnected = false;
    DiscordEventHandlers handlers{};
    handlers.ready = ReadyHandler;
    handlers.disconnected = DisconnectHandler;
    handlers.errored = ErroredHandler;
    if (OnJoin.IsBound()) {
        handlers.joinGame = JoinGameHandler;
    }
    if (OnSpectate.IsBound()) {
        handlers.spectateGame = SpectateGameHandler;
    }
    if (OnJoinRequest.IsBound()) {
        handlers.joinRequest = JoinRequestHandler;
    }
    auto appId = StringCast<ANSICHAR>(*applicationId);
    auto steamId = StringCast<ANSICHAR>(*optionalSteamId);
    Discord_Initialize(
      (const char*)appId.Get(), &handlers, autoRegister, (const char*)steamId.Get());
}