From 6f2873829fcf8306f87d1f1a982a4f0455e540a3 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Fri, 6 May 2022 22:39:49 -0300 Subject: Send API messages using the logmaster instead of the C engine if possible. --- npc/functions/util.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'npc') diff --git a/npc/functions/util.txt b/npc/functions/util.txt index 05699b68a..d3aebb7d1 100644 --- a/npc/functions/util.txt +++ b/npc/functions/util.txt @@ -1307,8 +1307,11 @@ function script json_encode { // sends to API function script api_send { .@cde=getarg(0); - .@fm$=escape_sql(getarg(1)); - query_sql("INSERT INTO `api_export` (`type`, `data`) VALUES ('"+.@cde+"', \""+.@fm$+"\")"); + if (!apicall(.@cde, getarg(1))) { + debugmes "[API] Fallback in use."; + .@fm$=escape_sql(getarg(1)); + query_sql("INSERT INTO `api_export` (`type`, `data`) VALUES ('"+.@cde+"', \""+.@fm$+"\")"); + } return; } -- cgit v1.2.3-60-g2f50