diff options
author | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2022-05-09 02:46:04 +0100 |
---|---|---|
committer | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2022-05-09 02:46:04 +0100 |
commit | 9ab7c43c34183915273cc8b5ccedd72568249b27 (patch) | |
tree | 6662f6f8d5a64bb86ec725faf48fe4c8cbe3eb70 /NorthstarDedicatedTest/masterserver.cpp | |
parent | 503d336e9e695a0518f90f727f4a2fe4569615e6 (diff) | |
download | NorthstarLauncher-9ab7c43c34183915273cc8b5ccedd72568249b27.tar.gz NorthstarLauncher-9ab7c43c34183915273cc8b5ccedd72568249b27.zip |
fix debug crashes
Diffstat (limited to 'NorthstarDedicatedTest/masterserver.cpp')
-rw-r--r-- | NorthstarDedicatedTest/masterserver.cpp | 200 |
1 files changed, 100 insertions, 100 deletions
diff --git a/NorthstarDedicatedTest/masterserver.cpp b/NorthstarDedicatedTest/masterserver.cpp index 7767ea88..287b9e99 100644 --- a/NorthstarDedicatedTest/masterserver.cpp +++ b/NorthstarDedicatedTest/masterserver.cpp @@ -109,8 +109,8 @@ std::string unescape_unicode(const std::string& str) void UpdateServerInfoFromUnicodeToUTF8() { - g_MasterServerManager->ns_auth_srvName = unescape_unicode(Cvar_ns_server_name->GetString()); - g_MasterServerManager->ns_auth_srvDesc = unescape_unicode(Cvar_ns_server_desc->GetString()); + g_MasterServerManager->m_sUnicodeServerName = unescape_unicode(Cvar_ns_server_name->GetString()); + g_MasterServerManager->m_sUnicodeServerDesc = unescape_unicode(Cvar_ns_server_desc->GetString()); } const char* HttplibErrorToString(httplib::Error error) @@ -191,11 +191,11 @@ void MasterServerManager::SetCommonHttpClientOptions(CURL* curl) void MasterServerManager::ClearServerList() { // this doesn't really do anything lol, probably isn't threadsafe - m_requestingServerList = true; + m_bRequestingServerList = true; - m_remoteServers.clear(); + m_vRemoteServers.clear(); - m_requestingServerList = false; + m_bRequestingServerList = false; } size_t CurlWriteToStringBufferCallback(char* contents, size_t size, size_t nmemb, void* userp) @@ -234,7 +234,7 @@ void MasterServerManager::AuthenticateOriginWithMasterServer(char* uid, char* or if (result == CURLcode::CURLE_OK) { - m_successfullyConnected = true; + m_bSuccessfullyConnected = true; rapidjson_document originAuthInfo; originAuthInfo.Parse(readBuffer.c_str()); @@ -255,8 +255,8 @@ void MasterServerManager::AuthenticateOriginWithMasterServer(char* uid, char* or if (originAuthInfo["success"].IsTrue() && originAuthInfo.HasMember("token") && originAuthInfo["token"].IsString()) { - strncpy(m_ownClientAuthToken, originAuthInfo["token"].GetString(), sizeof(m_ownClientAuthToken)); - m_ownClientAuthToken[sizeof(m_ownClientAuthToken) - 1] = 0; + strncpy(m_sOwnClientAuthToken, originAuthInfo["token"].GetString(), sizeof(m_sOwnClientAuthToken)); + m_sOwnClientAuthToken[sizeof(m_sOwnClientAuthToken) - 1] = 0; spdlog::info("Northstar origin authentication completed successfully!"); } else @@ -265,7 +265,7 @@ void MasterServerManager::AuthenticateOriginWithMasterServer(char* uid, char* or else { spdlog::error("Failed performing northstar origin auth: error {}", curl_easy_strerror(result)); - m_successfullyConnected = false; + m_bSuccessfullyConnected = false; } // we goto this instead of returning so we always hit this @@ -281,18 +281,18 @@ void MasterServerManager::AuthenticateOriginWithMasterServer(char* uid, char* or void MasterServerManager::RequestServerList() { // do this here so it's instantly set on call for scripts - m_scriptRequestingServerList = true; + m_bScriptRequestingServerList = true; std::thread requestThread( [this]() { // make sure we never have 2 threads writing at once // i sure do hope this is actually threadsafe - while (m_requestingServerList) + while (m_bRequestingServerList) Sleep(100); - m_requestingServerList = true; - m_scriptRequestingServerList = true; + m_bRequestingServerList = true; + m_bScriptRequestingServerList = true; spdlog::info("Requesting server list from {}", Cvar_ns_masterserver_hostname->GetString()); @@ -309,7 +309,7 @@ void MasterServerManager::RequestServerList() if (result == CURLcode::CURLE_OK) { - m_successfullyConnected = true; + m_bSuccessfullyConnected = true; rapidjson_document serverInfoJson; serverInfoJson.Parse(readBuffer.c_str()); @@ -365,7 +365,7 @@ void MasterServerManager::RequestServerList() RemoteServerInfo* newServer = nullptr; bool createNewServerInfo = true; - for (RemoteServerInfo& server : m_remoteServers) + for (RemoteServerInfo& server : m_vRemoteServers) { // if server already exists, update info rather than adding to it if (!strncmp((const char*)server.id, id, 32)) @@ -387,7 +387,7 @@ void MasterServerManager::RequestServerList() // server didn't exist if (createNewServerInfo) - newServer = &m_remoteServers.emplace_back( + newServer = &m_vRemoteServers.emplace_back( id, serverObj["name"].GetString(), serverObj["description"].GetString(), @@ -424,20 +424,20 @@ void MasterServerManager::RequestServerList() } std::sort( - m_remoteServers.begin(), - m_remoteServers.end(), + m_vRemoteServers.begin(), + m_vRemoteServers.end(), [](RemoteServerInfo& a, RemoteServerInfo& b) { return a.playerCount > b.playerCount; }); } else { spdlog::error("Failed requesting servers: error {}", curl_easy_strerror(result)); - m_successfullyConnected = false; + m_bSuccessfullyConnected = false; } // we goto this instead of returning so we always hit this REQUEST_END_CLEANUP: - m_requestingServerList = false; - m_scriptRequestingServerList = false; + m_bRequestingServerList = false; + m_bScriptRequestingServerList = false; curl_easy_cleanup(curl); }); @@ -468,7 +468,7 @@ void MasterServerManager::RequestMainMenuPromos() if (result == CURLcode::CURLE_OK) { - m_successfullyConnected = true; + m_bSuccessfullyConnected = true; rapidjson_document mainMenuPromoJson; mainMenuPromoJson.Parse(readBuffer.c_str()); @@ -522,29 +522,29 @@ void MasterServerManager::RequestMainMenuPromos() goto REQUEST_END_CLEANUP; } - m_MainMenuPromoData.newInfoTitle1 = mainMenuPromoJson["newInfo"]["Title1"].GetString(); - m_MainMenuPromoData.newInfoTitle2 = mainMenuPromoJson["newInfo"]["Title2"].GetString(); - m_MainMenuPromoData.newInfoTitle3 = mainMenuPromoJson["newInfo"]["Title3"].GetString(); + m_sMainMenuPromoData.newInfoTitle1 = mainMenuPromoJson["newInfo"]["Title1"].GetString(); + m_sMainMenuPromoData.newInfoTitle2 = mainMenuPromoJson["newInfo"]["Title2"].GetString(); + m_sMainMenuPromoData.newInfoTitle3 = mainMenuPromoJson["newInfo"]["Title3"].GetString(); - m_MainMenuPromoData.largeButtonTitle = mainMenuPromoJson["largeButton"]["Title"].GetString(); - m_MainMenuPromoData.largeButtonText = mainMenuPromoJson["largeButton"]["Text"].GetString(); - m_MainMenuPromoData.largeButtonUrl = mainMenuPromoJson["largeButton"]["Url"].GetString(); - m_MainMenuPromoData.largeButtonImageIndex = mainMenuPromoJson["largeButton"]["ImageIndex"].GetInt(); + m_sMainMenuPromoData.largeButtonTitle = mainMenuPromoJson["largeButton"]["Title"].GetString(); + m_sMainMenuPromoData.largeButtonText = mainMenuPromoJson["largeButton"]["Text"].GetString(); + m_sMainMenuPromoData.largeButtonUrl = mainMenuPromoJson["largeButton"]["Url"].GetString(); + m_sMainMenuPromoData.largeButtonImageIndex = mainMenuPromoJson["largeButton"]["ImageIndex"].GetInt(); - m_MainMenuPromoData.smallButton1Title = mainMenuPromoJson["smallButton1"]["Title"].GetString(); - m_MainMenuPromoData.smallButton1Url = mainMenuPromoJson["smallButton1"]["Url"].GetString(); - m_MainMenuPromoData.smallButton1ImageIndex = mainMenuPromoJson["smallButton1"]["ImageIndex"].GetInt(); + m_sMainMenuPromoData.smallButton1Title = mainMenuPromoJson["smallButton1"]["Title"].GetString(); + m_sMainMenuPromoData.smallButton1Url = mainMenuPromoJson["smallButton1"]["Url"].GetString(); + m_sMainMenuPromoData.smallButton1ImageIndex = mainMenuPromoJson["smallButton1"]["ImageIndex"].GetInt(); - m_MainMenuPromoData.smallButton2Title = mainMenuPromoJson["smallButton2"]["Title"].GetString(); - m_MainMenuPromoData.smallButton2Url = mainMenuPromoJson["smallButton2"]["Url"].GetString(); - m_MainMenuPromoData.smallButton2ImageIndex = mainMenuPromoJson["smallButton2"]["ImageIndex"].GetInt(); + m_sMainMenuPromoData.smallButton2Title = mainMenuPromoJson["smallButton2"]["Title"].GetString(); + m_sMainMenuPromoData.smallButton2Url = mainMenuPromoJson["smallButton2"]["Url"].GetString(); + m_sMainMenuPromoData.smallButton2ImageIndex = mainMenuPromoJson["smallButton2"]["ImageIndex"].GetInt(); m_bHasMainMenuPromoData = true; } else { spdlog::error("Failed requesting main menu promos: error {}", curl_easy_strerror(result)); - m_successfullyConnected = false; + m_bSuccessfullyConnected = false; } REQUEST_END_CLEANUP: @@ -558,12 +558,12 @@ void MasterServerManager::RequestMainMenuPromos() void MasterServerManager::AuthenticateWithOwnServer(char* uid, char* playerToken) { // dont wait, just stop if we're trying to do 2 auth requests at once - if (m_authenticatingWithGameServer) + if (m_bAuthenticatingWithGameServer) return; - m_authenticatingWithGameServer = true; - m_scriptAuthenticatingWithGameServer = true; - m_successfullyAuthenticatedWithGameServer = false; + m_bAuthenticatingWithGameServer = true; + m_bScriptAuthenticatingWithGameServer = true; + m_bSuccessfullyAuthenticatedWithGameServer = false; std::string uidStr(uid); std::string tokenStr(playerToken); @@ -588,7 +588,7 @@ void MasterServerManager::AuthenticateWithOwnServer(char* uid, char* playerToken if (result == CURLcode::CURLE_OK) { - m_successfullyConnected = true; + m_bSuccessfullyConnected = true; rapidjson_document authInfoJson; authInfoJson.Parse(readBuffer.c_str()); @@ -654,19 +654,19 @@ void MasterServerManager::AuthenticateWithOwnServer(char* uid, char* playerToken g_ServerAuthenticationManager->m_authData.clear(); g_ServerAuthenticationManager->m_authData.insert(std::make_pair(authInfoJson["authToken"].GetString(), newAuthData)); - m_successfullyAuthenticatedWithGameServer = true; + m_bSuccessfullyAuthenticatedWithGameServer = true; } else { spdlog::error("Failed authenticating with own server: error {}", curl_easy_strerror(result)); - m_successfullyConnected = false; - m_successfullyAuthenticatedWithGameServer = false; - m_scriptAuthenticatingWithGameServer = false; + m_bSuccessfullyConnected = false; + m_bSuccessfullyAuthenticatedWithGameServer = false; + m_bScriptAuthenticatingWithGameServer = false; } REQUEST_END_CLEANUP: - m_authenticatingWithGameServer = false; - m_scriptAuthenticatingWithGameServer = false; + m_bAuthenticatingWithGameServer = false; + m_bScriptAuthenticatingWithGameServer = false; if (m_bNewgameAfterSelfAuth) { @@ -684,12 +684,12 @@ void MasterServerManager::AuthenticateWithOwnServer(char* uid, char* playerToken void MasterServerManager::AuthenticateWithServer(char* uid, char* playerToken, char* serverId, char* password) { // dont wait, just stop if we're trying to do 2 auth requests at once - if (m_authenticatingWithGameServer) + if (m_bAuthenticatingWithGameServer) return; - m_authenticatingWithGameServer = true; - m_scriptAuthenticatingWithGameServer = true; - m_successfullyAuthenticatedWithGameServer = false; + m_bAuthenticatingWithGameServer = true; + m_bScriptAuthenticatingWithGameServer = true; + m_bSuccessfullyAuthenticatedWithGameServer = false; std::string uidStr(uid); std::string tokenStr(playerToken); @@ -700,7 +700,7 @@ void MasterServerManager::AuthenticateWithServer(char* uid, char* playerToken, c [this, uidStr, tokenStr, serverIdStr, passwordStr]() { // esnure that any persistence saving is done, so we know masterserver has newest - while (m_savingPersistentData) + while (m_bSavingPersistentData) Sleep(100); spdlog::info("Attempting authentication with server of id \"{}\"", serverIdStr); @@ -735,7 +735,7 @@ void MasterServerManager::AuthenticateWithServer(char* uid, char* playerToken, c if (result == CURLcode::CURLE_OK) { - m_successfullyConnected = true; + m_bSuccessfullyConnected = true; rapidjson_document connectionInfoJson; connectionInfoJson.Parse(readBuffer.c_str()); @@ -782,20 +782,20 @@ void MasterServerManager::AuthenticateWithServer(char* uid, char* playerToken, c strncpy(m_pendingConnectionInfo.authToken, connectionInfoJson["authToken"].GetString(), 31); m_pendingConnectionInfo.authToken[31] = 0; - m_hasPendingConnectionInfo = true; - m_successfullyAuthenticatedWithGameServer = true; + m_bHasPendingConnectionInfo = true; + m_bSuccessfullyAuthenticatedWithGameServer = true; } else { spdlog::error("Failed authenticating with server: error {}", curl_easy_strerror(result)); - m_successfullyConnected = false; - m_successfullyAuthenticatedWithGameServer = false; - m_scriptAuthenticatingWithGameServer = false; + m_bSuccessfullyConnected = false; + m_bSuccessfullyAuthenticatedWithGameServer = false; + m_bScriptAuthenticatingWithGameServer = false; } REQUEST_END_CLEANUP: - m_authenticatingWithGameServer = false; - m_scriptAuthenticatingWithGameServer = false; + m_bAuthenticatingWithGameServer = false; + m_bScriptAuthenticatingWithGameServer = false; curl_easy_cleanup(curl); }); @@ -825,8 +825,8 @@ void MasterServerManager::AddSelfToServerList( std::thread requestThread( [this, port, authPort, strName, strDescription, strMap, strPlaylist, maxPlayers, strPassword] { - m_ownServerId[0] = 0; - m_ownServerAuthToken[0] = 0; + m_sOwnServerId[0] = 0; + m_sOwnServerAuthToken[0] = 0; CURL* curl = curl_easy_init(); SetCommonHttpClientOptions(curl); @@ -839,7 +839,7 @@ void MasterServerManager::AddSelfToServerList( curl_mime* mime = curl_mime_init(curl); curl_mimepart* part = curl_mime_addpart(mime); - curl_mime_data(part, m_ownModInfoJson.c_str(), m_ownModInfoJson.size()); + curl_mime_data(part, m_sOwnModInfoJson.c_str(), m_sOwnModInfoJson.size()); curl_mime_name(part, "modinfo"); curl_mime_filename(part, "modinfo.json"); curl_mime_type(part, "application/json"); @@ -881,7 +881,7 @@ void MasterServerManager::AddSelfToServerList( if (result == CURLcode::CURLE_OK) { - m_successfullyConnected = true; + m_bSuccessfullyConnected = true; rapidjson_document serverAddedJson; serverAddedJson.Parse(readBuffer.c_str()); @@ -920,11 +920,11 @@ void MasterServerManager::AddSelfToServerList( goto REQUEST_END_CLEANUP; } - strncpy(m_ownServerId, serverAddedJson["id"].GetString(), sizeof(m_ownServerId)); - m_ownServerId[sizeof(m_ownServerId) - 1] = 0; + strncpy(m_sOwnServerId, serverAddedJson["id"].GetString(), sizeof(m_sOwnServerId)); + m_sOwnServerId[sizeof(m_sOwnServerId) - 1] = 0; - strncpy(m_ownServerAuthToken, serverAddedJson["serverAuthToken"].GetString(), sizeof(m_ownServerAuthToken)); - m_ownServerAuthToken[sizeof(m_ownServerAuthToken) - 1] = 0; + strncpy(m_sOwnServerAuthToken, serverAddedJson["serverAuthToken"].GetString(), sizeof(m_sOwnServerAuthToken)); + m_sOwnServerAuthToken[sizeof(m_sOwnServerAuthToken) - 1] = 0; // heartbeat thread // ideally this should actually be done in main thread, rather than on it's own thread, so it'd stop if server freezes @@ -934,7 +934,7 @@ void MasterServerManager::AddSelfToServerList( Sleep(5000); // defensive check, as m_ownServer could be set to null during the Sleep(5000) above - if (!*m_ownServerId) + if (!*m_sOwnServerId) return; do @@ -951,8 +951,8 @@ void MasterServerManager::AddSelfToServerList( // send all registration info so we have all necessary info to reregister our server if masterserver goes down, // without a restart this isn't threadsafe :terror: { - char* escapedNameNew = curl_easy_escape(curl, g_MasterServerManager->ns_auth_srvName.c_str(), NULL); - char* escapedDescNew = curl_easy_escape(curl, g_MasterServerManager->ns_auth_srvDesc.c_str(), NULL); + char* escapedNameNew = curl_easy_escape(curl, g_MasterServerManager->m_sUnicodeServerName.c_str(), NULL); + char* escapedDescNew = curl_easy_escape(curl, g_MasterServerManager->m_sUnicodeServerDesc.c_str(), NULL); char* escapedMapNew = curl_easy_escape(curl, g_pHostState->m_levelName, NULL); char* escapedPlaylistNew = curl_easy_escape(curl, GetCurrentPlaylistName(), NULL); char* escapedPasswordNew = curl_easy_escape(curl, Cvar_ns_server_password->GetString(), NULL); @@ -970,7 +970,7 @@ void MasterServerManager::AddSelfToServerList( "update_values?id={}&port={}&authPort={}&name={}&description={}&map={}&playlist={}&playerCount={}&" "maxPlayers={}&password={}", Cvar_ns_masterserver_hostname->GetString(), - m_ownServerId, + m_sOwnServerId, Cvar_hostport->GetInt(), Cvar_ns_player_auth_port->GetInt(), escapedNameNew, @@ -992,7 +992,7 @@ void MasterServerManager::AddSelfToServerList( curl_mime* mime = curl_mime_init(curl); curl_mimepart* part = curl_mime_addpart(mime); - curl_mime_data(part, m_ownModInfoJson.c_str(), m_ownModInfoJson.size()); + curl_mime_data(part, m_sOwnModInfoJson.c_str(), m_sOwnModInfoJson.size()); curl_mime_name(part, "modinfo"); curl_mime_filename(part, "modinfo.json"); curl_mime_type(part, "application/json"); @@ -1002,7 +1002,7 @@ void MasterServerManager::AddSelfToServerList( CURLcode result = curl_easy_perform(curl); // defensive check, as m_ownServerId could be set to null before this request gets processed - if (!*m_ownServerId) + if (!*m_sOwnServerId) return; if (result == CURLcode::CURLE_OK) @@ -1014,17 +1014,17 @@ void MasterServerManager::AddSelfToServerList( { if (serverAddedJson.HasMember("id") && serverAddedJson["id"].IsString()) { - strncpy(m_ownServerId, serverAddedJson["id"].GetString(), sizeof(m_ownServerId)); - m_ownServerId[sizeof(m_ownServerId) - 1] = 0; + strncpy(m_sOwnServerId, serverAddedJson["id"].GetString(), sizeof(m_sOwnServerId)); + m_sOwnServerId[sizeof(m_sOwnServerId) - 1] = 0; } if (serverAddedJson.HasMember("serverAuthToken") && serverAddedJson["serverAuthToken"].IsString()) { strncpy( - m_ownServerAuthToken, + m_sOwnServerAuthToken, serverAddedJson["serverAuthToken"].GetString(), - sizeof(m_ownServerAuthToken)); - m_ownServerAuthToken[sizeof(m_ownServerAuthToken) - 1] = 0; + sizeof(m_sOwnServerAuthToken)); + m_sOwnServerAuthToken[sizeof(m_sOwnServerAuthToken) - 1] = 0; } } } @@ -1033,7 +1033,7 @@ void MasterServerManager::AddSelfToServerList( curl_easy_cleanup(curl); Sleep(10000); - } while (*m_ownServerId); + } while (*m_sOwnServerId); }); heartbeatThread.detach(); @@ -1041,7 +1041,7 @@ void MasterServerManager::AddSelfToServerList( else { spdlog::error("Failed adding self to server list: error {}", curl_easy_strerror(result)); - m_successfullyConnected = false; + m_bSuccessfullyConnected = false; } REQUEST_END_CLEANUP: @@ -1055,7 +1055,7 @@ void MasterServerManager::AddSelfToServerList( void MasterServerManager::UpdateServerMapAndPlaylist(char* map, char* playlist, int maxPlayers) { // dont call this if we don't have a server id - if (!*m_ownServerId) + if (!*m_sOwnServerId) return; std::string strMap(map); @@ -1083,7 +1083,7 @@ void MasterServerManager::UpdateServerMapAndPlaylist(char* map, char* playlist, fmt::format( "{}/server/update_values?id={}&map={}&playlist={}&maxPlayers={}", Cvar_ns_masterserver_hostname->GetString(), - m_ownServerId, + m_sOwnServerId, mapEscaped, playlistEscaped, maxPlayers) @@ -1096,9 +1096,9 @@ void MasterServerManager::UpdateServerMapAndPlaylist(char* map, char* playlist, CURLcode result = curl_easy_perform(curl); if (result == CURLcode::CURLE_OK) - m_successfullyConnected = true; + m_bSuccessfullyConnected = true; else - m_successfullyConnected = false; + m_bSuccessfullyConnected = false; curl_easy_cleanup(curl); }); @@ -1109,7 +1109,7 @@ void MasterServerManager::UpdateServerMapAndPlaylist(char* map, char* playlist, void MasterServerManager::UpdateServerPlayerCount(int playerCount) { // dont call this if we don't have a server id - if (!*m_ownServerId) + if (!*m_sOwnServerId) return; std::thread requestThread( @@ -1126,15 +1126,15 @@ void MasterServerManager::UpdateServerPlayerCount(int playerCount) curl, CURLOPT_URL, fmt::format( - "{}/server/update_values?id={}&playerCount={}", Cvar_ns_masterserver_hostname->GetString(), m_ownServerId, playerCount) + "{}/server/update_values?id={}&playerCount={}", Cvar_ns_masterserver_hostname->GetString(), m_sOwnServerId, playerCount) .c_str()); CURLcode result = curl_easy_perform(curl); if (result == CURLcode::CURLE_OK) - m_successfullyConnected = true; + m_bSuccessfullyConnected = true; else - m_successfullyConnected = false; + m_bSuccessfullyConnected = false; curl_easy_cleanup(curl); }); @@ -1145,7 +1145,7 @@ void MasterServerManager::UpdateServerPlayerCount(int playerCount) void MasterServerManager::WritePlayerPersistentData(char* playerId, char* pdata, size_t pdataSize) { // still call this if we don't have a server id, since lobbies that aren't port forwarded need to be able to call it - m_savingPersistentData = true; + m_bSavingPersistentData = true; if (!pdataSize) { spdlog::warn("attempted to write pdata of size 0!"); @@ -1169,7 +1169,7 @@ void MasterServerManager::WritePlayerPersistentData(char* playerId, char* pdata, "{}/accounts/write_persistence?id={}&serverId={}", Cvar_ns_masterserver_hostname->GetString(), strPlayerId, - m_ownServerId) + m_sOwnServerId) .c_str()); curl_easy_setopt(curl, CURLOPT_POST, 1L); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, CurlWriteToStringBufferCallback); @@ -1188,13 +1188,13 @@ void MasterServerManager::WritePlayerPersistentData(char* playerId, char* pdata, CURLcode result = curl_easy_perform(curl); if (result == CURLcode::CURLE_OK) - m_successfullyConnected = true; + m_bSuccessfullyConnected = true; else - m_successfullyConnected = false; + m_bSuccessfullyConnected = false; curl_easy_cleanup(curl); - m_savingPersistentData = false; + m_bSavingPersistentData = false; }); requestThread.detach(); @@ -1203,7 +1203,7 @@ void MasterServerManager::WritePlayerPersistentData(char* playerId, char* pdata, void MasterServerManager::RemoveSelfFromServerList() { // dont call this if we don't have a server id - if (!*m_ownServerId || !Cvar_ns_report_server_to_masterserver->GetBool()) + if (!*m_sOwnServerId || !Cvar_ns_report_server_to_masterserver->GetBool()) return; std::thread requestThread( @@ -1219,15 +1219,15 @@ void MasterServerManager::RemoveSelfFromServerList() curl_easy_setopt( curl, CURLOPT_URL, - fmt::format("{}/server/remove_server?id={}", Cvar_ns_masterserver_hostname->GetString(), m_ownServerId).c_str()); + fmt::format("{}/server/remove_server?id={}", Cvar_ns_masterserver_hostname->GetString(), m_sOwnServerId).c_str()); - *m_ownServerId = 0; + *m_sOwnServerId = 0; CURLcode result = curl_easy_perform(curl); if (result == CURLcode::CURLE_OK) - m_successfullyConnected = true; + m_bSuccessfullyConnected = true; else - m_successfullyConnected = false; + m_bSuccessfullyConnected = false; curl_easy_cleanup(curl); }); @@ -1331,7 +1331,7 @@ void CHostState__State_GameShutdownHook(CHostState* hostState) CHostState__State_GameShutdown(hostState); } -MasterServerManager::MasterServerManager() : m_pendingConnectionInfo {}, m_ownServerId {""}, m_ownClientAuthToken {""} {} +MasterServerManager::MasterServerManager() : m_pendingConnectionInfo {}, m_sOwnServerId {""}, m_sOwnClientAuthToken {""} {} ON_DLL_LOAD_RELIESON("engine.dll", MasterServer, ConCommand, (HMODULE baseAddress) { |