diff options
-rw-r--r-- | conf/map/logs.conf | 8 | ||||
-rw-r--r-- | npc/functions/global_event_handler.txt | 9 | ||||
-rw-r--r-- | npc/functions/main.txt | 21 |
3 files changed, 34 insertions, 4 deletions
diff --git a/conf/map/logs.conf b/conf/map/logs.conf index 654209b7..85e110f2 100644 --- a/conf/map/logs.conf +++ b/conf/map/logs.conf @@ -67,7 +67,7 @@ map_log: { // 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 + enable: 0xFFDF7FF // Logging files/tables // Following settings specify where to log to. If 'use_sql' is @@ -100,7 +100,7 @@ map_log: { // Track Zeny Changes // Filter settings // 0 - don't log; 1 - log any zeny changes; 2.....1000000 - minimal absolute logging zeny value - log_zeny: 0 + log_zeny: 1 // Log MVP Monster Drops (Note 1) // Outdated. Use Pick_Log instead. But this log could be useful to keep track slayed MVPs @@ -112,7 +112,7 @@ map_log: { log_commands: true // Log NPC 'logmes' commands (Note 1) - log_npc: false + log_npc: true // Logging filters filter: { @@ -173,7 +173,7 @@ map_log: { // log_chat: 0x2f = logs everything // FIXME: This isn't fully functional, as of now it's only checking // if the log is active or not [Panikon] - log_chat: 0x0 + log_chat: 0x11 // Disable chat logging when WoE is running? (Note 1) log_chat_woe_disable: false diff --git a/npc/functions/global_event_handler.txt b/npc/functions/global_event_handler.txt index 33723786..aa06a38b 100644 --- a/npc/functions/global_event_handler.txt +++ b/npc/functions/global_event_handler.txt @@ -26,6 +26,15 @@ OnPCDieEvent: set @killerrid, 0; // reset killer rid end; +// Cleanup: Retain chat logs for 24~48 hours +// Cleanup: Retain item logs for 2 months +OnClock0500: + if (gettime(GETTIME_DAYOFMONTH) > 1) + query_sql("DELETE FROM `chatlog` WHERE `time` < '"+sqldate(-1)+"'"); + query_sql("DELETE FROM `picklog` WHERE `time` < '"+sqldate(0, -2)+"'"); + query_sql("DELETE FROM `zenylog` WHERE `time` < '"+sqldate(0, -2)+"'"); + end; + OnInit: MOTD(); // set the MOTD array end; diff --git a/npc/functions/main.txt b/npc/functions/main.txt index ead3a99d..25d20edc 100644 --- a/npc/functions/main.txt +++ b/npc/functions/main.txt @@ -633,3 +633,24 @@ function script learnskill { return; } +// sqldate({day variation, month variation}) +function script sqldate { + .@d=gettime(GETTIME_DAYOFMONTH)+getarg(0, 0); + .@m=gettime(GETTIME_MONTH)+getarg(1, 0); + .@y=gettime(GETTIME_YEAR); + // Overflow prevention + if (.@d <= 0) { + .@d=1; + } + while (.@m > 12) { + .@y+=1; + .@m-=12; + } + while (.@m < 1) { + .@y-=1; + .@m+=12; + } + .@strdate$=sprintf("%04d-%02d-%02d %02d:%02d:%02d", .@y, .@m, .@d, gettime(GETTIME_HOUR), gettime(GETTIME_MINUTE), gettime(GETTIME_SECOND)); + return .@strdate$; +} + |