disable rare notifs for client drops by default

This commit is contained in:
Martin Michelsen
2024-07-20 11:58:18 -07:00
parent a3cc0bd13f
commit 5523388ad4
4 changed files with 9 additions and 1 deletions
+3 -1
View File
@@ -1956,10 +1956,12 @@ static void on_box_or_enemy_item_drop_t(shared_ptr<Client> c, uint8_t command, u
return;
}
bool should_notify = s->rare_notifs_enabled_for_client_drops && (l->drop_mode == Lobby::DropMode::CLIENT);
ItemData item = cmd.item.item;
item.decode_for_version(c->version());
l->on_item_id_generated_externally(item.id);
l->add_item(cmd.item.floor, item, cmd.item.x, cmd.item.z, (l->drop_mode == Lobby::DropMode::CLIENT) ? 0x100F : 0x000F);
l->add_item(cmd.item.floor, item, cmd.item.x, cmd.item.z, should_notify ? 0x100F : 0x000F);
auto name = s->describe_item(c->version(), item, false);
l->log.info("Player %hhu (leader) created floor item %08" PRIX32 " (%s) at %hhu:(%g, %g)",
+1
View File
@@ -789,6 +789,7 @@ void ServerState::load_config_early() {
this->cheat_mode_behavior = parse_behavior_switch("CheatModeBehavior", BehaviorSwitch::OFF_BY_DEFAULT);
this->default_switch_assist_enabled = this->config_json->get_bool("EnableSwitchAssistByDefault", false);
this->use_game_creator_section_id = this->config_json->get_bool("UseGameCreatorSectionID", false);
this->rare_notifs_enabled_for_client_drops = this->config_json->get_bool("RareNotificationsEnabledForClientDrops", false);
this->default_rare_notifs_enabled_v1_v2 = this->config_json->get_bool("RareNotificationsEnabledByDefault", false);
this->default_rare_notifs_enabled_v3_v4 = this->default_rare_notifs_enabled_v1_v2;
this->default_rare_notifs_enabled_v1_v2 = this->config_json->get_bool("RareNotificationsEnabledByDefaultV1V2", this->default_rare_notifs_enabled_v1_v2);
+1
View File
@@ -134,6 +134,7 @@ struct ServerState : public std::enable_shared_from_this<ServerState> {
BehaviorSwitch cheat_mode_behavior = BehaviorSwitch::OFF_BY_DEFAULT;
bool default_switch_assist_enabled = false;
bool use_game_creator_section_id = false;
bool rare_notifs_enabled_for_client_drops = false;
bool default_rare_notifs_enabled_v1_v2 = false;
bool default_rare_notifs_enabled_v3_v4 = false;
std::unordered_set<uint32_t> notify_game_for_item_primary_identifiers_v1_v2;
+4
View File
@@ -1006,6 +1006,10 @@
"RareNotificationsEnabledByDefaultV1V2": false,
"RareNotificationsEnabledByDefaultV3V4": false,
// If this is true, items generated in client drop mode can trigger rare drop
// notifications. By default, they can't.
"RareNotificationsEnabledForClientDrops": false,
// Items for which rare notifications should be broadcast to the game or
// entire server. These notifications occur when the item is picked up. They
// only are generated from items dropped by boxes and enemies; items dropped