[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:
Mitch Freeman
2025-02-05 04:02:16 -04:00
committed by GitHub
parent 21d27a1122
commit 8f4f8368df
99 changed files with 8156 additions and 2451 deletions
+8 -11
View File
@@ -1,14 +1,11 @@
#include <stdlib.h>
#include "lfguild.h"
#include "database.h"
#include "worldserver.h"
#include "../common/eqemu_logsys.h"
#include "../common/strings.h"
#include "../common/packet_dump.h"
#include "../common/rulesys.h"
extern WorldServer *worldserver;
extern QSDatabase database;
extern QSDatabase qs_database;
PlayerLookingForGuild::PlayerLookingForGuild(char *name, char *comments, uint32 level, uint32 classes, uint32 aa_count, uint32 time_zone, uint32 time_posted)
{
@@ -38,7 +35,7 @@ bool LFGuildManager::LoadDatabase()
std::string query = "SELECT `type`,`name`,`comment`, "
"`fromlevel`, `tolevel`, `classes`, "
"`aacount`, `timezone`, `timeposted` FROM `lfguild`";
auto results = database.QueryDatabase(query);
auto results = qs_database.QueryDatabase(query);
if (!results.Success()) {
return false;
}
@@ -239,7 +236,7 @@ void LFGuildManager::TogglePlayer(uint32 FromZoneID, uint32 FromInstanceID, char
}
std::string query = StringFormat("DELETE FROM `lfguild` WHERE `type` = 0 AND `name` = '%s'", From);
auto results = database.QueryDatabase(query);
auto results = qs_database.QueryDatabase(query);
uint32 Now = time(nullptr);
@@ -252,7 +249,7 @@ void LFGuildManager::TogglePlayer(uint32 FromZoneID, uint32 FromInstanceID, char
"`classes`, `aacount`, `timezone`, `timeposted`) "
"VALUES (0, '%s', '%s', %u, 0, %u, %u, %u, %u)",
From, Comments, Level, Class, AAPoints, TimeZone, Now);
auto results = database.QueryDatabase(query);
auto results = qs_database.QueryDatabase(query);
}
auto pack = new ServerPacket(ServerOP_QueryServGeneric, strlen(From) + strlen(Comments) + 30);
@@ -281,7 +278,7 @@ void LFGuildManager::ToggleGuild(uint32 FromZoneID, uint32 FromInstanceID, char
}
std::string query = StringFormat("DELETE FROM `lfguild` WHERE `type` = 1 AND `name` = '%s'", GuildName);
auto results = database.QueryDatabase(query);
auto results = qs_database.QueryDatabase(query);
uint32 Now = time(nullptr);
@@ -296,7 +293,7 @@ void LFGuildManager::ToggleGuild(uint32 FromZoneID, uint32 FromInstanceID, char
"VALUES (1, '%s', '%s', %u, %u, %u, %u, %u, %u)",
GuildName, Comments, FromLevel, ToLevel,
Classes, AACount, TimeZone, Now);
auto results = database.QueryDatabase(query);
auto results = qs_database.QueryDatabase(query);
}
@@ -324,7 +321,7 @@ void LFGuildManager::ExpireEntries()
continue;
std::string query = StringFormat("DELETE from `lfguild` WHERE `type` = 0 AND `name` = '%s'", (*it).Name.c_str());
auto results = database.QueryDatabase(query);
auto results = qs_database.QueryDatabase(query);
if(!results.Success())
it = Players.erase(it);
@@ -336,7 +333,7 @@ void LFGuildManager::ExpireEntries()
continue;
std::string query = StringFormat("DELETE from `lfguild` WHERE `type` = 1 AND `name` = '%s'", (*it2).Name.c_str());
auto results = database.QueryDatabase(query);
auto results = qs_database.QueryDatabase(query);
if(!results.Success())
it2 = Guilds.erase(it2);