add config option to enable rare notifs by default

This commit is contained in:
Martin Michelsen
2024-01-01 11:30:30 -08:00
parent 962ee6874e
commit c6ce39623e
5 changed files with 10 additions and 0 deletions
+3
View File
@@ -195,6 +195,9 @@ Client::Client(
external_bank_character_index(-1), external_bank_character_index(-1),
last_play_time_update(0) { last_play_time_update(0) {
this->config.set_flags_for_version(version, -1); this->config.set_flags_for_version(version, -1);
if (server->get_state()->default_rare_notifs_enabled) {
this->config.set_flag(Flag::RARE_DROP_NOTIFICATIONS_ENABLED);
}
this->config.specific_version = default_specific_version_for_version(version, -1); this->config.specific_version = default_specific_version_for_version(version, -1);
this->last_switch_enabled_command.header.subcommand = 0; this->last_switch_enabled_command.header.subcommand = 0;
+1
View File
@@ -656,6 +656,7 @@ void ServerState::load_config() {
this->persistent_game_idle_timeout_usecs = json.get_int("PersistentGameIdleTimeout", this->persistent_game_idle_timeout_usecs); this->persistent_game_idle_timeout_usecs = json.get_int("PersistentGameIdleTimeout", this->persistent_game_idle_timeout_usecs);
this->cheat_mode_behavior = parse_behavior_switch("CheatModeBehavior", this->cheat_mode_behavior); this->cheat_mode_behavior = parse_behavior_switch("CheatModeBehavior", this->cheat_mode_behavior);
this->default_rare_notifs_enabled = json.get_bool("RareNotificationsEnabledByDefault", this->default_rare_notifs_enabled);
this->ep3_send_function_call_enabled = json.get_bool("EnableEpisode3SendFunctionCall", this->ep3_send_function_call_enabled); this->ep3_send_function_call_enabled = json.get_bool("EnableEpisode3SendFunctionCall", this->ep3_send_function_call_enabled);
this->catch_handler_exceptions = json.get_bool("CatchHandlerExceptions", this->catch_handler_exceptions); this->catch_handler_exceptions = json.get_bool("CatchHandlerExceptions", this->catch_handler_exceptions);
+1
View File
@@ -116,6 +116,7 @@ struct ServerState : public std::enable_shared_from_this<ServerState> {
bool hide_download_commands = true; bool hide_download_commands = true;
RunShellBehavior run_shell_behavior = RunShellBehavior::DEFAULT; RunShellBehavior run_shell_behavior = RunShellBehavior::DEFAULT;
BehaviorSwitch cheat_mode_behavior = BehaviorSwitch::OFF_BY_DEFAULT; BehaviorSwitch cheat_mode_behavior = BehaviorSwitch::OFF_BY_DEFAULT;
bool default_rare_notifs_enabled = false;
std::vector<std::shared_ptr<const PSOBBEncryption::KeyFile>> bb_private_keys; std::vector<std::shared_ptr<const PSOBBEncryption::KeyFile>> bb_private_keys;
std::shared_ptr<const FunctionCodeIndex> function_code_index; std::shared_ptr<const FunctionCodeIndex> function_code_index;
std::shared_ptr<const PatchFileIndex> pc_patch_file_index; std::shared_ptr<const PatchFileIndex> pc_patch_file_index;
+4
View File
@@ -775,6 +775,10 @@
// available on the proxy server. // available on the proxy server.
"CheatModeBehavior": "OnByDefault", "CheatModeBehavior": "OnByDefault",
// Whether to enable rare drop notifications by default. Players can toggle
// this behavior for themselves with the $rarenotifs command.
"RareNotificationsEnabledByDefault": false,
// Whether to enable patches on Episode 3 USA. This functionality depends on // Whether to enable patches on Episode 3 USA. This functionality depends on
// exploiting a bug in Episode 3, and while it seems to work reliably on // exploiting a bug in Episode 3, and while it seems to work reliably on
// Dolphin, it hasn't been tested on a real GameCube. So, newserv doesn't // Dolphin, it hasn't been tested on a real GameCube. So, newserv doesn't
+1
View File
@@ -30,6 +30,7 @@
"DefaultDropModeV4Battle": "SERVER_SHARED", "DefaultDropModeV4Battle": "SERVER_SHARED",
"DefaultDropModeV4Challenge": "SERVER_SHARED", "DefaultDropModeV4Challenge": "SERVER_SHARED",
"CheatModeBehavior": "OnByDefault", "CheatModeBehavior": "OnByDefault",
"RareNotificationsEnabledByDefault": false,
"LocalAddress": "en0", "LocalAddress": "en0",
"ExternalAddress": "en0", "ExternalAddress": "en0",