diff options
author | pg9182 <96569817+pg9182@users.noreply.github.com> | 2023-03-05 10:55:29 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-05 10:55:29 -0500 |
commit | ecb83ef17e10fc21eaaab6f568adb17b74d4a3bd (patch) | |
tree | 76ea83ea9ce174a4d0c3f60813af13ec533b54e8 /NorthstarDLL/scripts/scripthttprequesthandler.cpp | |
parent | 32165afe41c4cf4d3b261ee7a9c69c369253cc13 (diff) | |
download | NorthstarLauncher-ecb83ef17e10fc21eaaab6f568adb17b74d4a3bd.tar.gz NorthstarLauncher-ecb83ef17e10fc21eaaab6f568adb17b74d4a3bd.zip |
Fix build errors due to declaration order in scripthttprequesthandler (#430)
Diffstat (limited to 'NorthstarDLL/scripts/scripthttprequesthandler.cpp')
-rw-r--r-- | NorthstarDLL/scripts/scripthttprequesthandler.cpp | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/NorthstarDLL/scripts/scripthttprequesthandler.cpp b/NorthstarDLL/scripts/scripthttprequesthandler.cpp index 8a6f70fc..813bd50e 100644 --- a/NorthstarDLL/scripts/scripthttprequesthandler.cpp +++ b/NorthstarDLL/scripts/scripthttprequesthandler.cpp @@ -448,33 +448,6 @@ template <ScriptContext context> int HttpRequestHandler::MakeHttpRequest(const H return handle; } -template <ScriptContext context> void HttpRequestHandler::RegisterSQFuncs() -{ - g_pSquirrel<context>->AddFuncRegistration( - "int", - "NS_InternalMakeHttpRequest", - "int method, string baseUrl, table<string, array<string> > headers, table<string, array<string> > queryParams, string contentType, " - "string body, " - "int timeout, string userAgent", - "[Internal use only] Passes the HttpRequest struct fields to be reconstructed in native and used for an http request", - SQ_InternalMakeHttpRequest<context>); - - g_pSquirrel<context>->AddFuncRegistration( - "bool", - "NSIsHttpEnabled", - "", - "Whether or not HTTP requests are enabled. You can opt-out by starting the game with -disablehttprequests.", - SQ_IsHttpEnabled<context>); - - g_pSquirrel<context>->AddFuncRegistration( - "bool", - "NSIsLocalHttpAllowed", - "", - "Whether or not HTTP requests can be made to a private network address. You can enable this by starting the game with " - "-allowlocalhttp.", - SQ_IsLocalHttpAllowed<context>); -} - // int NS_InternalMakeHttpRequest(int method, string baseUrl, table<string, string> headers, table<string, string> queryParams, // string contentType, string body, int timeout, string userAgent) template <ScriptContext context> SQRESULT SQ_InternalMakeHttpRequest(HSquirrelVM* sqvm) @@ -567,6 +540,33 @@ template <ScriptContext context> SQRESULT SQ_IsLocalHttpAllowed(HSquirrelVM* sqv return SQRESULT_NOTNULL; } +template <ScriptContext context> void HttpRequestHandler::RegisterSQFuncs() +{ + g_pSquirrel<context>->AddFuncRegistration( + "int", + "NS_InternalMakeHttpRequest", + "int method, string baseUrl, table<string, array<string> > headers, table<string, array<string> > queryParams, string contentType, " + "string body, " + "int timeout, string userAgent", + "[Internal use only] Passes the HttpRequest struct fields to be reconstructed in native and used for an http request", + SQ_InternalMakeHttpRequest<context>); + + g_pSquirrel<context>->AddFuncRegistration( + "bool", + "NSIsHttpEnabled", + "", + "Whether or not HTTP requests are enabled. You can opt-out by starting the game with -disablehttprequests.", + SQ_IsHttpEnabled<context>); + + g_pSquirrel<context>->AddFuncRegistration( + "bool", + "NSIsLocalHttpAllowed", + "", + "Whether or not HTTP requests can be made to a private network address. You can enable this by starting the game with " + "-allowlocalhttp.", + SQ_IsLocalHttpAllowed<context>); +} + ON_DLL_LOAD_RELIESON("client.dll", HttpRequestHandler_ClientInit, ClientSquirrel, (CModule module)) { g_httpRequestHandler->RegisterSQFuncs<ScriptContext::CLIENT>(); |