Small fixes (#222)

By creating this pull request, I understand that code that is AI
generated or otherwise automatically generated may be rejected without
further discussion.
I declare that I fully understand all code I pushed into this PR, and
wrote all this code myself and own the rights to this code.
This commit is contained in:
Tixx
2026-01-31 20:47:59 +01:00
committed by GitHub
2 changed files with 3 additions and 2 deletions

View File

@@ -94,6 +94,7 @@ void UDPClientMain(const std::string& IP, int Port) {
inet_pton(AF_INET, IP.c_str(), &ToServer->sin_addr); inet_pton(AF_INET, IP.c_str(), &ToServer->sin_addr);
UDPSock = socket(AF_INET, SOCK_DGRAM, 0); UDPSock = socket(AF_INET, SOCK_DGRAM, 0);
if (!magic.empty()) if (!magic.empty())
for (int i = 0; i < 10; i++)
UDPSend(magic); UDPSend(magic);
GameSend("P" + std::to_string(ClientID)); GameSend("P" + std::to_string(ClientID));
TCPSend("H", TCPSock); TCPSend("H", TCPSock);

View File

@@ -269,7 +269,7 @@ void LegitimacyCheck() {
std::ifstream libraryFolders(libraryFoldersPath); std::ifstream libraryFolders(libraryFoldersPath);
auto root = tyti::vdf::read(libraryFolders); auto root = tyti::vdf::read(libraryFolders);
for (auto folderInfo : root.childs) { for (auto folderInfo : root.childs) {
if (std::filesystem::exists(folderInfo.second->attribs["path"] + "/steamapps/common/BeamNG.drive/integrity.json")){ if ((folderInfo.second->childs["apps"]->attribs).contains("284160") && std::filesystem::exists(folderInfo.second->attribs["path"] + "/steamapps/common/BeamNG.drive/integrity.json")){
GameDir = folderInfo.second->attribs["path"] + "/steamapps/common/BeamNG.drive/"; GameDir = folderInfo.second->attribs["path"] + "/steamapps/common/BeamNG.drive/";
break; break;
} }