From 2af3020419d98e7376dcdbe8e0e2cebe291b735f Mon Sep 17 00:00:00 2001 From: Diavolo Date: Sun, 3 Dec 2023 17:31:56 +0100 Subject: [PATCH] feat: make t7x parent folder of the players folder --- src/client/component/client_patches.cpp | 8 ++++---- src/client/component/dvars.cpp | 2 +- src/client/component/profile_infos.cpp | 4 ++-- src/client/component/server_list.cpp | 6 +++--- src/client/game/demonware/services/bdStorage.cpp | 2 +- src/common/utils/properties.cpp | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/client/component/client_patches.cpp b/src/client/component/client_patches.cpp index 6cf4aecf..2e67fd89 100644 --- a/src/client/component/client_patches.cpp +++ b/src/client/component/client_patches.cpp @@ -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(0x1422A2AF0_g, path, "t7x_players"); + utils::hook::invoke(0x1422A2AF0_g, path, "t7x/players"); } void patch_players_folder_name() diff --git a/src/client/component/dvars.cpp b/src/client/component/dvars.cpp index 7944f07b..8b1d8414 100644 --- a/src/client/component/dvars.cpp +++ b/src/client/component/dvars.cpp @@ -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) diff --git a/src/client/component/profile_infos.cpp b/src/client/component/profile_infos.cpp index f5dcd3cb..6f1bf5cf 100644 --- a/src/client/component/profile_infos.cpp +++ b/src/client/component/profile_infos.cpp @@ -25,7 +25,7 @@ namespace profile_infos std::optional 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(&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 diff --git a/src/client/component/server_list.cpp b/src/client/component/server_list.cpp index 2aa27d90..06ee324b 100644 --- a/src/client/component/server_list.cpp +++ b/src/client/component/server_list.cpp @@ -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; diff --git a/src/client/game/demonware/services/bdStorage.cpp b/src/client/game/demonware/services/bdStorage.cpp index bbadfd41..7bb8e3dc 100644 --- a/src/client/game/demonware/services/bdStorage.cpp +++ b/src/client/game/demonware/services/bdStorage.cpp @@ -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 diff --git a/src/common/utils/properties.cpp b/src/common/utils/properties.cpp index f3666d9b..88e665fa 100644 --- a/src/common/utils/properties.cpp +++ b/src/common/utils/properties.cpp @@ -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))