From 1b3d2f507ff6660ad9ecc4a0864d517ca7a1af67 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Sun, 8 May 2022 23:08:08 -0300 Subject: Add apiasync, for raw packets --- src/emap/init.c | 1 + src/emap/script_buildins.c | 15 +++++++++++++++ src/emap/script_buildins.h | 1 + 3 files changed, 17 insertions(+) (limited to 'src') diff --git a/src/emap/init.c b/src/emap/init.c index 834f3ae..c8d0ac8 100644 --- a/src/emap/init.c +++ b/src/emap/init.c @@ -246,6 +246,7 @@ HPExport void plugin_init (void) addScriptCommand("bgnew", "siiss", bgnew); addScriptCommand("bgjoin", "isii?", bgjoin); addScriptCommand("apicall", "is", apicall); + addScriptCommand("apiasync", "s", apiasync); // Overrides addScriptCommand("debugmes","v*",debugmes); diff --git a/src/emap/script_buildins.c b/src/emap/script_buildins.c index 5c91301..1a34958 100644 --- a/src/emap/script_buildins.c +++ b/src/emap/script_buildins.c @@ -3616,6 +3616,21 @@ BUILDIN(apicall) #endif return true; } + + +/*========================================== + * Sends something over PyLog + *------------------------------------------*/ +BUILDIN(apiasync) +{ +#ifdef PYTHON_LOGS + logs->pylog(script_getstr(st, 2)); + script_pushint(st, 1); +#else + script_pushint(st, 0); +#endif + return true; +} ////////////////////////////////////////////////////////// /* switch (bl->type) { diff --git a/src/emap/script_buildins.h b/src/emap/script_buildins.h index 957bd2b..756ee0b 100644 --- a/src/emap/script_buildins.h +++ b/src/emap/script_buildins.h @@ -130,6 +130,7 @@ BUILDIN(getskillname); BUILDIN(bgnew); BUILDIN(bgjoin); BUILDIN(apicall); +BUILDIN(apiasync); // Overrides BUILDIN(countitem); -- cgit v1.2.3-70-g09d2