Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discord Rich Presence Integration #4396

Merged
merged 2 commits into from Apr 19, 2018

Conversation

@hcorion
Copy link
Contributor

commented Apr 6, 2018

This is some basic Discord rich presence integration, this should work 馃 .

@hcorion

This comment has been minimized.

Copy link
Contributor Author

commented Apr 6, 2018

Doesn't seem to be working, I'll investigate later.

@magiruuvelvet

This comment has been minimized.

Copy link
Contributor

commented Apr 6, 2018

Just a thought, but don't you need to add an OAuth token somewhere? How does the API know what account is connected? Am I missing something?

@hcorion

This comment has been minimized.

Copy link
Contributor Author

commented Apr 6, 2018

From what I've seen in examples and such OAuth isn't needed for rich presence.

@Nicba1010

This comment has been minimized.

Copy link
Contributor

commented Apr 6, 2018

I dont know if you have it planned but a cool feature addition to this would be setting the discord icon thingy to a game when it launches

@Megamouse

This comment has been minimized.

Copy link
Contributor

commented Apr 6, 2018

I couldn't find the docs for uploading your own application image

@DJScias

This comment has been minimized.

Copy link

commented Apr 6, 2018

Hello there,

Relating inquiries of @Nicba1010 & @Megamouse

As per the docs the images need to be stored on the application's page as assets with the name being the key. This is limited to 150 so it'll be a bit annoying if you want to add all game titles there.

Docs about this:
image

Example on the app page:
image

@hcorion

This comment has been minimized.

Copy link
Contributor Author

commented Apr 6, 2018

Apparently uploading images in the application is something they're considering.

Q: Can I send images via the payload rather than uploading them to my Developer Dashboard?

Unfortunately, the SDK does not support this feature right now. However, we hear your desires! We know that a lot of games, like customization-heavy RPGs, would benefit greatly from being able to programmatically upload assets. It may be something we tackle in the future.
-- https://discordapp.com/developers/docs/rich-presence/faq

@hcorion hcorion force-pushed the hcorion:discord-magic branch from 3954fa8 to cab42fe Apr 6, 2018

@TGEnigma

This comment has been minimized.

Copy link
Contributor

commented Apr 6, 2018

Wouldn't hurt to move the discord integration code to seperate functions.

@hcorion hcorion force-pushed the hcorion:discord-magic branch from cab42fe to c5a02bd Apr 6, 2018

@hcorion

This comment has been minimized.

Copy link
Contributor Author

commented Apr 6, 2018

This PR is now working on Linux, however, for some reason the MSVC build is not taking the WITH_DISCORD_RPC definition, and so it compiles without discord integration, any help from those who use windows would be appreciated.

@flash-fire

This comment has been minimized.

Copy link
Contributor

commented Apr 6, 2018

Oh you need to edit the VS project file. Should have list of macros enabled. I'll do it soontm assuming that's the issue if you want

@Megamouse

This comment has been minimized.

Copy link
Contributor

commented Apr 7, 2018

I gave him the patch for that following your advice, so no need to do that anymore.
Sankyo

@hcorion hcorion force-pushed the hcorion:discord-magic branch 2 times, most recently from c415ee6 to e99492d Apr 7, 2018

@hcorion

This comment has been minimized.

Copy link
Contributor Author

commented Apr 7, 2018

This should now work on windows thanks to @Megamouse

@@ -88,6 +91,11 @@ void rpcs3_app::Init()
welcome_dialog* welcome = new welcome_dialog();
welcome->exec();
}
#ifdef WITH_DISCORD_RPC
DiscordEventHandlers handlers;
memset(&handlers, 0, sizeof(handlers));

This comment has been minimized.

Copy link
@janisozaur

janisozaur Apr 7, 2018

Contributor

Is there any particular reason to use memset here rather than simply default-initialising with DiscordEventHandlers handlers = {}, much more C++ and concise form?

This comment has been minimized.

Copy link
@hcorion

hcorion Apr 7, 2018

Author Contributor

copy pasta from official discord stuff. Will fix.

@@ -754,6 +772,14 @@ void main_window::OnEmuStop()
ui->toolbar_start->setIcon(m_icon_play);
ui->toolbar_start->setToolTip(Emu.IsReady() ? tr("Start emulation") : tr("Resume emulation"));
}
#ifdef WITH_DISCORD_RPC
// Discord Rich Presence Integration
DiscordRichPresence discordPresence;

This comment has been minimized.

Copy link
@janisozaur

janisozaur Apr 7, 2018

Contributor

Looks misaligned

This comment has been minimized.

Copy link
@hcorion

hcorion Apr 7, 2018

Author Contributor

ugh, thanks, addressed.

@hcorion hcorion force-pushed the hcorion:discord-magic branch from e99492d to dbbe5f2 Apr 7, 2018

@@ -4,6 +4,9 @@

#include "rpcs3qt/welcome_dialog.h"

#include "discord_rpc.h"

This comment has been minimized.

Copy link
@TGEnigma

TGEnigma Apr 7, 2018

Contributor

you should #ifdef these includes as well

This comment has been minimized.

Copy link
@hcorion

hcorion Apr 7, 2018

Author Contributor

I didn't really see the need to ifdef these, it doesn't really contribute anything to the codebase except 2 extra lines.

This comment has been minimized.

Copy link
@TGEnigma

TGEnigma Apr 7, 2018

Contributor

you're including unnecessary files if you were to have it disabled, i don't see how it's justifiable to keep it this way for the sake of keeping the diff small.

This comment has been minimized.

Copy link
@hcorion

hcorion Apr 7, 2018

Author Contributor

Alright, I don't see the point of arguing about this any further, so I'll just go ahead and change it.

@@ -8,6 +8,9 @@
#include <QDesktopWidget>
#include <QMimeData>

#include "discord_rpc.h"

This comment has been minimized.

Copy link
@TGEnigma

TGEnigma Apr 7, 2018

Contributor

ditto

@hcorion hcorion force-pushed the hcorion:discord-magic branch from dbbe5f2 to a05beb6 Apr 7, 2018

@takhlaq

takhlaq approved these changes Apr 9, 2018

@HerrHulaHoop
Copy link

left a comment

I feel the presence

@Megamouse

This comment has been minimized.

Copy link
Contributor

commented Apr 17, 2018

what is this python style they use 馃敤
Ah it's an ifdef
馃う鈥嶁檪锔

@JohnHolmesII
Copy link
Contributor

left a comment

Muy bueno

@Nekotekina Nekotekina merged commit 3b24e7e into RPCS3:master Apr 19, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@NPJB00512

This comment has been minimized.

Copy link

commented Apr 19, 2018

RPCS3.log.gz
Gundam EXVSFB 30FPS

E {PPU[0x1000001] Thread (VSTG MAIN THREAD) [0x00023038]} sys_vm: sys_vm_memory_map(vsize=0x10000000, psize=0x9c60000, cid=0xffffffff, flags=0x200, policy=0x1, addr=*0xd0025bd0)
E {PPU[0x1000001] Thread (VSTG MAIN THREAD) [0x00ed6f0c]} '_sys_prx_get_module_id_by_name' failed with 0x8001112e : CELL_PRX_ERROR_UNKNOWN_MODULE [1]
E {SPU[0x2000003] Thread (DevSpuCellSpursKernel3)} SPU: [0x0955c] Branch-to-next with $LR
E {rsx::thread} RSX: NV3089_IMAGE_IN_SIZE: Invalid blit dimensions passed
E {SPU[0x2000000] Thread (DevSpuCellSpursKernel0)} SPU: [0x0cf5c] Branch-to-next with $LR
E {SPU[0x2000002] Thread (DevSpuCellSpursKernel2)} SPU: [0x0cf5c] Branch-to-next with $LR
E {SPU[0x2000001] Thread (DevSpuCellSpursKernel1)} SPU: [0x0cf5c] Branch-to-next with $LR
E {SPU[0x2000003] Thread (DevSpuCellSpursKernel3)} SPU: [0x0cf5c] Branch-to-next with $LR
E {rsx::thread} RSX: Depth texture bound to pipeline with unexpected format 0x8B x37
E {PPU[0x1000011] Thread (TrophyInstall) [0x0009c838]} sceNpTrophy: sceNpTrophyRegisterContext(context=0x1, handle=0x1, statusCb=*0xd27d70, arg=*0x60061bc0, options=0x1)
E {rsx::thread} RSX: Depth texture bound to pipeline with unexpected format 0x8B x8
E {PPU[0x100000d] Thread (CApplicationBase) [0x0009af3c]} 'cellNetCtlGetInfo' failed with 0x80130108 : CELL_NET_CTL_ERROR_NOT_CONNECTED [1]
E {rsx::thread} RSX: Depth texture bound to pipeline with unexpected format 0x8B x135
E {PPU[0x100000d] Thread (CApplicationBase) [0x00ed6f0c]} '_sys_prx_get_module_id_by_name' failed with 0x8001112e : CELL_PRX_ERROR_UNKNOWN_MODULE [1]
E {rsx::thread} RSX: Depth texture bound to pipeline with unexpected format 0x8B x1780
E {SPU[0x2000004] Thread (DevSpuCellSpursKernel4)} SPU: [0x08d7c] Branch-to-next with $LR
E {SPU[0x2000003] Thread (DevSpuCellSpursKernel3)} SPU: [0x16bfc] Branch-to-next with $LR
E {rsx::thread} RSX: Depth texture bound to pipeline with unexpected format 0x8B x139

W {PPU[0x1000016] Thread (bnusCoreUpdateThread) [0x00459254]} cellSysutil: cellSysutilGetBgmPlaybackStatus(status=*0xd00e0dc0) x3
W {PPU[0x1000013] Thread (atrac3plusSpursHdlr0) [0x00f01470]} sys_spu: sys_spu_thread_group_start(id=0x3)
W {PPU[0x1000013] Thread (atrac3plusSpursHdlr0) [0x00f0148c]} sys_spu: sys_spu_thread_group_join(id=0x3, cause=*0xd0093da0, status=*0xd0093da4)
W {PPU[0x1000016] Thread (bnusCoreUpdateThread) [0x00459254]} cellSysutil: cellSysutilGetBgmPlaybackStatus(status=*0xd00e0dc0)
W {PPU[0x1000001] Thread (VSTG MAIN THREAD) [0x00f5816c]} sys_net: sys_net_bnet_select(nfds=25, readfds=*0xd0025b58, writefds=*0x0, exceptfds=*0x0, timeout=*0xd0025b38)
W {PPU[0x1000016] Thread (bnusCoreUpdateThread) [0x00459254]} cellSysutil: cellSysutilGetBgmPlaybackStatus(status=*0xd00e0dc0)
E {rsx::thread} RSX: Depth texture bound to pipeline with unexpected format 0x8B x2

@Megamouse

This comment has been minimized.

Copy link
Contributor

commented Apr 19, 2018

what a moron

@elad335

This comment has been minimized.

Copy link
Contributor

commented Apr 19, 2018

@NPJB00512 do you want to get banned? its far from the first time you're doing this.馃敤

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can鈥檛 perform that action at this time.