summaryrefslogtreecommitdiff
path: root/src/map/log.h
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-09-28 14:23:58 -0300
committershennetsind <ind@henn.et>2013-09-28 14:23:58 -0300
commit2e86f1db03587ced5655f92c3ab58c512679f688 (patch)
tree187fee49d558b52a6885f890326fadb0c8274e7a /src/map/log.h
parent5fb0a480b35b58636f6314a193961541d06177b7 (diff)
downloadhercules-2e86f1db03587ced5655f92c3ab58c512679f688.tar.gz
hercules-2e86f1db03587ced5655f92c3ab58c512679f688.tar.bz2
hercules-2e86f1db03587ced5655f92c3ab58c512679f688.tar.xz
hercules-2e86f1db03587ced5655f92c3ab58c512679f688.zip
HPM: log.h Completed
Moved missing vars and declarations of interest into the interface. Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/log.h')
-rw-r--r--src/map/log.h42
1 files changed, 41 insertions, 1 deletions
diff --git a/src/map/log.h b/src/map/log.h
index 1da1696ab..caf9ce0c5 100644
--- a/src/map/log.h
+++ b/src/map/log.h
@@ -5,13 +5,32 @@
#ifndef _LOG_H_
#define _LOG_H_
+#include "../common/cbasetypes.h"
+#include "../common/sql.h"
+
+/**
+ * Declarations
+ **/
struct block_list;
struct map_session_data;
struct mob_data;
struct item;
struct item_data;
+/**
+ * Defines
+ **/
+#ifdef SQL_INNODB
+// database is using an InnoDB engine so do not use DELAYED
+ #define LOG_QUERY "INSERT"
+#else
+// database is using a MyISAM engine so use DELAYED
+ #define LOG_QUERY "INSERT DELAYED"
+#endif
+/**
+ * Enumerations
+ **/
typedef enum e_log_chat_type {
LOG_CHAT_GLOBAL = 0x01,
LOG_CHAT_WHISPER = 0x02,
@@ -22,7 +41,6 @@ typedef enum e_log_chat_type {
LOG_CHAT_ALL = 0xFF,
} e_log_chat_type;
-
typedef enum e_log_pick_type {
LOG_TYPE_NONE = 0,
LOG_TYPE_TRADE = 0x00001,
@@ -48,6 +66,24 @@ typedef enum e_log_pick_type {
LOG_TYPE_ALL = 0xFFFFF,
} e_log_pick_type;
+/// filters for item logging
+typedef enum e_log_filter {
+ LOG_FILTER_NONE = 0x000,
+ LOG_FILTER_ALL = 0x001,
+ // bits
+ LOG_FILTER_HEALING = 0x002, // Healing items (0)
+ LOG_FILTER_ETC_AMMO = 0x004, // Etc Items(3) + Arrows (10)
+ LOG_FILTER_USABLE = 0x008, // Usable Items(2) + Scrolls, Lures(11) + Usable Cash Items(18)
+ LOG_FILTER_WEAPON = 0x010, // Weapons(4)
+ LOG_FILTER_ARMOR = 0x020, // Shields, Armors, Headgears, Accessories, Garments and Shoes(5)
+ LOG_FILTER_CARD = 0x040, // Cards(6)
+ LOG_FILTER_PETITEM = 0x080, // Pet Accessories(8) + Eggs(7) (well, monsters don't drop 'em but we'll use the same system for ALL logs)
+ LOG_FILTER_PRICE = 0x100, // Log expensive items ( >= price_log )
+ LOG_FILTER_AMOUNT = 0x200, // Log large amount of items ( >= amount_log )
+ LOG_FILTER_REFINE = 0x400, // Log refined items ( refine >= refine_log ) [not implemented]
+ LOG_FILTER_CHANCE = 0x800, // Log rare items and Emperium ( drop chance <= rare_log )
+} e_log_filter;
+
struct log_interface {
struct {
e_log_pick_type enable_logs;
@@ -78,6 +114,10 @@ struct log_interface {
int (*config_read) (const char* cfgName);
void (*config_done) (void);
+
+ char (*picktype2char) (e_log_pick_type type);
+ char (*chattype2char) (e_log_chat_type type);
+ bool (*should_log_item) (int nameid, int amount, int refine, struct item_data *id);
};
struct log_interface *logs;