From ea9895e5261a1496bc8ac8e0c7be5fab3d6d4ef9 Mon Sep 17 00:00:00 2001 From: Dastgir Date: Sat, 12 Oct 2019 14:09:10 +0530 Subject: Seperated LOG_TYPE_LOOT to new ID --- conf/map/logs.conf | 61 +++++++++++++++++++++++++++--------------------------- src/map/log.c | 2 +- src/map/log.h | 3 +-- 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/conf/map/logs.conf b/conf/map/logs.conf index db584049a..f9654da09 100644 --- a/conf/map/logs.conf +++ b/conf/map/logs.conf @@ -34,38 +34,39 @@ map_log: { // Enable Logs? (Note 3) - // 0x0000000 - Don't log at all - // 0x0000001 - (T) Log trades - // 0x0000002 - (V) Log vending transactions - // 0x0000004 - (P) Log items drop/picked by players - // 0x0000008 - (L) Log items drop/looted by monsters - // 0x0000010 - (S) Log NPC transactions (buy/sell) - // 0x0000020 - (N) Log Script transactions (items deleted/acquired through quests) - // 0x0000040 - (D) Log items stolen from mobs (Steal/Gank) - // 0x0000080 - (C) Log player-used items (consumables/pet&hom&merc food/items used for skills&attacks) - // 0x0000100 - (O) Log produced/ingredient items - // 0x0000200 - (U) Log MVP prize items - // 0x0000400 - (A) Log player created/deleted items (through @/# commands) - // 0x0000800 - (R) Log items placed/retrieved from storage. - // 0x0001000 - (G) Log items placed/retrieved from guild storage. - // 0x0002000 - (E) Log mail system transactions. - // 0x0004000 - (I) Log auction system transactions. - // 0x0008000 - (B) Log buying store transactions - // 0x0010000 - (X) Log other transactions - // 0x0020000 - (K) Log account bank transactions - // 0x0040000 - (Y) Divorce - // 0x0080000 - (Z) Roulette - // 0x0100000 - (W) Rental - // 0x0200000 - (Q) Card - // 0x0400000 - (J) Invalid in inventory - // 0x0800000 - (H) Invalid in cart - // 0x1000000 - (@) Egg - // 0x2000000 - (0) Quest - // 0x4000000 - (1) Skill - // 0x8000000 - (2) Refine + // 0x00000000 - Don't log at all + // 0x00000001 - (T) Log trades X + // 0x00000002 - (V) Log vending transactions X + // 0x00000004 - (P) Log items drop/picked by players X + // 0x00000008 - (M) Log items dropped by monsters + // 0x00000010 - (S) Log NPC transactions (buy/sell) + // 0x00000020 - (N) Log Script transactions (items deleted/acquired through quests) + // 0x00000040 - (D) Log items stolen from mobs (Steal/Gank) + // 0x00000080 - (C) Log player-used items (consumables/pet&hom&merc food/items used for skills&attacks) + // 0x00000100 - (O) Log produced/ingredient items + // 0x00000200 - (U) Log MVP prize items + // 0x00000400 - (A) Log player created/deleted items (through @/# commands) + // 0x00000800 - (R) Log items placed/retrieved from storage. + // 0x00001000 - (G) Log items placed/retrieved from guild storage. + // 0x00002000 - (E) Log mail system transactions. + // 0x00004000 - (I) Log auction system transactions. + // 0x00008000 - (B) Log buying store transactions + // 0x00010000 - (X) Log other transactions + // 0x00020000 - (K) Log account bank transactions + // 0x00040000 - (Y) Divorce + // 0x00080000 - (Z) Roulette + // 0x00100000 - (W) Rental + // 0x00200000 - (Q) Card + // 0x00400000 - (J) Invalid in inventory + // 0x00800000 - (H) Invalid in cart + // 0x01000000 - (@) Egg + // 0x02000000 - (0) Quest + // 0x04000000 - (1) Skill + // 0x08000000 - (2) Refine + // 0x10000000 - (L) Log items looted by monsters // Example: Log trades+vending+script items+created items: 1+2+32+1024 = 1059 // Please note that moving items from inventory to cart and back is not logged by design. - enable: 0xFFFFFFF + enable: 0xFFFFFFFF // Logging files/tables // Following settings specify where to log to. If 'use_sql' is diff --git a/src/map/log.c b/src/map/log.c index aa2f5f8f3..e4b5667e1 100644 --- a/src/map/log.c +++ b/src/map/log.c @@ -48,7 +48,7 @@ static char log_picktype2char(e_log_pick_type type) switch( type ) { case LOG_TYPE_TRADE: return 'T'; // (T)rade case LOG_TYPE_VENDING: return 'V'; // (V)ending - case LOG_TYPE_PICKDROP_PLAYER: return 'P'; // (P)player + case LOG_TYPE_PICKDROP_PLAYER: return 'P'; // (P)layer case LOG_TYPE_PICKDROP_MONSTER: return 'M'; // (M)onster case LOG_TYPE_NPC: return 'S'; // NPC (S)hop case LOG_TYPE_SCRIPT: return 'N'; // (N)PC Script diff --git a/src/map/log.h b/src/map/log.h index 116d99bfd..80835645f 100644 --- a/src/map/log.h +++ b/src/map/log.h @@ -87,9 +87,8 @@ typedef enum e_log_pick_type { LOG_TYPE_QUEST = 0x02000000, LOG_TYPE_SKILL = 0x04000000, LOG_TYPE_REFINE = 0x08000000, + LOG_TYPE_LOOT = 0x10000000, - // combinations - LOG_TYPE_LOOT = LOG_TYPE_PICKDROP_MONSTER|LOG_TYPE_CONSUME, // all LOG_TYPE_ALL = 0xFFFFFFFF, } e_log_pick_type; -- cgit v1.2.3-70-g09d2 From 227c4416b86549364a3cfaac55295dd29fafed46 Mon Sep 17 00:00:00 2001 From: Dastgir Date: Sat, 12 Oct 2019 14:19:15 +0530 Subject: Added Achievement Logs --- conf/map/logs.conf | 1 + src/map/achievement.c | 4 ++-- src/map/log.c | 1 + src/map/log.h | 1 + 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/conf/map/logs.conf b/conf/map/logs.conf index f9654da09..18450b2fe 100644 --- a/conf/map/logs.conf +++ b/conf/map/logs.conf @@ -64,6 +64,7 @@ map_log: { // 0x04000000 - (1) Skill // 0x08000000 - (2) Refine // 0x10000000 - (L) Log items looted by monsters + // 0x20000000 - (3) Achievements // Example: Log trades+vending+script items+created items: 1+2+32+1024 = 1059 // Please note that moving items from inventory to cart and back is not logged by design. enable: 0xFFFFFFFF diff --git a/src/map/achievement.c b/src/map/achievement.c index c2ebb5fdd..5215526a9 100644 --- a/src/map/achievement.c +++ b/src/map/achievement.c @@ -1051,10 +1051,10 @@ static void achievement_get_rewards_items(struct map_session_data *sd, const str if (!itemdb->isstackable(it.nameid)) { it.amount = 1; for (int j = 0; j < total; ++j) - pc->additem(sd, &it, 1, LOG_TYPE_SCRIPT); + pc->additem(sd, &it, 1, LOG_TYPE_ACHIEVEMENT); } else { it.amount = total; - pc->additem(sd, &it, total, LOG_TYPE_SCRIPT); + pc->additem(sd, &it, total, LOG_TYPE_ACHIEVEMENT); } } } diff --git a/src/map/log.c b/src/map/log.c index e4b5667e1..45335b16a 100644 --- a/src/map/log.c +++ b/src/map/log.c @@ -75,6 +75,7 @@ static char log_picktype2char(e_log_pick_type type) case LOG_TYPE_SKILL: return '1'; // Skill case LOG_TYPE_REFINE: return '2'; // Refine case LOG_TYPE_OTHER: return 'X'; // Other + case LOG_TYPE_ACHIEVEMENT: return '3'; // Achievement } // should not get here, fallback diff --git a/src/map/log.h b/src/map/log.h index 80835645f..5035e9526 100644 --- a/src/map/log.h +++ b/src/map/log.h @@ -88,6 +88,7 @@ typedef enum e_log_pick_type { LOG_TYPE_SKILL = 0x04000000, LOG_TYPE_REFINE = 0x08000000, LOG_TYPE_LOOT = 0x10000000, + LOG_TYPE_ACHIEVEMENT = 0x20000000, // all LOG_TYPE_ALL = 0xFFFFFFFF, -- cgit v1.2.3-70-g09d2 From 8b361e2b31d9926a83befb012a27edc4c6ee59d1 Mon Sep 17 00:00:00 2001 From: Dastgir Date: Sat, 12 Oct 2019 14:26:22 +0530 Subject: Added SQL Files --- sql-files/logs.sql | 2 +- sql-files/main.sql | 1 + sql-files/upgrades/2019-10-12--14-21.sql | 23 +++++++++++++++++++++++ sql-files/upgrades/index.txt | 1 + 4 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 sql-files/upgrades/2019-10-12--14-21.sql diff --git a/sql-files/logs.sql b/sql-files/logs.sql index 6edf385a2..339f6ca46 100644 --- a/sql-files/logs.sql +++ b/sql-files/logs.sql @@ -144,7 +144,7 @@ CREATE TABLE IF NOT EXISTS `picklog` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `time` DATETIME NULL, `char_id` INT(11) NOT NULL DEFAULT '0', - `type` ENUM('M','P','L','T','V','S','N','C','A','R','G','E','B','O','I','X','D','U','K','Y','Z','W','Q','J','H','@','0','1','2') NOT NULL DEFAULT 'P', + `type` ENUM('M','P','L','T','V','S','N','C','A','R','G','E','B','O','I','X','D','U','K','Y','Z','W','Q','J','H','@','0','1','2','3') NOT NULL DEFAULT 'P', `nameid` INT(11) NOT NULL DEFAULT '0', `amount` INT(11) NOT NULL DEFAULT '1', `refine` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0', diff --git a/sql-files/main.sql b/sql-files/main.sql index 4627799aa..c4e5afaf3 100644 --- a/sql-files/main.sql +++ b/sql-files/main.sql @@ -933,6 +933,7 @@ INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1556147483); -- 2019-04-2 INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1557414445); -- 2019-05-09--18-07.sql INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1565293394); -- 2019-08-08--19-43.sql INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1570309293); -- 2019-10-05--19-01.sql +INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1570870260); -- 2019-10-21--14-21.sql -- -- Table structure for table `storage` diff --git a/sql-files/upgrades/2019-10-12--14-21.sql b/sql-files/upgrades/2019-10-12--14-21.sql new file mode 100644 index 000000000..bd885a874 --- /dev/null +++ b/sql-files/upgrades/2019-10-12--14-21.sql @@ -0,0 +1,23 @@ +#1570870260 + +-- This file is part of Hercules. +-- http://herc.ws - http://github.com/HerculesWS/Hercules +-- +-- Copyright (C) 2019 Hercules Dev Team +-- +-- Hercules is free software: you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . + + +ALTER TABLE `picklog` MODIFY `type` enum('M','P','L','T','V','S','N','C','A','R','G','E','B','O','I','X','D','U','K','Y','Z','W','Q','J','H','@','0','1','2', '3') NOT NULL DEFAULT 'P', +INSERT INTO `sql_updates` (`timestamp`) VALUES (1570870260); diff --git a/sql-files/upgrades/index.txt b/sql-files/upgrades/index.txt index 10eb30762..2db750247 100644 --- a/sql-files/upgrades/index.txt +++ b/sql-files/upgrades/index.txt @@ -57,3 +57,4 @@ 2019-05-09--18-07.sql 2019-08-08--19-43.sql 2019-10-05--19-01.sql +2019-10-12--14-21.sql -- cgit v1.2.3-70-g09d2