diff --git a/src/Account.cc b/src/Account.cc index c237b626..adc3c3ac 100644 --- a/src/Account.cc +++ b/src/Account.cc @@ -1017,8 +1017,7 @@ shared_ptr AccountIndex::create_temporary_account_for_shared_account( return ret; } -AccountIndex::AccountIndex(bool force_all_temporary) - : force_all_temporary(force_all_temporary) { +AccountIndex::AccountIndex(bool force_all_temporary) : force_all_temporary(force_all_temporary) { if (!this->force_all_temporary) { if (!std::filesystem::is_directory("system/licenses")) { std::filesystem::create_directories("system/licenses"); diff --git a/src/ReceiveCommands.cc b/src/ReceiveCommands.cc index 18c8de16..c402a4b9 100644 --- a/src/ReceiveCommands.cc +++ b/src/ReceiveCommands.cc @@ -1581,9 +1581,7 @@ static asio::awaitable on_BA_Ep3(shared_ptr c, Channel::Message& m co_return; } c->login->account->ep3_current_meseta -= in_cmd.value; - if (s->allow_saving_accounts) { - c->login->account->save(); - } + c->login->account->save(); current_meseta = c->login->account->ep3_current_meseta; total_meseta_earned = c->login->account->ep3_total_meseta_earned; } @@ -2061,9 +2059,7 @@ static asio::awaitable on_CA_Ep3(shared_ptr c, Channel::Message& m if (winner_c) { winner_c->login->account->ep3_current_meseta += meseta_reward; winner_c->login->account->ep3_total_meseta_earned += meseta_reward; - if (s->allow_saving_accounts) { - winner_c->login->account->save(); - } + winner_c->login->account->save(); send_ep3_rank_update(winner_c); } } diff --git a/src/ServerState.cc b/src/ServerState.cc index 4743da95..879a9785 100644 --- a/src/ServerState.cc +++ b/src/ServerState.cc @@ -876,7 +876,6 @@ void ServerState::load_config_early() { this->allow_unregistered_users = this->config_json->get_bool("AllowUnregisteredUsers", false); this->allow_pc_nte = this->config_json->get_bool("AllowPCNTE", false); this->allow_same_account_concurrent_logins = this->config_json->get_bool("AllowSameAccountConcurrentLogins", false); - this->allow_saving_accounts = this->config_json->get_bool("AllowSavingAccounts", true); this->use_temp_accounts_for_prototypes = this->config_json->get_bool("UseTemporaryAccountsForPrototypes", true); this->notify_server_for_max_level_achieved = this->config_json->get_bool("NotifyServerForMaxLevelAchieved", false); this->allowed_drop_modes_v1_v2_normal = this->config_json->get_int("AllowedDropModesV1V2Normal", 0x1F); @@ -2357,10 +2356,7 @@ void ServerState::load_all(bool enable_thread_pool) { } void ServerState::reset_between_replays() { - if (this->allow_saving_accounts) { - throw std::logic_error("Account saving is enabled during replay"); - } - this->account_index = make_shared(true); + this->account_index = std::make_shared(true); this->next_lobby_id = 0; std::vector> lobbies_to_delete; diff --git a/tests/config.json b/tests/config.json index a133a9e6..4886950e 100644 --- a/tests/config.json +++ b/tests/config.json @@ -72,7 +72,6 @@ "3SP0": 88533, // EU Ep3 }, "EnableV3V4ProtectedSubcommands": true, - "AllowSavingAccounts": false, "Episode3InfiniteMeseta": false, "Episode3DefeatPlayerMeseta": [400, 500, 600, 700, 800],