summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2019-11-17 16:54:11 +0100
committerGitHub <noreply@github.com>2019-11-17 16:54:11 +0100
commit1f000882ca8ce9d4bb48757b81848b8b6a98ad0e (patch)
tree34855b2936e1197385417dca7905b7a8fd9c97d5
parent76c5cbecee3441a8dbd1f729e09db78af94be056 (diff)
parent8b361e2b31d9926a83befb012a27edc4c6ee59d1 (diff)
downloadhercules-1f000882ca8ce9d4bb48757b81848b8b6a98ad0e.tar.gz
hercules-1f000882ca8ce9d4bb48757b81848b8b6a98ad0e.tar.bz2
hercules-1f000882ca8ce9d4bb48757b81848b8b6a98ad0e.tar.xz
hercules-1f000882ca8ce9d4bb48757b81848b8b6a98ad0e.zip
Merge pull request #2560 from dastgirp/logs/item
Fixes some confusion in logs and added new log type
-rw-r--r--conf/map/logs.conf62
-rw-r--r--sql-files/logs.sql2
-rw-r--r--sql-files/main.sql1
-rw-r--r--sql-files/upgrades/2019-10-12--14-21.sql23
-rw-r--r--sql-files/upgrades/index.txt1
-rw-r--r--src/map/achievement.c4
-rw-r--r--src/map/log.c3
-rw-r--r--src/map/log.h4
8 files changed, 64 insertions, 36 deletions
diff --git a/conf/map/logs.conf b/conf/map/logs.conf
index db584049a..18450b2fe 100644
--- a/conf/map/logs.conf
+++ b/conf/map/logs.conf
@@ -34,38 +34,40 @@
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
+ // 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: 0xFFFFFFF
+ enable: 0xFFFFFFFF
// Logging files/tables
// Following settings specify where to log to. If 'use_sql' is
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 <http://www.gnu.org/licenses/>.
+
+
+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
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 aa2f5f8f3..45335b16a 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
@@ -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 116d99bfd..5035e9526 100644
--- a/src/map/log.h
+++ b/src/map/log.h
@@ -87,9 +87,9 @@ typedef enum e_log_pick_type {
LOG_TYPE_QUEST = 0x02000000,
LOG_TYPE_SKILL = 0x04000000,
LOG_TYPE_REFINE = 0x08000000,
+ LOG_TYPE_LOOT = 0x10000000,
+ LOG_TYPE_ACHIEVEMENT = 0x20000000,
- // combinations
- LOG_TYPE_LOOT = LOG_TYPE_PICKDROP_MONSTER|LOG_TYPE_CONSUME,
// all
LOG_TYPE_ALL = 0xFFFFFFFF,
} e_log_pick_type;