diff options
author | Jesusaves <cpntb1@ymail.com> | 2022-05-06 22:40:10 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2022-05-06 22:40:10 -0300 |
commit | dd18ef8db4336b323ed8d77c315a76829c2e7ce9 (patch) | |
tree | 2d46d6a7b41f6c9e077ca28a194fcae11e4164e5 /src/emap/script_buildins.c | |
parent | 6af862b9b807afec3c55ecd9f57db218717faf68 (diff) | |
download | evol-hercules-dd18ef8db4336b323ed8d77c315a76829c2e7ce9.tar.gz evol-hercules-dd18ef8db4336b323ed8d77c315a76829c2e7ce9.tar.bz2 evol-hercules-dd18ef8db4336b323ed8d77c315a76829c2e7ce9.tar.xz evol-hercules-dd18ef8db4336b323ed8d77c315a76829c2e7ce9.zip |
Add support to make API updates with PYTHON_LOGS if set.
Diffstat (limited to 'src/emap/script_buildins.c')
-rw-r--r-- | src/emap/script_buildins.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/emap/script_buildins.c b/src/emap/script_buildins.c index dd8666b..5c91301 100644 --- a/src/emap/script_buildins.c +++ b/src/emap/script_buildins.c @@ -23,6 +23,9 @@ #include "map/guild.h" #include "map/homunculus.h" #include "map/instance.h" +#ifdef PYTHON_LOGS +#include "map/log.h" +#endif #include "map/mapreg.h" #include "map/mob.h" #include "map/npc.h" @@ -3593,6 +3596,26 @@ BUILDIN(bgjoin) return true; } + +/*========================================== + * Sends something over PyLog + *------------------------------------------*/ +BUILDIN(apicall) +{ +#ifdef PYTHON_LOGS + char bf1[1024], bf3[2048], bf4[16]; + sprintf(bf1,"SQL→INSERT INTO `api_export` (`type`, `data`) VALUES ('%d', '?1')", script_getnum(st, 2)); + logs->pylog(bf1); + sprintf(bf3, "SAD1→%s", script_getstr(st, 3)); + logs->pylog(bf3); + sprintf(bf4, "SQLRUN→"); + logs->pylog(bf4); + script_pushint(st, 1); +#else + script_pushint(st, 0); +#endif + return true; +} ////////////////////////////////////////////////////////// /* switch (bl->type) { |