feat: make t7x parent folder of the players folder

This commit is contained in:
Diavolo 2023-12-03 17:31:56 +01:00
parent cdf12853c6
commit 2af3020419
6 changed files with 12 additions and 12 deletions

View File

@ -127,23 +127,23 @@ namespace client_patches
game::fileHandle_t fs_f_open_file_write_to_dir_stub(const char* filename, [[maybe_unused]] const char* dir,
const char* os_base_path)
{
return game::FS_FOpenFileWriteToDir(filename, "t7x_players", os_base_path);
return game::FS_FOpenFileWriteToDir(filename, "t7x/players", os_base_path);
}
game::fileHandle_t fs_f_open_file_read_from_dir_stub(const char* filename, [[maybe_unused]] const char* dir,
const char* os_base_path)
{
return game::FS_FOpenFileReadFromDir(filename, "t7x_players", os_base_path);
return game::FS_FOpenFileReadFromDir(filename, "t7x/players", os_base_path);
}
int i_stricmp_stub(const char* s0, [[maybe_unused]] const char* s1)
{
return game::I_stricmp(s0, "t7x_players");
return game::I_stricmp(s0, "t7x/players");
}
void fs_add_game_directory_stub(const char* path, [[maybe_unused]] const char* dir)
{
utils::hook::invoke<void>(0x1422A2AF0_g, path, "t7x_players");
utils::hook::invoke<void>(0x1422A2AF0_g, path, "t7x/players");
}
void patch_players_folder_name()

View File

@ -104,7 +104,7 @@ namespace dvars
std::string get_config_file_path()
{
return "t7x_players/user/config.cfg";
return "t7x/players/user/config.cfg";
}
bool is_archive_dvar(const game::dvar_t* dvar)

View File

@ -25,7 +25,7 @@ namespace profile_infos
std::optional<profile_info> load_profile_info()
{
std::string data{};
if (!utils::io::read_file("t7x_players/user/profile_info", &data))
if (!utils::io::read_file("t7x/players/user/profile_info", &data))
{
return {};
}
@ -237,7 +237,7 @@ namespace profile_infos
data.append(reinterpret_cast<const char*>(&info.version), sizeof(info.version));
data.append(info.ddl);
utils::io::write_file("t7x_players/user/profile_info", data);
utils::io::write_file("t7x/players/user/profile_info", data);
}
struct component final : generic_component

View File

@ -91,9 +91,9 @@ namespace server_list
}
}
std::string get_favorite_servers_file_path()
const char* get_favorite_servers_file_path()
{
return "t7x_players/user/favorite_servers.txt";
return "t7x/players/user/favorite_servers.txt";
}
void write_favorite_servers()
@ -112,7 +112,7 @@ namespace server_list
void read_favorite_servers()
{
const std::string path = get_favorite_servers_file_path();
const auto* path = get_favorite_servers_file_path();
if (!utils::io::file_exists(path))
{
return;

View File

@ -173,7 +173,7 @@ namespace demonware
std::string bdStorage::get_user_file_path(const std::string& name)
{
return "t7x_players/user/" + name;
return "t7x/players/user/" + name;
}
void bdStorage::upload_files(service_server* server, byte_buffer* buffer) const

View File

@ -29,7 +29,7 @@ namespace utils::properties
{
static auto props = []
{
auto path = std::filesystem::path("t7x_players/properties.json");
auto path = std::filesystem::path("t7x/players/properties.json");
const auto legacy_path = get_properties_folder() / "properties.json";
if (io::file_exists(legacy_path) && !io::file_exists(path))