Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Initial pass at removing qs logging in view of the PlayerEventLogging System #4542

Draft
wants to merge 26 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
ece6eee
First pass of player_event_loot_items
neckkola Oct 15, 2024
36b499c
Second pass of player_event_loot_items
neckkola Oct 16, 2024
f710ada
Third pass of player_event_loot_items
neckkola Oct 16, 2024
04298e3
Example without RecordDetailEvent template
neckkola Oct 16, 2024
d74a4bd
Cleanup the removal of the template
neckkola Oct 17, 2024
130bf2f
Fourth Pass
neckkola Oct 18, 2024
2b05a12
Reposition to reduce db tasks
neckkola Oct 18, 2024
e3c99a1
Refactor etl processing for easier additions
neckkola Oct 20, 2024
436f280
Add merchant purchase event
neckkola Oct 20, 2024
11a2c56
Fix PlayerEventMerchantPurchase in client_packet.cpp
neckkola Oct 20, 2024
7efcaa2
WIP - Handin
neckkola Oct 20, 2024
dd5093f
Handin Event added
neckkola Oct 20, 2024
534a9a0
Cleanup
neckkola Oct 20, 2024
3f4755e
All a rentention period of 0 days which deletes all current records.
neckkola Oct 20, 2024
57825ed
Updates
neckkola Oct 21, 2024
134e408
Cleanup and Formatting
neckkola Oct 22, 2024
d6c1022
Add etl for
neckkola Oct 24, 2024
75f89fe
Add etl for
neckkola Oct 24, 2024
ab82afa
Add etl for Playerevent::AA_purchase
neckkola Nov 5, 2024
cfc777b
Set etl for speech to off by default
neckkola Nov 15, 2024
6605809
Cleanup before PR
neckkola Nov 15, 2024
7ca379d
Review comment updates.
neckkola Nov 16, 2024
8f69f73
Add world cli etl:settings to output a json on all player event details.
neckkola Nov 17, 2024
8e4aaee
Add reserve for all etl_queues
neckkola Nov 17, 2024
ab7f8d5
Potential solution for a dedicated database connection for player eve…
neckkola Nov 17, 2024
78a538e
Simple thread for player_events. Likely there is a better way to do …
neckkola Nov 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,20 @@ SET(repositories
repositories/base/base_pets_equipmentset_repository.h
repositories/base/base_pets_equipmentset_entries_repository.h
repositories/base/base_player_titlesets_repository.h
repositories/base/base_player_event_aa_purchase_repository.h
repositories/base/base_player_event_killed_npc_repository.h
repositories/base/base_player_event_killed_named_npc_repository.h
repositories/base/base_player_event_killed_raid_npc_repository.h
repositories/base/base_player_event_log_settings_repository.h
repositories/base/base_player_event_logs_repository.h
repositories/base/base_player_event_loot_items_repository.h
repositories/base/base_player_event_merchant_purchase_repository.h
repositories/base/base_player_event_merchant_sell_repository.h
repositories/base/base_player_event_npc_handin_repository.h
repositories/base/base_player_event_npc_handin_entries_repository.h
repositories/base/base_player_event_speech_repository.h
repositories/base/base_player_event_trade_repository.h
repositories/base/base_player_event_trade_entries_repository.h
repositories/base/base_quest_globals_repository.h
repositories/base/base_raid_details_repository.h
repositories/base/base_raid_members_repository.h
Expand Down Expand Up @@ -460,8 +472,20 @@ SET(repositories
repositories/pets_equipmentset_repository.h
repositories/pets_equipmentset_entries_repository.h
repositories/player_titlesets_repository.h
repositories/player_event_aa_purchase_repository.h
repositories/player_event_killed_npc_repository.h
repositories/player_event_killed_named_npc_repository.h
repositories/player_event_killed_raid_npc_repository.h
repositories/player_event_log_settings_repository.h
repositories/player_event_logs_repository.h
repositories/player_event_loot_items_repository.h
repositories/player_event_merchant_purchase_repository.h
repositories/player_event_merchant_sell_repository.h
repositories/player_event_npc_handin_repository.h
repositories/player_event_npc_handin_entries_repository.h
repositories/player_event_speech_repository.h
repositories/player_event_trade_repository.h
repositories/player_event_trade_entries_repository.h
repositories/quest_globals_repository.h
repositories/raid_details_repository.h
repositories/raid_members_repository.h
Expand Down
250 changes: 250 additions & 0 deletions common/database/database_update_manifest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5770,6 +5770,256 @@ MODIFY COLUMN `exp_modifier` float NOT NULL DEFAULT 1.0 AFTER `aa_modifier`;
CREATE INDEX idx_character_expires ON data_buckets (character_id, expires);
CREATE INDEX idx_npc_expires ON data_buckets (npc_id, expires);
CREATE INDEX idx_bot_expires ON data_buckets (bot_id, expires);
)"
},
ManifestEntry{
.version = 9286,
.description = "2024_10_08_add_detail_player_event_logging.sql",
.check = "SHOW COLUMNS FROM `player_event_log_settings` LIKE 'etl_enabled'",
.condition = "empty",
.match = "",
.sql = R"(
ALTER TABLE `player_event_log_settings`
ADD COLUMN `etl_enabled` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0' AFTER `discord_webhook_id`;

ALTER TABLE `player_event_logs`
ADD COLUMN `etl_table_id` BIGINT(20) NOT NULL DEFAULT '0' AFTER `event_data`;

UPDATE `player_event_log_settings` SET `etl_enabled` = 1 WHERE `id` = 14;
CREATE TABLE `player_event_loot_items` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`item_id` INT(10) UNSIGNED NULL DEFAULT NULL,
`item_name` VARCHAR(64) NULL DEFAULT NULL COLLATE 'latin1_swedish_ci',
`charges` INT(11) NULL DEFAULT NULL,
`npc_id` INT(10) UNSIGNED NULL DEFAULT NULL,
`corpse_name` VARCHAR(64) NULL DEFAULT NULL COLLATE 'latin1_swedish_ci',
`created_at` DATETIME NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
INDEX `item_id_npc_id` (`item_id`, `npc_id`) USING BTREE,
INDEX `created_at` (`created_at`) USING BTREE
)
COLLATE='latin1_swedish_ci'
ENGINE=InnoDB
AUTO_INCREMENT=1;


UPDATE `player_event_log_settings` SET `etl_enabled` = 1 WHERE `id` = 16;
CREATE TABLE `player_event_merchant_sell` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`npc_id` INT(10) UNSIGNED NULL DEFAULT '0',
`merchant_name` VARCHAR(64) NULL DEFAULT NULL COLLATE 'latin1_swedish_ci',
`merchant_type` INT(10) UNSIGNED NULL DEFAULT '0',
`item_id` INT(10) UNSIGNED NULL DEFAULT '0',
`item_name` VARCHAR(64) NULL DEFAULT NULL COLLATE 'latin1_swedish_ci',
`charges` INT(11) NULL DEFAULT '0',
`cost` INT(10) UNSIGNED NULL DEFAULT '0',
`alternate_currency_id` INT(10) UNSIGNED NULL DEFAULT '0',
`player_money_balance` BIGINT(20) UNSIGNED NULL DEFAULT '0',
`player_currency_balance` BIGINT(20) UNSIGNED NULL DEFAULT '0',
`created_at` DATETIME NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
INDEX `item_id_npc_id` (`item_id`, `npc_id`) USING BTREE,
INDEX `created_at` (`created_at`) USING BTREE
)
COLLATE='latin1_swedish_ci'
ENGINE=InnoDB
AUTO_INCREMENT=1;

UPDATE `player_event_log_settings` SET `etl_enabled` = 1 WHERE `id` = 15;
CREATE TABLE `player_event_merchant_purchase` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`npc_id` INT(10) UNSIGNED NULL DEFAULT '0',
`merchant_name` VARCHAR(64) NULL DEFAULT NULL COLLATE 'latin1_swedish_ci',
`merchant_type` INT(10) UNSIGNED NULL DEFAULT '0',
`item_id` INT(10) UNSIGNED NULL DEFAULT '0',
`item_name` VARCHAR(64) NULL DEFAULT NULL COLLATE 'latin1_swedish_ci',
`charges` INT(11) NULL DEFAULT '0',
`cost` INT(10) UNSIGNED NULL DEFAULT '0',
`alternate_currency_id` INT(10) UNSIGNED NULL DEFAULT '0',
`player_money_balance` BIGINT(20) UNSIGNED NULL DEFAULT '0',
`player_currency_balance` BIGINT(20) UNSIGNED NULL DEFAULT '0',
`created_at` DATETIME NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
INDEX `item_id_npc_id` (`item_id`, `npc_id`) USING BTREE,
INDEX `created_at` (`created_at`) USING BTREE
)
COLLATE='latin1_swedish_ci'
ENGINE=InnoDB
AUTO_INCREMENT=1;

UPDATE `player_event_log_settings` SET `etl_enabled` = 1 WHERE `id` = 22;
CREATE TABLE `player_event_npc_handin` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`npc_id` INT(10) UNSIGNED NULL DEFAULT '0',
`npc_name` VARCHAR(64) NULL DEFAULT NULL COLLATE 'latin1_swedish_ci',
`handin_copper` BIGINT(20) UNSIGNED NULL DEFAULT '0',
`handin_silver` BIGINT(20) UNSIGNED NULL DEFAULT '0',
`handin_gold` BIGINT(20) UNSIGNED NULL DEFAULT '0',
`handin_platinum` BIGINT(20) UNSIGNED NULL DEFAULT '0',
`return_copper` BIGINT(20) UNSIGNED NULL DEFAULT '0',
`return_silver` BIGINT(20) UNSIGNED NULL DEFAULT '0',
`return_gold` BIGINT(20) UNSIGNED NULL DEFAULT '0',
`return_platinum` BIGINT(20) UNSIGNED NULL DEFAULT '0',
`is_quest_handin` TINYINT(3) UNSIGNED NULL DEFAULT '0',
`created_at` DATETIME NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
INDEX `npc_id_is_quest_handin` (`npc_id`, `is_quest_handin`) USING BTREE,
INDEX `created_at` (`created_at`) USING BTREE
)
COLLATE='latin1_swedish_ci'
ENGINE=InnoDB
AUTO_INCREMENT=1;

CREATE TABLE `player_event_npc_handin_entries` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`player_event_npc_handin_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
`type` INT(10) UNSIGNED NULL DEFAULT NULL,
`item_id` INT(10) UNSIGNED NOT NULL DEFAULT '0',
`charges` INT(11) NOT NULL DEFAULT '0',
`evolve_level` INT(10) UNSIGNED NOT NULL DEFAULT '0',
`evolve_amount` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
`augment_1_id` INT(10) UNSIGNED NOT NULL DEFAULT '0',
`augment_2_id` INT(10) UNSIGNED NOT NULL DEFAULT '0',
`augment_3_id` INT(10) UNSIGNED NOT NULL DEFAULT '0',
`augment_4_id` INT(10) UNSIGNED NOT NULL DEFAULT '0',
`augment_5_id` INT(10) UNSIGNED NOT NULL DEFAULT '0',
`augment_6_id` INT(10) UNSIGNED NOT NULL DEFAULT '0',
`created_at` DATETIME NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
INDEX `type_item_id` (`type`, `item_id`) USING BTREE,
INDEX `player_event_npc_handin_id` (`player_event_npc_handin_id`) USING BTREE,
INDEX `created_at` (`created_at`) USING BTREE
)
COLLATE='latin1_swedish_ci'
ENGINE=InnoDB
AUTO_INCREMENT=1;

UPDATE `player_event_log_settings` SET `etl_enabled` = 1 WHERE `id` = 27;
CREATE TABLE `player_event_trade` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`char1_id` INT(10) UNSIGNED NULL DEFAULT '0',
`char2_id` INT(10) UNSIGNED NULL DEFAULT '0',
`char1_copper` BIGINT(20) UNSIGNED NULL DEFAULT '0',
`char1_silver` BIGINT(20) UNSIGNED NULL DEFAULT '0',
`char1_gold` BIGINT(20) UNSIGNED NULL DEFAULT '0',
`char1_platinum` BIGINT(20) UNSIGNED NULL DEFAULT '0',
`char2_copper` BIGINT(20) UNSIGNED NULL DEFAULT '0',
`char2_silver` BIGINT(20) UNSIGNED NULL DEFAULT '0',
`char2_gold` BIGINT(20) UNSIGNED NULL DEFAULT '0',
`char2_platinum` BIGINT(20) UNSIGNED NULL DEFAULT '0',
`created_at` DATETIME NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
INDEX `char1_id_char2_id` (`char1_id`, `char2_id`) USING BTREE,
INDEX `created_at` (`created_at`) USING BTREE
)
COLLATE='latin1_swedish_ci'
ENGINE=InnoDB
AUTO_INCREMENT=1;

CREATE TABLE `player_event_trade_entries` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`player_event_trade_id` BIGINT(20) UNSIGNED NULL DEFAULT '0',
`char_id` INT(10) UNSIGNED NULL DEFAULT '0',
`slot` SMALLINT(6) NULL DEFAULT '0',
`item_id` INT(10) UNSIGNED NULL DEFAULT '0',
`charges` SMALLINT(6) NULL DEFAULT '0',
`augment_1_id` INT(10) UNSIGNED NULL DEFAULT '0',
`augment_2_id` INT(10) UNSIGNED NULL DEFAULT '0',
`augment_3_id` INT(10) UNSIGNED NULL DEFAULT '0',
`augment_4_id` INT(10) UNSIGNED NULL DEFAULT '0',
`augment_5_id` INT(10) UNSIGNED NULL DEFAULT '0',
`augment_6_id` INT(10) UNSIGNED NULL DEFAULT '0',
`in_bag` TINYINT(4) NULL DEFAULT '0',
`created_at` DATETIME NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
INDEX `player_event_trade_id` (`player_event_trade_id`) USING BTREE,
INDEX `created_at` (`created_at`) USING BTREE
)
COLLATE='latin1_swedish_ci'
ENGINE=InnoDB
AUTO_INCREMENT=1;

UPDATE `player_event_log_settings` SET `etl_enabled` = 0 WHERE `id` = 54;
CREATE TABLE `player_event_speech` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`to_char_id` VARCHAR(64) NULL DEFAULT NULL COLLATE 'latin1_swedish_ci',
`from_char_id` VARCHAR(64) NULL DEFAULT NULL COLLATE 'latin1_swedish_ci',
`guild_id` INT(10) UNSIGNED NULL DEFAULT '0',
`type` INT(10) UNSIGNED NULL DEFAULT '0',
`min_status` INT(10) UNSIGNED NULL DEFAULT '0',
`message` LONGTEXT NULL DEFAULT NULL COLLATE 'latin1_swedish_ci',
`created_at` DATETIME NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
INDEX `to_char_id_from_char_id` (`to_char_id`, `from_char_id`) USING BTREE,
INDEX `created_at` (`created_at`) USING BTREE
)
COLLATE='latin1_swedish_ci'
ENGINE=InnoDB
AUTO_INCREMENT=1;

UPDATE `player_event_log_settings` SET `etl_enabled` = 1 WHERE `id` = 44;
CREATE TABLE `player_event_killed_npc` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`npc_id` INT(10) UNSIGNED NULL DEFAULT '0',
`npc_name` VARCHAR(64) NULL DEFAULT NULL COLLATE 'latin1_swedish_ci',
`combat_time_seconds` INT(10) UNSIGNED NULL DEFAULT '0',
`total_damage_per_second_taken` BIGINT(20) UNSIGNED NULL DEFAULT '0',
`total_heal_per_second_taken` BIGINT(20) UNSIGNED NULL DEFAULT '0',
`created_at` DATETIME NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
INDEX `npc_id` (`npc_id`) USING BTREE,
INDEX `created_at` (`created_at`) USING BTREE
)
COLLATE='latin1_swedish_ci'
ENGINE=InnoDB;

UPDATE `player_event_log_settings` SET `etl_enabled` = 1 WHERE `id` = 45;
CREATE TABLE `player_event_killed_named_npc` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`npc_id` INT(10) UNSIGNED NULL DEFAULT '0',
`npc_name` VARCHAR(64) NULL DEFAULT NULL COLLATE 'latin1_swedish_ci',
`combat_time_seconds` INT(10) UNSIGNED NULL DEFAULT '0',
`total_damage_per_second_taken` BIGINT(20) UNSIGNED NULL DEFAULT '0',
`total_heal_per_second_taken` BIGINT(20) UNSIGNED NULL DEFAULT '0',
`created_at` DATETIME NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
INDEX `npc_id` (`npc_id`) USING BTREE,
INDEX `created_at` (`created_at`) USING BTREE
)
COLLATE='latin1_swedish_ci'
ENGINE=InnoDB;

UPDATE `player_event_log_settings` SET `etl_enabled` = 1 WHERE `id` = 46;
CREATE TABLE `player_event_killed_raid_npc` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`npc_id` INT(10) UNSIGNED NULL DEFAULT '0',
`npc_name` VARCHAR(64) NULL DEFAULT NULL COLLATE 'latin1_swedish_ci',
`combat_time_seconds` INT(10) UNSIGNED NULL DEFAULT '0',
`total_damage_per_second_taken` BIGINT(20) UNSIGNED NULL DEFAULT '0',
`total_heal_per_second_taken` BIGINT(20) UNSIGNED NULL DEFAULT '0',
`created_at` DATETIME NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
INDEX `npc_id` (`npc_id`) USING BTREE,
INDEX `created_at` (`created_at`) USING BTREE
)
COLLATE='latin1_swedish_ci'
ENGINE=InnoDB;

UPDATE `player_event_log_settings` SET `etl_enabled` = 1 WHERE `id` = 4;
CREATE TABLE `player_event_aa_purchase` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`aa_ability_id` INT(11) NULL DEFAULT '0',
`cost` INT(11) NULL DEFAULT '0',
`previous_id` INT(11) NULL DEFAULT '0',
`next_id` INT(11) NULL DEFAULT '0',
`created_at` DATETIME NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
INDEX `created_at` (`created_at`) USING BTREE
)
COLLATE='latin1_swedish_ci'
ENGINE=InnoDB
;

)"
}
// -- template; copy/paste this when you need to create a new entry
Expand Down
12 changes: 12 additions & 0 deletions common/database_schema.h
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,20 @@ namespace DatabaseSchema {
"saylink",
"server_scheduled_events",
"spawn2_disabled",
"player_event_aa_purchase",
"player_event_killed_npc",
"player_event_killed_named_npc",
"player_event_killed_raid_npc",
"player_event_log_settings",
"player_event_logs",
"player_event_loot_items",
"player_event_merchant_purchase",
"player_event_merchant_sell",
"player_event_npc_handin",
"player_event_npc_handin_entries",
"player_event_speech",
"player_event_trade",
"player_event_trade_entries",
"shared_task_activity_state",
"shared_task_dynamic_zones",
"shared_task_members",
Expand Down
Loading