Skip to content
Permalink
Browse files

Fix HTTP API not being available in async mainmenu (#10086)

  • Loading branch information
rubenwardy committed Jun 22, 2020
1 parent e99415e commit 4cb18d4874126b384ad5faa1b10a208c8fdce4db
Showing with 9 additions and 0 deletions.
  1. +7 −0 src/script/lua_api/l_http.cpp
  2. +1 −0 src/script/lua_api/l_http.h
  3. +1 −0 src/script/scripting_mainmenu.cpp
@@ -230,3 +230,10 @@ void ModApiHttp::Initialize(lua_State *L, int top)

#endif
}

void ModApiHttp::InitializeAsync(lua_State *L, int top)
{
#if USE_CURL
API_FCT(get_http_api);
#endif
}
@@ -50,4 +50,5 @@ class ModApiHttp : public ModApiBase {

public:
static void Initialize(lua_State *L, int top);
static void InitializeAsync(lua_State *L, int top);
};
@@ -73,6 +73,7 @@ void MainMenuScripting::initializeModApi(lua_State *L, int top)
asyncEngine.registerStateInitializer(registerLuaClasses);
asyncEngine.registerStateInitializer(ModApiMainMenu::InitializeAsync);
asyncEngine.registerStateInitializer(ModApiUtil::InitializeAsync);
asyncEngine.registerStateInitializer(ModApiHttp::InitializeAsync);

// Initialize async environment
//TODO possibly make number of async threads configurable

0 comments on commit 4cb18d4

Please sign in to comment.
You can’t perform that action at this time.