aboutsummaryrefslogtreecommitdiff
path: root/src/script/scripting_server.h
diff options
context:
space:
mode:
authorElias Fleckenstein <eliasfleckenstein@web.de>2022-05-17 22:12:00 +0200
committerElias Fleckenstein <eliasfleckenstein@web.de>2022-05-17 22:12:00 +0200
commit21df26984da91143c15587f5a03c98d68c3adc4e (patch)
treeaaa707a628ad331f67890023dffe1b4f60dd01d3 /src/script/scripting_server.h
parentb09fc5de5cdb021f43ad32b7e3f50dc75c0bc622 (diff)
parenteabf05758e3ba5f6f4bb1b8d1d1f02179b84e410 (diff)
downloaddragonfireclient-21df26984da91143c15587f5a03c98d68c3adc4e.tar.xz
Merge branch 'master' of https://github.com/minetest/minetest
Diffstat (limited to 'src/script/scripting_server.h')
-rw-r--r--src/script/scripting_server.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/script/scripting_server.h b/src/script/scripting_server.h
index bf06ab197..9803397c5 100644
--- a/src/script/scripting_server.h
+++ b/src/script/scripting_server.h
@@ -27,6 +27,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "cpp_api/s_player.h"
#include "cpp_api/s_server.h"
#include "cpp_api/s_security.h"
+#include "cpp_api/s_async.h"
+
+struct PackedValue;
/*****************************************************************************/
/* Scripting <-> Server Game Interface */
@@ -48,6 +51,20 @@ public:
// use ScriptApiBase::loadMod() to load mods
+ // Initialize async engine, call this AFTER loading all mods
+ void initAsync();
+
+ // Global step handler to collect async results
+ void stepAsync();
+
+ // Pass job to async threads
+ u32 queueAsync(std::string &&serialized_func,
+ PackedValue *param, const std::string &mod_origin);
+
private:
void InitializeModApi(lua_State *L, int top);
+
+ static void InitializeAsync(lua_State *L, int top);
+
+ AsyncEngine asyncEngine;
};