diff --git a/TODO.md b/TODO.md index 84a9877f..149422b1 100644 --- a/TODO.md +++ b/TODO.md @@ -33,7 +33,6 @@ ## PSOBB - Find any remaining mismatches in enemy indexes / experience -- Support EXP multipliers in config.json - Fix some edge cases on the BB proxy server (e.g. Change Ship) - Implement less-common subcommands - 6xAC: Sort inventory diff --git a/src/ReceiveCommands.cc b/src/ReceiveCommands.cc index 795fee16..1e901914 100644 --- a/src/ReceiveCommands.cc +++ b/src/ReceiveCommands.cc @@ -3715,6 +3715,9 @@ shared_ptr create_game_generic( game->battle_player = battle_player; battle_player->set_lobby(game); } + if (game->base_version == GameVersion::BB) { + game->base_exp_multiplier = s->bb_global_exp_multiplier; + } for (size_t x = 0; x < 4; x++) { game->next_item_id[x] = (0x00200000 * x) + 0x00010000; diff --git a/src/ServerState.cc b/src/ServerState.cc index 2b749cea..21f59bb9 100644 --- a/src/ServerState.cc +++ b/src/ServerState.cc @@ -38,6 +38,7 @@ ServerState::ServerState(const char* config_filename, bool is_replay) ep3_behavior_flags(0), run_shell_behavior(RunShellBehavior::DEFAULT), cheat_mode_behavior(BehaviorSwitch::OFF_BY_DEFAULT), + bb_global_exp_multiplier(1), ep3_card_auction_points(0), ep3_card_auction_min_size(0), ep3_card_auction_max_size(0), @@ -724,6 +725,8 @@ void ServerState::parse_config(const JSON& json, bool is_reload) { } catch (const out_of_range&) { } + this->bb_global_exp_multiplier = json.get_int("BBGlobalEXPMultiplier", this->bb_global_exp_multiplier); + set_log_levels_from_json(json.get("LogLevels", JSON::dict())); if (!is_reload) { diff --git a/src/ServerState.hh b/src/ServerState.hh index 711d5203..eb8307de 100644 --- a/src/ServerState.hh +++ b/src/ServerState.hh @@ -116,6 +116,7 @@ struct ServerState : public std::enable_shared_from_this { // Indexed as [type][difficulty][random_choice] std::vector>> quest_F95E_results; std::vector secret_lottery_results; + uint16_t bb_global_exp_multiplier; std::shared_ptr ep3_tournament_index; diff --git a/system/config.example.json b/system/config.example.json index de187517..184a7e19 100644 --- a/system/config.example.json +++ b/system/config.example.json @@ -547,6 +547,9 @@ "010132", "010133", "010221", "010224", "010229", "01022B", "010235", "031000", ], + // EXP multiplier for BB games. This must be an integer due to a client + // limitation, and must be at least 1. + "BBGlobalEXPMultiplier": 1, // Cheat mode behavior. There are three values: // "Off": Cheat mode is disabled on the entire server. Cheat mode cannot be diff --git a/tests/config.json b/tests/config.json index 24157f8a..d06f9840 100644 --- a/tests/config.json +++ b/tests/config.json @@ -177,4 +177,5 @@ "010132", "010133", "010221", "010224", "010229", "01022B", "010235", "031000", ], + "BBGlobalEXPMultiplier": 1, }