[Quest API] (Performance) Check event exists before export and execute EVENT_ENTER_ZONE and EVENT_ZONE (#2900)

# Notes
- Optionally parse these events instead of always doing so.
This commit is contained in:
Alex King 2023-02-12 23:32:37 -05:00 committed by GitHub
parent 2dcff247c8
commit 71b2bf6a64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 13 deletions

View File

@ -779,7 +779,9 @@ void Client::CompleteConnect()
TotalKarma = database.GetKarma(AccountID()); TotalKarma = database.GetKarma(AccountID());
SendDisciplineTimers(); SendDisciplineTimers();
parse->EventPlayer(EVENT_ENTER_ZONE, this, "", 0); if (parse->PlayerHasQuestSub(EVENT_ENTER_ZONE)) {
parse->EventPlayer(EVENT_ENTER_ZONE, this, "", 0);
}
// the way that the client deals with positions during the initial spawn struct // the way that the client deals with positions during the initial spawn struct
// is subtly different from how it deals with getting a position update // is subtly different from how it deals with getting a position update

View File

@ -202,19 +202,21 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) {
min_status = zone_data->min_status; min_status = zone_data->min_status;
min_level = zone_data->min_level; min_level = zone_data->min_level;
const auto& export_string = fmt::format( if (parse->PlayerHasQuestSub(EVENT_ZONE)) {
"{} {} {} {} {} {}", const auto& export_string = fmt::format(
zone->GetZoneID(), "{} {} {} {} {} {}",
zone->GetInstanceID(), zone->GetZoneID(),
zone->GetInstanceVersion(), zone->GetInstanceID(),
target_zone_id, zone->GetInstanceVersion(),
target_instance_id, target_zone_id,
target_instance_version target_instance_id,
); target_instance_version
);
if (parse->EventPlayer(EVENT_ZONE, this, export_string, 0) != 0) { if (parse->EventPlayer(EVENT_ZONE, this, export_string, 0) != 0) {
SendZoneCancel(zc); SendZoneCancel(zc);
return; return;
}
} }
if (player_event_logs.IsEventEnabled(PlayerEvent::ZONING)) { if (player_event_logs.IsEventEnabled(PlayerEvent::ZONING)) {