aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/masterserver.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'NorthstarDedicatedTest/masterserver.cpp')
-rw-r--r--NorthstarDedicatedTest/masterserver.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/NorthstarDedicatedTest/masterserver.cpp b/NorthstarDedicatedTest/masterserver.cpp
index 210cc290..ca1ca96d 100644
--- a/NorthstarDedicatedTest/masterserver.cpp
+++ b/NorthstarDedicatedTest/masterserver.cpp
@@ -168,6 +168,7 @@ void MasterServerManager::SetCommonHttpClientOptions(CURL* curl)
{
curl_easy_setopt(curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
+ curl_easy_setopt(curl, CURLOPT_USERAGENT, &NSUserAgent);
// curl_easy_setopt(curl, CURLOPT_STDERR, stdout);
if (CommandLine()->FindParm("-msinsecure")) // TODO: this check doesn't seem to work
{
@@ -209,7 +210,6 @@ void MasterServerManager::AuthenticateOriginWithMasterServer(char* uid, char* or
CURL* curl = curl_easy_init();
SetCommonHttpClientOptions(curl);
-
std::string readBuffer;
curl_easy_setopt(
curl, CURLOPT_URL,
@@ -555,7 +555,7 @@ void MasterServerManager::AuthenticateWithOwnServer(char* uid, char* playerToken
curl_easy_setopt(
curl, CURLOPT_URL,
fmt::format("{}/client/auth_with_self?id={}&playerToken={}", Cvar_ns_masterserver_hostname->GetString(), uidStr, tokenStr)
- .c_str());
+ .c_str());
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, CurlWriteToStringBufferCallback);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer);
@@ -697,7 +697,7 @@ void MasterServerManager::AuthenticateWithServer(char* uid, char* playerToken, c
fmt::format(
"{}/client/auth_with_server?id={}&playerToken={}&server={}&password={}", Cvar_ns_masterserver_hostname->GetString(),
uidStr, tokenStr, serverIdStr, escapedPassword)
- .c_str());
+ .c_str());
curl_free(escapedPassword);
}
@@ -831,7 +831,7 @@ void MasterServerManager::AddSelfToServerList(
"{}/server/add_server?port={}&authPort={}&name={}&description={}&map={}&playlist={}&maxPlayers={}&password={}",
Cvar_ns_masterserver_hostname->GetString(), port, authPort, nameEscaped, descEscaped, mapEscaped, playlistEscaped,
maxPlayers, passwordEscaped)
- .c_str());
+ .c_str());
curl_free(nameEscaped);
curl_free(descEscaped);
@@ -935,7 +935,7 @@ void MasterServerManager::AddSelfToServerList(
Cvar_ns_player_auth_port->GetInt(), escapedNameNew, escapedDescNew, escapedMapNew,
escapedPlaylistNew, g_ServerAuthenticationManager->m_additionalPlayerData.size(), maxPlayers,
escapedPasswordNew)
- .c_str());
+ .c_str());
curl_free(escapedNameNew);
curl_free(escapedDescNew);
@@ -1036,7 +1036,7 @@ void MasterServerManager::UpdateServerMapAndPlaylist(char* map, char* playlist,
fmt::format(
"{}/server/update_values?id={}&map={}&playlist={}&maxPlayers={}", Cvar_ns_masterserver_hostname->GetString(),
m_ownServerId, mapEscaped, playlistEscaped, maxPlayers)
- .c_str());
+ .c_str());
curl_free(mapEscaped);
curl_free(playlistEscaped);
@@ -1075,7 +1075,7 @@ void MasterServerManager::UpdateServerPlayerCount(int playerCount)
curl, CURLOPT_URL,
fmt::format(
"{}/server/update_values?id={}&playerCount={}", Cvar_ns_masterserver_hostname->GetString(), m_ownServerId, playerCount)
- .c_str());
+ .c_str());
CURLcode result = curl_easy_perform(curl);
@@ -1115,7 +1115,7 @@ void MasterServerManager::WritePlayerPersistentData(char* playerId, char* pdata,
fmt::format(
"{}/accounts/write_persistence?id={}&serverId={}", Cvar_ns_masterserver_hostname->GetString(), strPlayerId,
m_ownServerId)
- .c_str());
+ .c_str());
curl_easy_setopt(curl, CURLOPT_POST, 1L);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, CurlWriteToStringBufferCallback);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer);
@@ -1260,7 +1260,7 @@ void CHostState__State_GameShutdownHook(CHostState* hostState)
CHostState__State_GameShutdown(hostState);
}
-MasterServerManager::MasterServerManager() : m_pendingConnectionInfo{}, m_ownServerId{""}, m_ownClientAuthToken{""} {}
+MasterServerManager::MasterServerManager() : m_pendingConnectionInfo{}, m_ownServerId{ "" }, m_ownClientAuthToken{ "" } {}
void InitialiseSharedMasterServer(HMODULE baseAddress)
{