summaryrefslogtreecommitdiff
path: root/npc/functions/main.txt
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2021-04-12 10:57:46 -0300
committerJesusaves <cpntb1@ymail.com>2021-04-12 10:57:46 -0300
commit5642dea82f99181dce45b83b9e9bcfd6a903175b (patch)
treef317834c49cfc4d310dd547589ac3a0724da2213 /npc/functions/main.txt
parent39415877d0a5de26560db25c766c2f8b77528a1f (diff)
downloadserverdata-5642dea82f99181dce45b83b9e9bcfd6a903175b.tar.gz
serverdata-5642dea82f99181dce45b83b9e9bcfd6a903175b.tar.bz2
serverdata-5642dea82f99181dce45b83b9e9bcfd6a903175b.tar.xz
serverdata-5642dea82f99181dce45b83b9e9bcfd6a903175b.zip
Enable some logging and keep it around for a short period because whinners.
Chat log retention: 24~48 hours item log retention: 2 months (same for money)
Diffstat (limited to 'npc/functions/main.txt')
-rw-r--r--npc/functions/main.txt21
1 files changed, 21 insertions, 0 deletions
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$;
+}
+