mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-31 17:26:30 +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:
+52
-27
@@ -1,37 +1,62 @@
|
||||
#ifndef QUERYSERV_ZONE_H
|
||||
#define QUERYSERV_ZONE_H
|
||||
|
||||
#include "../common/net/servertalk_server.h"
|
||||
#include "../common/net/servertalk_client_connection.h"
|
||||
#include "../common/event/timer.h"
|
||||
#include "../common/rulesys.h"
|
||||
#include "../common/eqemu_logsys.h"
|
||||
|
||||
/*
|
||||
enum PlayerGenericLogEventTypes
|
||||
These Enums are for the generic logging table that are not complex and require more advanced logic
|
||||
*/
|
||||
class QueryServ {
|
||||
public:
|
||||
QueryServ();
|
||||
~QueryServ();
|
||||
void SendQuery(std::string Query);
|
||||
void Connect();
|
||||
inline void Disconnect() {
|
||||
if (m_connection) {
|
||||
m_connection->Handle()->Disconnect();
|
||||
m_connection.reset();
|
||||
}
|
||||
}
|
||||
bool SendPacket(ServerPacket *pack);
|
||||
void HandleMessage(uint16 opcode, const EQ::Net::Packet &p);
|
||||
|
||||
enum PlayerGenericLogEventTypes {
|
||||
Player_Log_Quest = 1,
|
||||
Player_Log_Zoning,
|
||||
Player_Log_Deaths,
|
||||
Player_Log_Connect_State,
|
||||
Player_Log_Levels,
|
||||
Player_Log_Keyring_Addition,
|
||||
Player_Log_QGlobal_Update,
|
||||
Player_Log_Task_Updates,
|
||||
Player_Log_AA_Purchases,
|
||||
Player_Log_Trade_Skill_Events,
|
||||
Player_Log_Issued_Commands,
|
||||
Player_Log_Money_Transactions,
|
||||
Player_Log_Alternate_Currency_Transactions,
|
||||
Player_Log_Guild_Tribute_Item_Donation,
|
||||
Player_Log_Guild_Tribute_Plat_Donation
|
||||
bool HasConnection() const
|
||||
{
|
||||
return m_connection && m_connection->Handle() && m_connection->Handle()->IsConnected();
|
||||
}
|
||||
|
||||
inline void CheckForConnectState() {
|
||||
if (RuleB(Logging, PlayerEventsQSProcess)) {
|
||||
if (!m_connection) {
|
||||
Connect();
|
||||
LogInfo("Starting QueryServ connection");
|
||||
}
|
||||
} else {
|
||||
if (HasConnection()) {
|
||||
Disconnect();
|
||||
LogInfo("Stopping QueryServ connection");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
std::unique_ptr<EQ::Net::ServertalkClient> m_connection;
|
||||
bool m_is_qs_connected = false;
|
||||
};
|
||||
|
||||
|
||||
class QueryServ{
|
||||
public:
|
||||
QueryServ();
|
||||
~QueryServ();
|
||||
void SendQuery(std::string Query);
|
||||
void PlayerLogEvent(int Event_Type, int Character_ID, std::string Event_Desc);
|
||||
class QueryServConnection {
|
||||
public:
|
||||
QueryServConnection();
|
||||
void AddConnection(std::shared_ptr<EQ::Net::ServertalkServerConnection> connection);
|
||||
void RemoveConnection(std::shared_ptr<EQ::Net::ServertalkServerConnection> connection);
|
||||
void HandleGenericMessage(uint16_t opcode, EQ::Net::Packet &p);
|
||||
void HandleLFGuildUpdateMessage(uint16_t opcode, EQ::Net::Packet &p);
|
||||
bool SendPacket(ServerPacket *pack);
|
||||
private:
|
||||
std::map<std::string, std::shared_ptr<EQ::Net::ServertalkServerConnection>> m_streams;
|
||||
std::unique_ptr<EQ::Timer> m_keepalive;
|
||||
};
|
||||
|
||||
#endif /* QUERYSERV_ZONE_H */
|
||||
|
||||
Reference in New Issue
Block a user