mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-01-31 16:52:45 +00:00
Revert "Create path server and add to paths.c"
This reverts commit 00a1e3716afcbdad74c560eceb96753e5a9fce79.
This commit is contained in:
parent
7d20224ff0
commit
243dc139d2
@ -587,7 +587,7 @@ static int populate_settings_path(settings_t *settings, struct config_path_setti
|
||||
SETTING_PATH("core_updater_buildbot_url", settings->network.buildbot_url, false, NULL, true);
|
||||
SETTING_PATH("core_updater_buildbot_assets_url", settings->network.buildbot_assets_url, false, NULL, true);
|
||||
#ifdef HAVE_NETWORKING
|
||||
SETTING_PATH("netplay_ip_address", path_get_server_ptr(), false, NULL, true);
|
||||
SETTING_PATH("netplay_ip_address", global->netplay.server, false, NULL, true);
|
||||
#endif
|
||||
SETTING_PATH("recording_output_directory",
|
||||
global->record.output_dir, false, NULL, true);
|
||||
@ -1766,8 +1766,8 @@ static bool config_load_file(const char *path, bool set_defaults,
|
||||
override_username = strdup(settings->username);
|
||||
|
||||
#ifdef HAVE_NETWORKING
|
||||
if (retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_NETPLAY_IP_ADDRESS, NULL))
|
||||
override_netplay_ip_address = strdup(path_get(RARCH_PATH_SERVER));
|
||||
if (retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_NETPLAY_IP_ADDRESS))
|
||||
override_netplay_ip_address = strdup(global->netplay.server);
|
||||
#endif
|
||||
|
||||
/* Boolean settings */
|
||||
@ -1956,7 +1956,7 @@ static bool config_load_file(const char *path, bool set_defaults,
|
||||
#ifdef HAVE_NETWORKING
|
||||
if (retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_NETPLAY_IP_ADDRESS, NULL))
|
||||
{
|
||||
path_set(RARCH_PATH_SERVER, override_netplay_ip_address);
|
||||
strlcpy(global->netplay.server, override_netplay_ip_address, sizeof(global->netplay.server));
|
||||
free(override_netplay_ip_address);
|
||||
}
|
||||
#endif
|
||||
|
@ -3297,8 +3297,7 @@ static int action_ok_netplay_enable_host(const char *path,
|
||||
}
|
||||
|
||||
global->netplay.is_client = false;
|
||||
|
||||
path_clear(RARCH_PATH_SERVER);
|
||||
global->netplay.server[0] = '\0';
|
||||
|
||||
/* If we haven't yet started, this will load on its own */
|
||||
if (!content_is_inited())
|
||||
@ -3345,7 +3344,7 @@ static int action_ok_netplay_enable_client(const char *path,
|
||||
global->netplay.is_client = true;
|
||||
|
||||
/* We can't do anything without a host specified */
|
||||
if (path_is_empty(RARCH_PATH_SERVER))
|
||||
if (!global->netplay.server[0])
|
||||
{
|
||||
runloop_msg_queue_push(
|
||||
"Please specify the Netplay server's IP address or hostname.",
|
||||
|
@ -1657,14 +1657,14 @@ void general_write_handler(void *data)
|
||||
case MENU_ENUM_LABEL_NETPLAY_MODE:
|
||||
#ifdef HAVE_NETWORKING
|
||||
if (!global->netplay.is_client)
|
||||
path_clear(RARCH_PATH_SERVER);
|
||||
retroarch_override_setting_set(RARCH_OVERRIDE_SETTING_NETPLAY_MODE, NULL);
|
||||
*global->netplay.server = '\0';
|
||||
retroarch_override_setting_set(RARCH_OVERRIDE_SETTING_NETPLAY_MODE);
|
||||
#endif
|
||||
break;
|
||||
case MENU_ENUM_LABEL_NETPLAY_SPECTATOR_MODE_ENABLE:
|
||||
#ifdef HAVE_NETWORKING
|
||||
if (global->netplay.is_spectate)
|
||||
path_clear(RARCH_PATH_SERVER);
|
||||
*global->netplay.server = '\0';
|
||||
#endif
|
||||
break;
|
||||
case MENU_ENUM_LABEL_NETPLAY_DELAY_FRAMES:
|
||||
@ -5810,8 +5810,8 @@ static bool setting_append_list(
|
||||
|
||||
CONFIG_STRING(
|
||||
list, list_info,
|
||||
path_get_server_ptr(),
|
||||
path_get_server_size(),
|
||||
global->netplay.server,
|
||||
sizeof(global->netplay.server),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_NETPLAY_IP_ADDRESS),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETPLAY_IP_ADDRESS),
|
||||
"",
|
||||
|
@ -34,7 +34,6 @@
|
||||
#include "../../configuration.h"
|
||||
#include "../../command.h"
|
||||
#include "../../movie.h"
|
||||
#include "../../paths.h"
|
||||
#include "../../runloop.h"
|
||||
|
||||
#define MAX_STALL_TIME_USEC (10*1000*1000)
|
||||
@ -1339,7 +1338,7 @@ bool init_netplay(void)
|
||||
|
||||
core_set_default_callbacks(&cbs);
|
||||
|
||||
if (!path_is_empty(RARCH_PATH_SERVER))
|
||||
if (*global->netplay.server)
|
||||
{
|
||||
RARCH_LOG("Connecting to netplay host...\n");
|
||||
global->netplay.is_client = true;
|
||||
@ -1353,13 +1352,10 @@ bool init_netplay(void)
|
||||
}
|
||||
|
||||
netplay_data = (netplay_t*)netplay_new(
|
||||
global->netplay.is_client ? path_get(RARCH_PATH_SERVER) : NULL,
|
||||
global->netplay.port ? global->netplay.port : RARCH_DEFAULT_PORT,
|
||||
global->netplay.sync_frames,
|
||||
global->netplay.check_frames,
|
||||
&cbs,
|
||||
global->netplay.is_spectate,
|
||||
settings->username);
|
||||
global->netplay.is_client ? global->netplay.server : NULL,
|
||||
global->netplay.port ? global->netplay.port : RARCH_DEFAULT_PORT,
|
||||
global->netplay.sync_frames, global->netplay.check_frames, &cbs,
|
||||
global->netplay.is_spectate, settings->username);
|
||||
|
||||
if (netplay_data)
|
||||
return true;
|
||||
|
23
paths.c
23
paths.c
@ -51,7 +51,6 @@
|
||||
/* For --subsystem content. */
|
||||
static struct string_list *subsystem_fullpaths = NULL;
|
||||
|
||||
static char path_server[PATH_MAX_LENGTH] = {0};
|
||||
static char path_savefile[PATH_MAX_LENGTH] = {0};
|
||||
static char path_savestate[PATH_MAX_LENGTH] = {0};
|
||||
static char path_cheatfile[PATH_MAX_LENGTH] = {0};
|
||||
@ -497,11 +496,6 @@ char *path_get_core_ptr(void)
|
||||
return path_libretro;
|
||||
}
|
||||
|
||||
char *path_get_server_ptr(void)
|
||||
{
|
||||
return path_server;
|
||||
}
|
||||
|
||||
const char *path_get(enum rarch_path_type type)
|
||||
{
|
||||
switch (type)
|
||||
@ -514,8 +508,6 @@ const char *path_get(enum rarch_path_type type)
|
||||
return path_cheatfile;
|
||||
case RARCH_PATH_REMAPFILE:
|
||||
return path_remapfile;
|
||||
case RARCH_PATH_SERVER:
|
||||
return path_server;
|
||||
case RARCH_PATH_IPS:
|
||||
return path_ips;
|
||||
case RARCH_PATH_BPS:
|
||||
@ -548,10 +540,6 @@ const char *path_get(enum rarch_path_type type)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
size_t path_get_server_size(void)
|
||||
{
|
||||
return sizeof(path_server);
|
||||
}
|
||||
|
||||
size_t path_get_core_size(void)
|
||||
{
|
||||
@ -620,10 +608,6 @@ bool path_set(enum rarch_path_type type, const char *path)
|
||||
strlcpy(path_remapfile, path,
|
||||
sizeof(path_remapfile));
|
||||
break;
|
||||
case RARCH_PATH_SERVER:
|
||||
strlcpy(path_server, path,
|
||||
sizeof(path_server));
|
||||
break;
|
||||
case RARCH_PATH_IPS:
|
||||
strlcpy(path_ips, path,
|
||||
sizeof(path_ips));
|
||||
@ -692,10 +676,6 @@ bool path_is_empty(enum rarch_path_type type)
|
||||
if (string_is_empty(path_remapfile))
|
||||
return true;
|
||||
break;
|
||||
case RARCH_PATH_SERVER:
|
||||
if (string_is_empty(path_server))
|
||||
return true;
|
||||
break;
|
||||
case RARCH_PATH_IPS:
|
||||
if (string_is_empty(path_ips))
|
||||
return true;
|
||||
@ -757,9 +737,6 @@ void path_clear(enum rarch_path_type type)
|
||||
case RARCH_PATH_REMAPFILE:
|
||||
*path_remapfile = '\0';
|
||||
break;
|
||||
case RARCH_PATH_SERVER:
|
||||
*path_server = '\0';
|
||||
break;
|
||||
case RARCH_PATH_IPS:
|
||||
*path_ips = '\0';
|
||||
break;
|
||||
|
5
paths.h
5
paths.h
@ -45,7 +45,6 @@ enum rarch_path_type
|
||||
RARCH_PATH_IPS,
|
||||
RARCH_PATH_BPS,
|
||||
RARCH_PATH_REMAPFILE,
|
||||
RARCH_PATH_SERVER,
|
||||
RARCH_PATH_CONFIG_APPEND,
|
||||
RARCH_PATH_CORE_OPTIONS,
|
||||
RARCH_PATH_DEFAULT_SHADER_PRESET,
|
||||
@ -76,16 +75,12 @@ void path_set_basename(const char *path);
|
||||
|
||||
/* get size functions */
|
||||
|
||||
size_t path_get_server_size(void);
|
||||
|
||||
size_t path_get_core_size(void);
|
||||
|
||||
/* get ptr functions */
|
||||
|
||||
char *path_get_core_ptr(void);
|
||||
|
||||
char *path_get_server_ptr(void);
|
||||
|
||||
/* get list functions */
|
||||
|
||||
struct string_list *path_get_subsystem_list(void);
|
||||
|
@ -689,14 +689,15 @@ static void retroarch_parse_input(int argc, char *argv[])
|
||||
retroarch_override_setting_set(
|
||||
RARCH_OVERRIDE_SETTING_NETPLAY_IP_ADDRESS, NULL);
|
||||
global->netplay.enable = true;
|
||||
path_clear(RARCH_PATH_SERVER);
|
||||
*global->netplay.server = '\0';
|
||||
break;
|
||||
|
||||
case 'C':
|
||||
retroarch_override_setting_set(
|
||||
RARCH_OVERRIDE_SETTING_NETPLAY_IP_ADDRESS, NULL);
|
||||
global->netplay.enable = true;
|
||||
path_set(RARCH_PATH_SERVER, optarg);
|
||||
strlcpy(global->netplay.server, optarg,
|
||||
sizeof(global->netplay.server));
|
||||
break;
|
||||
|
||||
case 'F':
|
||||
|
@ -748,7 +748,6 @@ bool runloop_ctl(enum runloop_ctl_state state, void *data)
|
||||
path_clear(RARCH_PATH_SAVESTATE);
|
||||
path_clear(RARCH_PATH_CHEATFILE);
|
||||
path_clear(RARCH_PATH_REMAPFILE);
|
||||
path_clear(RARCH_PATH_SERVER);
|
||||
path_clear(RARCH_PATH_IPS);
|
||||
path_clear(RARCH_PATH_UPS);
|
||||
path_clear(RARCH_PATH_BPS);
|
||||
|
Loading…
x
Reference in New Issue
Block a user