add option to disable Ep3 infinite meseta

This commit is contained in:
Martin Michelsen
2023-08-30 18:45:04 -07:00
parent eab453413e
commit 50ded155ed
6 changed files with 16 additions and 5 deletions
+3 -1
View File
@@ -249,8 +249,10 @@ void on_login_complete(shared_ptr<ServerState> s, shared_ptr<Client> 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);
}
+3 -3
View File
@@ -2209,9 +2209,9 @@ void send_ep3_media_update(
send_command(c, 0xB9, 0x00, w.str());
}
void send_ep3_rank_update(shared_ptr<Client> 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<ServerState> s, shared_ptr<Client> 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);
}
+1 -1
View File
@@ -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<Client> c);
void send_ep3_rank_update(std::shared_ptr<ServerState> s, std::shared_ptr<Client> c);
void send_ep3_card_battle_table_state(std::shared_ptr<Lobby> l, uint16_t table_number);
void send_ep3_set_context_token(std::shared_ptr<Client> c, uint32_t context_token);
+1
View File
@@ -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),
+1
View File
@@ -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;
+7
View File
@@ -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: