mirror of
https://github.com/libretro/RetroArch
synced 2025-04-01 22:20:31 +00:00
Merge pull request #7932 from fr500/master
WIP: [netplay] subsystem support
This commit is contained in:
commit
3c8ca30b07
@ -41,6 +41,7 @@
|
|||||||
#include "../../file_path_special.h"
|
#include "../../file_path_special.h"
|
||||||
#include "../../paths.h"
|
#include "../../paths.h"
|
||||||
#include "../../command.h"
|
#include "../../command.h"
|
||||||
|
#include "../../dynamic.h"
|
||||||
#include "../../retroarch.h"
|
#include "../../retroarch.h"
|
||||||
|
|
||||||
/* Only used before init_netplay */
|
/* Only used before init_netplay */
|
||||||
@ -857,19 +858,38 @@ static void netplay_announce(void)
|
|||||||
char *username = NULL;
|
char *username = NULL;
|
||||||
char *corename = NULL;
|
char *corename = NULL;
|
||||||
char *gamename = NULL;
|
char *gamename = NULL;
|
||||||
|
char *subsystemname = NULL;
|
||||||
char *coreversion = NULL;
|
char *coreversion = NULL;
|
||||||
char *frontend_ident = NULL;
|
char *frontend_ident = NULL;
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
struct retro_system_info *system = runloop_get_libretro_system_info();
|
struct retro_system_info *system = runloop_get_libretro_system_info();
|
||||||
uint32_t content_crc = content_get_crc();
|
uint32_t content_crc = content_get_crc();
|
||||||
|
struct string_list *subsystem = path_get_subsystem_list();
|
||||||
|
|
||||||
|
if (subsystem)
|
||||||
|
{
|
||||||
|
for (unsigned i = 0; i < subsystem->size; i++)
|
||||||
|
{
|
||||||
|
strlcat(buf, path_basename(subsystem->elems[i].data), sizeof(buf));
|
||||||
|
if (i < subsystem->size - 1)
|
||||||
|
strlcat(buf, "|", sizeof(buf));
|
||||||
|
}
|
||||||
|
RARCH_LOG("%s\n", buf);
|
||||||
|
net_http_urlencode(&gamename, buf);
|
||||||
|
net_http_urlencode(&subsystemname, path_get(RARCH_PATH_SUBSYSTEM));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
net_http_urlencode(&gamename,
|
||||||
|
!string_is_empty(path_basename(path_get(RARCH_PATH_BASENAME))) ?
|
||||||
|
path_basename(path_get(RARCH_PATH_BASENAME)) : "N/A");
|
||||||
|
net_http_urlencode(&subsystemname, "N/A");
|
||||||
|
}
|
||||||
|
|
||||||
netplay_get_architecture(frontend_architecture, sizeof(frontend_architecture));
|
netplay_get_architecture(frontend_architecture, sizeof(frontend_architecture));
|
||||||
|
|
||||||
net_http_urlencode(&username, settings->paths.username);
|
net_http_urlencode(&username, settings->paths.username);
|
||||||
net_http_urlencode(&corename, system->library_name);
|
net_http_urlencode(&corename, system->library_name);
|
||||||
net_http_urlencode(&gamename,
|
|
||||||
!string_is_empty(path_basename(path_get(RARCH_PATH_BASENAME))) ?
|
|
||||||
path_basename(path_get(RARCH_PATH_BASENAME)) : "N/A");
|
|
||||||
net_http_urlencode(&coreversion, system->library_version);
|
net_http_urlencode(&coreversion, system->library_version);
|
||||||
net_http_urlencode(&frontend_ident, frontend_architecture);
|
net_http_urlencode(&frontend_ident, frontend_architecture);
|
||||||
|
|
||||||
@ -877,14 +897,15 @@ static void netplay_announce(void)
|
|||||||
|
|
||||||
snprintf(buf, sizeof(buf), "username=%s&core_name=%s&core_version=%s&"
|
snprintf(buf, sizeof(buf), "username=%s&core_name=%s&core_version=%s&"
|
||||||
"game_name=%s&game_crc=%08X&port=%d&mitm_server=%s"
|
"game_name=%s&game_crc=%08X&port=%d&mitm_server=%s"
|
||||||
"&has_password=%d&has_spectate_password=%d&force_mitm=%d&retroarch_version=%s&frontend=%s",
|
"&has_password=%d&has_spectate_password=%d&force_mitm=%d"
|
||||||
|
"&retroarch_version=%s&frontend=%s&subsystem_name=%s",
|
||||||
username, corename, coreversion, gamename, content_crc,
|
username, corename, coreversion, gamename, content_crc,
|
||||||
settings->uints.netplay_port,
|
settings->uints.netplay_port,
|
||||||
settings->arrays.netplay_mitm_server,
|
settings->arrays.netplay_mitm_server,
|
||||||
*settings->paths.netplay_password ? 1 : 0,
|
*settings->paths.netplay_password ? 1 : 0,
|
||||||
*settings->paths.netplay_spectate_password ? 1 : 0,
|
*settings->paths.netplay_spectate_password ? 1 : 0,
|
||||||
settings->bools.netplay_use_mitm_server,
|
settings->bools.netplay_use_mitm_server,
|
||||||
PACKAGE_VERSION, frontend_architecture);
|
PACKAGE_VERSION, frontend_architecture, subsystemname);
|
||||||
#if 0
|
#if 0
|
||||||
RARCH_LOG("[netplay] announcement URL: %s\n", buf);
|
RARCH_LOG("[netplay] announcement URL: %s\n", buf);
|
||||||
#endif
|
#endif
|
||||||
|
1
paths.c
1
paths.c
@ -258,7 +258,6 @@ void path_set_special(char **argv, unsigned num_content)
|
|||||||
char str[PATH_MAX_LENGTH];
|
char str[PATH_MAX_LENGTH];
|
||||||
global_t *global = global_get_ptr();
|
global_t *global = global_get_ptr();
|
||||||
|
|
||||||
|
|
||||||
/* First content file is the significant one. */
|
/* First content file is the significant one. */
|
||||||
path_set_basename(argv[0]);
|
path_set_basename(argv[0]);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user