mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 21:32:45 +00:00
[discord] use discord username if available
This commit is contained in:
parent
b4bf7c168d
commit
79d280e9c3
@ -76,12 +76,16 @@ DiscordRichPresence discord_presence;
|
||||
|
||||
char* discord_get_own_username(void)
|
||||
{
|
||||
return user_name;
|
||||
if (discord_is_ready)
|
||||
return user_name;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char* discord_get_own_avatar(void)
|
||||
{
|
||||
return user_avatar;
|
||||
if (discord_is_ready)
|
||||
return user_avatar;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool discord_avatar_is_ready(void)
|
||||
|
@ -893,7 +893,12 @@ static void netplay_announce(void)
|
||||
|
||||
netplay_get_architecture(frontend_architecture, sizeof(frontend_architecture));
|
||||
|
||||
net_http_urlencode(&username, settings->paths.username);
|
||||
if (!string_is_empty(settings->paths.username))
|
||||
net_http_urlencode(&username, settings->paths.username);
|
||||
#ifdef HAVE_DISCORD
|
||||
else
|
||||
net_http_urlencode(&username, discord_get_own_username());
|
||||
#endif
|
||||
net_http_urlencode(&corename, system->library_name);
|
||||
net_http_urlencode(&coreversion, system->library_version);
|
||||
net_http_urlencode(&frontend_ident, frontend_architecture);
|
||||
@ -1492,6 +1497,9 @@ bool init_netplay(void *direct_host, const char *server, unsigned port)
|
||||
settings->ints.netplay_check_frames,
|
||||
&cbs,
|
||||
settings->bools.netplay_nat_traversal,
|
||||
#ifdef HAVE_DISCORD
|
||||
string_is_empty(settings->paths.username) ? discord_get_own_username() :
|
||||
#endif
|
||||
settings->paths.username,
|
||||
quirks);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user