remove unnecessary config var

This commit is contained in:
Martin Michelsen
2026-05-25 07:58:55 -07:00
parent b59dde53b2
commit e5b3abd49f
4 changed files with 4 additions and 14 deletions
+1 -2
View File
@@ -1017,8 +1017,7 @@ shared_ptr<Account> AccountIndex::create_temporary_account_for_shared_account(
return ret; return ret;
} }
AccountIndex::AccountIndex(bool force_all_temporary) AccountIndex::AccountIndex(bool force_all_temporary) : force_all_temporary(force_all_temporary) {
: force_all_temporary(force_all_temporary) {
if (!this->force_all_temporary) { if (!this->force_all_temporary) {
if (!std::filesystem::is_directory("system/licenses")) { if (!std::filesystem::is_directory("system/licenses")) {
std::filesystem::create_directories("system/licenses"); std::filesystem::create_directories("system/licenses");
-4
View File
@@ -1581,9 +1581,7 @@ static asio::awaitable<void> on_BA_Ep3(shared_ptr<Client> c, Channel::Message& m
co_return; co_return;
} }
c->login->account->ep3_current_meseta -= in_cmd.value; 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; current_meseta = c->login->account->ep3_current_meseta;
total_meseta_earned = c->login->account->ep3_total_meseta_earned; total_meseta_earned = c->login->account->ep3_total_meseta_earned;
} }
@@ -2061,9 +2059,7 @@ static asio::awaitable<void> on_CA_Ep3(shared_ptr<Client> c, Channel::Message& m
if (winner_c) { if (winner_c) {
winner_c->login->account->ep3_current_meseta += meseta_reward; winner_c->login->account->ep3_current_meseta += meseta_reward;
winner_c->login->account->ep3_total_meseta_earned += 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); send_ep3_rank_update(winner_c);
} }
} }
+1 -5
View File
@@ -876,7 +876,6 @@ void ServerState::load_config_early() {
this->allow_unregistered_users = this->config_json->get_bool("AllowUnregisteredUsers", false); this->allow_unregistered_users = this->config_json->get_bool("AllowUnregisteredUsers", false);
this->allow_pc_nte = this->config_json->get_bool("AllowPCNTE", 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_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->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->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); 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() { void ServerState::reset_between_replays() {
if (this->allow_saving_accounts) { this->account_index = std::make_shared<AccountIndex>(true);
throw std::logic_error("Account saving is enabled during replay");
}
this->account_index = make_shared<AccountIndex>(true);
this->next_lobby_id = 0; this->next_lobby_id = 0;
std::vector<std::shared_ptr<Lobby>> lobbies_to_delete; std::vector<std::shared_ptr<Lobby>> lobbies_to_delete;
-1
View File
@@ -72,7 +72,6 @@
"3SP0": 88533, // EU Ep3 "3SP0": 88533, // EU Ep3
}, },
"EnableV3V4ProtectedSubcommands": true, "EnableV3V4ProtectedSubcommands": true,
"AllowSavingAccounts": false,
"Episode3InfiniteMeseta": false, "Episode3InfiniteMeseta": false,
"Episode3DefeatPlayerMeseta": [400, 500, 600, 700, 800], "Episode3DefeatPlayerMeseta": [400, 500, 600, 700, 800],