(Netplay) Special saves directory for clients (#14111)

This commit is contained in:
Cthulhu-throwaway 2022-06-29 05:18:39 -03:00 committed by GitHub
parent 11101f23b1
commit 5b6d11cc60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -821,9 +821,7 @@ void retroarch_path_set_redirect(settings_t *settings)
path_basedir(new_savefile_dir);
if (string_is_empty(new_savefile_dir))
RARCH_LOG("Cannot resolve save file path.\n",
msg_hash_to_str(MSG_REVERTING_SAVEFILE_DIRECTORY_TO),
new_savefile_dir);
RARCH_LOG("Cannot resolve save file path.\n");
else if (sort_savefiles_enable || sort_savefiles_by_content_enable)
RARCH_LOG("Saving files in content directory is set. This overrides other save file directory settings.\n");
}
@ -837,13 +835,25 @@ void retroarch_path_set_redirect(settings_t *settings)
path_basedir(new_savestate_dir);
if (string_is_empty(new_savestate_dir))
RARCH_LOG("Cannot resolve save state file path.\n",
msg_hash_to_str(MSG_REVERTING_SAVESTATE_DIRECTORY_TO),
new_savestate_dir);
RARCH_LOG("Cannot resolve save state file path.\n");
else if (sort_savestates_enable || sort_savestates_by_content_enable)
RARCH_LOG("Saving save states in content directory is set. This overrides other save state file directory settings.\n");
}
#ifdef HAVE_NETWORKING
/* Special save directory for netplay clients. */
if (netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_ENABLED, NULL) &&
!netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_SERVER, NULL))
{
fill_pathname_join(new_savefile_dir, new_savefile_dir, ".netplay",
sizeof(new_savefile_dir));
if (!path_is_directory(new_savefile_dir) &&
!path_mkdir(new_savefile_dir))
path_basedir(new_savefile_dir);
}
#endif
if (system && !string_is_empty(system->library_name))
{
bool savefile_is_dir = path_is_directory(new_savefile_dir);