Store properties in boiii_players as well
This commit is contained in:
parent
6762da248b
commit
4f1d825b72
@ -147,7 +147,7 @@ namespace client_patches
|
||||
}
|
||||
|
||||
// TODO: Remove me after some time
|
||||
void migrate_if_needed()
|
||||
extern "C" void migrate_if_needed()
|
||||
{
|
||||
std::error_code e;
|
||||
|
||||
|
@ -16,6 +16,8 @@ namespace utils::properties
|
||||
{
|
||||
namespace
|
||||
{
|
||||
extern "C" void migrate_if_needed();
|
||||
|
||||
typedef rapidjson::EncodedOutputStream<rapidjson::UTF8<>, rapidjson::FileWriteStream> OutputStream;
|
||||
typedef rapidjson::EncodedInputStream<rapidjson::UTF8<>, rapidjson::FileReadStream> InputStream;
|
||||
|
||||
@ -27,7 +29,21 @@ namespace utils::properties
|
||||
|
||||
std::filesystem::path get_properties_file()
|
||||
{
|
||||
static auto props = get_properties_folder() / "properties.json";
|
||||
static auto props = []
|
||||
{
|
||||
auto path = std::filesystem::path("boiii_players/properties.json");
|
||||
const auto legacy_path = get_properties_folder() / "properties.json";
|
||||
|
||||
migrate_if_needed();
|
||||
|
||||
if (io::file_exists(legacy_path) && !io::file_exists(path))
|
||||
{
|
||||
std::error_code e;
|
||||
std::filesystem::copy(legacy_path, path, std::filesystem::copy_options::skip_existing, e);
|
||||
}
|
||||
|
||||
return path;
|
||||
}();
|
||||
return props;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user