diff --git a/src/ReceiveCommands.cc b/src/ReceiveCommands.cc index 77702070..0282e558 100644 --- a/src/ReceiveCommands.cc +++ b/src/ReceiveCommands.cc @@ -249,8 +249,10 @@ void on_login_complete(shared_ptr s, shared_ptr c) { } else if (s->pre_lobby_event) { send_change_event(c, s->pre_lobby_event); } - send_ep3_rank_update(c); + + send_ep3_rank_update(s, c); send_get_player_info(c); + } else if (s->pre_lobby_event) { send_change_event(c, s->pre_lobby_event); } diff --git a/src/SendCommands.cc b/src/SendCommands.cc index c3d3a449..42957e6d 100644 --- a/src/SendCommands.cc +++ b/src/SendCommands.cc @@ -2209,9 +2209,9 @@ void send_ep3_media_update( send_command(c, 0xB9, 0x00, w.str()); } -void send_ep3_rank_update(shared_ptr c) { - S_RankUpdate_GC_Ep3_B7 cmd = { - 0, "\0\0\0\0\0\0\0\0\0\0\0", 1000000, 1000000, 0xFFFFFFFF}; +void send_ep3_rank_update(shared_ptr s, shared_ptr c) { + uint32_t meseta = s->ep3_infinite_meseta ? 1000000 : 0; + S_RankUpdate_GC_Ep3_B7 cmd = {0, "\0\0\0\0\0\0\0\0\0\0\0", meseta, meseta, 0xFFFFFFFF}; send_command_t(c, 0xB7, 0x00, cmd); } diff --git a/src/SendCommands.hh b/src/SendCommands.hh index 5ad57f29..29fd5faa 100644 --- a/src/SendCommands.hh +++ b/src/SendCommands.hh @@ -332,7 +332,7 @@ void send_ep3_media_update( uint32_t type, uint32_t which, const std::string& compressed_data); -void send_ep3_rank_update(std::shared_ptr c); +void send_ep3_rank_update(std::shared_ptr s, std::shared_ptr c); void send_ep3_card_battle_table_state(std::shared_ptr l, uint16_t table_number); void send_ep3_set_context_token(std::shared_ptr c, uint32_t context_token); diff --git a/src/ServerState.cc b/src/ServerState.cc index 01f350f7..d9285a64 100644 --- a/src/ServerState.cc +++ b/src/ServerState.cc @@ -26,6 +26,7 @@ ServerState::ServerState(const char* config_filename, bool is_replay) drops_enabled(true), episode_3_send_function_call_enabled(false), catch_handler_exceptions(true), + ep3_infinite_meseta(true), ep3_behavior_flags(0), run_shell_behavior(RunShellBehavior::DEFAULT), cheat_mode_behavior(CheatModeBehavior::OFF_BY_DEFAULT), diff --git a/src/ServerState.hh b/src/ServerState.hh index 9d3616b4..3c2e7fc5 100644 --- a/src/ServerState.hh +++ b/src/ServerState.hh @@ -61,6 +61,7 @@ struct ServerState { bool drops_enabled; bool episode_3_send_function_call_enabled; bool catch_handler_exceptions; + bool ep3_infinite_meseta; uint32_t ep3_behavior_flags; RunShellBehavior run_shell_behavior; CheatModeBehavior cheat_mode_behavior; diff --git a/system/config.example.json b/system/config.example.json index 33bc3b63..ea293670 100644 --- a/system/config.example.json +++ b/system/config.example.json @@ -283,6 +283,13 @@ // they are at the newserv main menu. If set, this value must be an integer. // "Episode3MenuSong": 0, + // Episode Meseta behavior. If enabled (which is the default), all players + // have infinite Meseta, which effectively makes jukebox songs and Pinz's Shop + // free. If disabled, all players have no Meseta, which makes these features + // inaccessible. Proper Meseta behavior will be implemented at some point in + // the future. + "Episode3InfiniteMeseta": true, + // Episode 3 battle behavior flags. When set to zero, battles behave as they // did on the original Sega servers. Combinations of behaviors can be enabled // by bitwise-OR'ing together the following values: