From ecb83ef17e10fc21eaaab6f568adb17b74d4a3bd Mon Sep 17 00:00:00 2001 From: pg9182 <96569817+pg9182@users.noreply.github.com> Date: Sun, 5 Mar 2023 10:55:29 -0500 Subject: Fix build errors due to declaration order in scripthttprequesthandler (#430) --- NorthstarDLL/scripts/scripthttprequesthandler.cpp | 54 +++++++++++------------ 1 file changed, 27 insertions(+), 27 deletions(-) (limited to 'NorthstarDLL/scripts') 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 int HttpRequestHandler::MakeHttpRequest(const H return handle; } -template void HttpRequestHandler::RegisterSQFuncs() -{ - g_pSquirrel->AddFuncRegistration( - "int", - "NS_InternalMakeHttpRequest", - "int method, string baseUrl, table > headers, table > 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); - - g_pSquirrel->AddFuncRegistration( - "bool", - "NSIsHttpEnabled", - "", - "Whether or not HTTP requests are enabled. You can opt-out by starting the game with -disablehttprequests.", - SQ_IsHttpEnabled); - - g_pSquirrel->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); -} - // int NS_InternalMakeHttpRequest(int method, string baseUrl, table headers, table queryParams, // string contentType, string body, int timeout, string userAgent) template SQRESULT SQ_InternalMakeHttpRequest(HSquirrelVM* sqvm) @@ -567,6 +540,33 @@ template SQRESULT SQ_IsLocalHttpAllowed(HSquirrelVM* sqv return SQRESULT_NOTNULL; } +template void HttpRequestHandler::RegisterSQFuncs() +{ + g_pSquirrel->AddFuncRegistration( + "int", + "NS_InternalMakeHttpRequest", + "int method, string baseUrl, table > headers, table > 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); + + g_pSquirrel->AddFuncRegistration( + "bool", + "NSIsHttpEnabled", + "", + "Whether or not HTTP requests are enabled. You can opt-out by starting the game with -disablehttprequests.", + SQ_IsHttpEnabled); + + g_pSquirrel->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); +} + ON_DLL_LOAD_RELIESON("client.dll", HttpRequestHandler_ClientInit, ClientSquirrel, (CModule module)) { g_httpRequestHandler->RegisterSQFuncs(); -- cgit v1.2.3