Skip to content

Commit 1a23a62

Browse files
committed
Added to fetchRemote: username/password, redirection
1 parent b0814cd commit 1a23a62

File tree

4 files changed

+14
-2
lines changed

4 files changed

+14
-2
lines changed

Client/mods/deathmatch/logic/lua/CLuaFunctionDefs.World.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
#define MIN_CLIENT_REQ_CALLREMOTE_QUEUE_NAME "1.5.3-9.11270"
2323
#define MIN_CLIENT_REQ_FETCHREMOTE_CONNECT_TIMEOUT "1.3.5"
24-
#define MIN_CLIENT_REQ_CALLREMOTE_OPTIONS_TABLE "1.5.4-9.11334"
24+
#define MIN_CLIENT_REQ_CALLREMOTE_OPTIONS_TABLE "1.5.4-9.11342"
2525

2626
int CLuaFunctionDefs::CreateExplosion ( lua_State* luaVM )
2727
{
@@ -1894,6 +1894,9 @@ int CLuaFunctionDefs::FetchRemote ( lua_State* luaVM )
18941894
optionsMap.ReadString("queueName", strQueueName, CALL_REMOTE_DEFAULT_QUEUE_NAME);
18951895
optionsMap.ReadString("postData", httpRequestOptions.strPostData, "");
18961896
optionsMap.ReadBool("postIsBinary", httpRequestOptions.bPostBinary, false);
1897+
optionsMap.ReadNumber("maxRedirects", httpRequestOptions.uiMaxRedirects, 8);
1898+
optionsMap.ReadString("authUsername", httpRequestOptions.strAuthUsername, "");
1899+
optionsMap.ReadString("authPassword", httpRequestOptions.strAuthPassword, "");
18971900

18981901
CStringMap headersMap;
18991902
optionsMap.ReadStringMap("headers", headersMap);

Client/sdk/net/CNetHTTPDownloadManagerInterface.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ struct SHttpRequestOptions
2121
uint uiConnectTimeoutMs = 10000;
2222
SString strRequestMethod;
2323
std::map<SString,SString> requestHeaders;
24+
uint uiMaxRedirects = 8;
25+
SString strAuthUsername;
26+
SString strAuthPassword;
2427
};
2528

2629
struct SHttpDownloadResult

Server/mods/deathmatch/logic/lua/CLuaFunctionDefs.Server.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#define MIN_SERVER_REQ_CALLREMOTE_QUEUE_NAME "1.5.3-9.11270"
2525
#define MIN_SERVER_REQ_CALLREMOTE_CONNECTION_ATTEMPTS "1.3.0-9.04563"
2626
#define MIN_SERVER_REQ_CALLREMOTE_CONNECT_TIMEOUT "1.3.5"
27-
#define MIN_SERVER_REQ_CALLREMOTE_OPTIONS_TABLE "1.5.4-9.11334"
27+
#define MIN_SERVER_REQ_CALLREMOTE_OPTIONS_TABLE "1.5.4-9.11342"
2828

2929

3030
int CLuaFunctionDefs::GetMaxPlayers ( lua_State* luaVM )
@@ -659,6 +659,9 @@ int CLuaFunctionDefs::FetchRemote ( lua_State* luaVM )
659659
optionsMap.ReadString("queueName", strQueueName, CALL_REMOTE_DEFAULT_QUEUE_NAME);
660660
optionsMap.ReadString("postData", httpRequestOptions.strPostData, "");
661661
optionsMap.ReadBool("postIsBinary", httpRequestOptions.bPostBinary, false);
662+
optionsMap.ReadNumber("maxRedirects", httpRequestOptions.uiMaxRedirects, 8);
663+
optionsMap.ReadString("authUsername", httpRequestOptions.strAuthUsername, "");
664+
optionsMap.ReadString("authPassword", httpRequestOptions.strAuthPassword, "");
662665

663666
CStringMap headersMap;
664667
optionsMap.ReadStringMap("headers", headersMap);

Server/sdk/net/CNetHTTPDownloadManagerInterface.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ struct SHttpRequestOptions
2121
uint uiConnectTimeoutMs = 10000;
2222
SString strRequestMethod;
2323
std::map<SString,SString> requestHeaders;
24+
uint uiMaxRedirects = 8;
25+
SString strAuthUsername;
26+
SString strAuthPassword;
2427
};
2528

2629
struct SHttpDownloadResult

0 commit comments

Comments
 (0)