mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 11:28:25 +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:
+29
-12
@@ -2155,18 +2155,18 @@ void Database::PurgeCharacterParcels()
|
||||
pel.event_type_name = PlayerEvent::EventName[pel.event_type_id];
|
||||
std::stringstream ss;
|
||||
for (auto const &r: results) {
|
||||
pd.from_name = r.from_name;
|
||||
pd.item_id = r.item_id;
|
||||
pd.aug_slot_1 = r.aug_slot_1;
|
||||
pd.aug_slot_2 = r.aug_slot_2;
|
||||
pd.aug_slot_3 = r.aug_slot_3;
|
||||
pd.aug_slot_4 = r.aug_slot_4;
|
||||
pd.aug_slot_5 = r.aug_slot_5;
|
||||
pd.aug_slot_6 = r.aug_slot_6;
|
||||
pd.note = r.note;
|
||||
pd.quantity = r.quantity;
|
||||
pd.sent_date = r.sent_date;
|
||||
pd.char_id = r.char_id;
|
||||
pd.from_name = r.from_name;
|
||||
pd.item_id = r.item_id;
|
||||
pd.augment_1_id = r.aug_slot_1;
|
||||
pd.augment_2_id = r.aug_slot_2;
|
||||
pd.augment_3_id = r.aug_slot_3;
|
||||
pd.augment_4_id = r.aug_slot_4;
|
||||
pd.augment_5_id = r.aug_slot_5;
|
||||
pd.augment_6_id = r.aug_slot_6;
|
||||
pd.note = r.note;
|
||||
pd.quantity = r.quantity;
|
||||
pd.sent_date = r.sent_date;
|
||||
pd.char_id = r.char_id;
|
||||
{
|
||||
cereal::JSONOutputArchiveSingleLine ar(ss);
|
||||
pd.serialize(ar);
|
||||
@@ -2202,3 +2202,20 @@ void Database::ClearBuyerDetails()
|
||||
{
|
||||
BuyerRepository::DeleteBuyer(*this, 0);
|
||||
}
|
||||
|
||||
uint64_t Database::GetNextTableId(const std::string &table_name)
|
||||
{
|
||||
auto results = QueryDatabase(fmt::format("SHOW TABLE STATUS LIKE '{}'", table_name));
|
||||
|
||||
for (auto row: results) {
|
||||
for (int row_index = 0; row_index < results.ColumnCount(); row_index++) {
|
||||
std::string field_name = Strings::ToLower(results.FieldName(row_index));
|
||||
if (field_name == "auto_increment") {
|
||||
std::string value = row[row_index] ? row[row_index] : "null";
|
||||
return Strings::ToUnsignedBigInt(value, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user