mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 19:48:26 +00:00
[Player Event Logs] Migrate and Deprecate QS Legacy Logging (#4542)
* First pass of player_event_loot_items * Second pass of player_event_loot_items * Third pass of player_event_loot_items * Example without RecordDetailEvent template * Cleanup the removal of the template * Fourth Pass Add retention for etl tables Rename tables/fields to etl nomenclature Combine database work to one atomic load * Reposition to reduce db tasks * Refactor etl processing for easier additions * Add merchant purchase event testing passed though appears that the event itself has a few bugs. Will fix them in another commit * Fix PlayerEventMerchantPurchase in client_packet.cpp * WIP - Handin * Handin Event added * Cleanup * All a rentention period of 0 days which deletes all current records. * Updates Cleanup and refactor a few items. * Cleanup and Formatting Cleanup and Formatting * Add etl for Playerevent::Trade PlayerEvent::Speech (new event to mirror functionality of qs_speech * Add etl for Playerevent::KilledNPC, KilledNamedNPC and KilledRaidNPC * Add etl for Playerevent::AA_purchase Add etl for Playerevent::AA_purchase * Cleanup before PR * Review comment updates. * Add world cli etl:settings to output a json on all player event details. * Add reserve for all etl_queues Correct a failed test case for improper next id for etl tables when table is first created. * Potential solution for a dedicated database connection for player events. * Simple thread for player_events. Likely there is a better way to do this. * Add zone to qs communications for recordplayerevents First pass of enabling zone to qs direct transport to allow for PlayerEvents to bypass world. * Cleanup a linux compile issue * Add augments to LOOT ITEM and DESTROY ITEM * Add augments to ITEMCREATION, FORAGESUCCESS, FISHSUCCESS, DESTROYITEM, LOOTITEM, DROPPEDITEM, TRADERPURCHASE, TRADERSELL, GUILDTRIBUTEDONATE and cleaned up the naming convention of augments * Formatting fixes * Swap out GetNextTableId * Statically load counter * Add counter.clear() since the counter is static * Upload optional QS conversion scripts * Remove all qs_tables and code referencing them * Update database.cpp * Simplify ProcessBatchQueue * Simplify PorcessBatchQueue * Simplify event truncation * Build event truncation to bulk query by retention groups * Post rebase * Update player_events.h * Fix build * Update npc.cpp * First pass of direct zone to qs sending for player events * Remove keepalive logic * Fix event ordering * Cleanup * Update player_event_logs.cpp * Wipe event data after ETL processed * Split up database connections, hot reload logs for QS * Load rules from database vs qs_database * Update player_event_logs.cpp * Hot toggle queryserv connect --------- Co-authored-by: Akkadius <akkadius1@gmail.com>
This commit is contained in:
@@ -2163,14 +2163,6 @@ bool Client::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::Skil
|
||||
GoToDeath();
|
||||
}
|
||||
|
||||
/* QS: PlayerLogDeaths */
|
||||
if (RuleB(QueryServ, PlayerLogDeaths)) {
|
||||
const char * killer_name = "";
|
||||
if (killer_mob && killer_mob->GetCleanName()) { killer_name = killer_mob->GetCleanName(); }
|
||||
std::string event_desc = StringFormat("Died in zoneid:%i instid:%i by '%s', spellid:%i, damage:%i", GetZoneID(), GetInstanceID(), killer_name, spell, damage);
|
||||
QServ->PlayerLogEvent(Player_Log_Deaths, CharacterID(), event_desc);
|
||||
}
|
||||
|
||||
if (player_event_logs.IsEventEnabled(PlayerEvent::DEATH)) {
|
||||
auto e = PlayerEvent::DeathEvent{
|
||||
.killer_id = killer_mob ? static_cast<uint32>(killer_mob->GetID()) : static_cast<uint32>(0),
|
||||
@@ -2723,37 +2715,6 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
|
||||
player_count++;
|
||||
}
|
||||
}
|
||||
|
||||
// QueryServ Logging - Raid Kills
|
||||
if (RuleB(QueryServ, PlayerLogNPCKills)) {
|
||||
auto pack = new ServerPacket(
|
||||
ServerOP_QSPlayerLogNPCKills,
|
||||
sizeof(QSPlayerLogNPCKill_Struct) +
|
||||
(sizeof(QSPlayerLogNPCKillsPlayers_Struct) * player_count)
|
||||
);
|
||||
|
||||
player_count = 0;
|
||||
|
||||
auto QS = (QSPlayerLogNPCKill_Struct*)pack->pBuffer;
|
||||
|
||||
QS->s1.NPCID = GetNPCTypeID();
|
||||
QS->s1.ZoneID = GetZoneID();
|
||||
QS->s1.Type = 2; // Raid Fight
|
||||
|
||||
for (const auto& m : killer_raid->members) {
|
||||
if (m.is_bot) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m.member && m.member->IsClient()) {
|
||||
QS->Chars[player_count].char_id = m.member->CastToClient()->CharacterID();
|
||||
player_count++;
|
||||
}
|
||||
}
|
||||
|
||||
worldserver.SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
}
|
||||
} else if (give_exp_client->IsGrouped() && killer_group) {
|
||||
if (!is_ldon_treasure && MerchantType == 0) {
|
||||
killer_group->SplitExp(ExpSource::Kill, final_exp, this);
|
||||
@@ -2787,33 +2748,6 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
|
||||
player_count++;
|
||||
}
|
||||
}
|
||||
|
||||
// QueryServ Logging - Group Kills
|
||||
if (RuleB(QueryServ, PlayerLogNPCKills)) {
|
||||
auto pack = new ServerPacket(
|
||||
ServerOP_QSPlayerLogNPCKills,
|
||||
sizeof(QSPlayerLogNPCKill_Struct) +
|
||||
(sizeof(QSPlayerLogNPCKillsPlayers_Struct) * player_count)
|
||||
);
|
||||
|
||||
player_count = 0;
|
||||
|
||||
auto QS = (QSPlayerLogNPCKill_Struct*) pack->pBuffer;
|
||||
|
||||
QS->s1.NPCID = GetNPCTypeID();
|
||||
QS->s1.ZoneID = GetZoneID();
|
||||
QS->s1.Type = 1; // Group Fight
|
||||
|
||||
for (const auto& m : killer_group->members) {
|
||||
if (m && m->IsClient()) {
|
||||
QS->Chars[player_count].char_id = m->CastToClient()->CharacterID();
|
||||
player_count++;
|
||||
}
|
||||
}
|
||||
|
||||
worldserver.SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
}
|
||||
} else {
|
||||
if (!is_ldon_treasure && !MerchantType) {
|
||||
const uint32 con_level = give_exp->GetLevelCon(GetLevel());
|
||||
@@ -2844,28 +2778,6 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
|
||||
give_exp_client->GetDeity()
|
||||
);
|
||||
}
|
||||
|
||||
// QueryServ Logging - Solo
|
||||
if (RuleB(QueryServ, PlayerLogNPCKills)) {
|
||||
auto pack = new ServerPacket(
|
||||
ServerOP_QSPlayerLogNPCKills,
|
||||
sizeof(QSPlayerLogNPCKill_Struct) +
|
||||
(sizeof(QSPlayerLogNPCKillsPlayers_Struct) * 1)
|
||||
);
|
||||
|
||||
auto QS = (QSPlayerLogNPCKill_Struct*)pack->pBuffer;
|
||||
|
||||
QS->s1.NPCID = GetNPCTypeID();
|
||||
QS->s1.ZoneID = GetZoneID();
|
||||
QS->s1.Type = 0; // Solo Fight
|
||||
QS->Chars[0].char_id = give_exp_client->CharacterID();
|
||||
|
||||
player_count++;
|
||||
|
||||
worldserver.SendPacket(pack); // Send Packet to World
|
||||
safe_delete(pack);
|
||||
}
|
||||
// End QueryServ Logging
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user