remove invalid flag

This commit is contained in:
Lion Kortlepel
2024-10-13 23:42:07 +02:00
committed by Tixx
parent fd398ed5ab
commit 7d00d489e4
16 changed files with 16 additions and 2633 deletions

View File

@@ -58,12 +58,11 @@ std::filesystem::path GetGamePath() {
if (ini.contains("filesystem") && std::get<std::map<std::string, std::string>>(ini["filesystem"]).contains("UserPath"))
userPath = Utils::ToWString(std::get<std::map<std::string, std::string>>(ini["filesystem"])["UserPath"]);
if (!userPath.empty() && Path.empty())
if (userPath = Utils::ExpandEnvVars(userPath); std::filesystem::exists(userPath)) {
Path = userPath;
debug(L"Using custom user folder path from startup.ini: " + Path.wstring());
} else
warn(L"Found custom user folder path (" + userPath + L") in startup.ini but it doesn't exist, skipping");
if (userPath = Utils::ExpandEnvVars(userPath); std::filesystem::exists(userPath)) {
Path = userPath;
debug(L"Using custom user folder path from startup.ini: " + Path.wstring());
} else
warn(L"Found custom user folder path (" + userPath + L") in startup.ini but it doesn't exist, skipping");
}
if (Path.empty()) {
@@ -95,12 +94,11 @@ std::filesystem::path GetGamePath() {
}
if (!userPath.empty() && Path.empty())
if (userPath = std::filesystem::path(Utils::ExpandEnvVars(userPath)); std::filesystem::exists(userPath)) {
Path = userPath;
debug(L"Using custom user folder path from BeamNG.Drive.ini: " + Path.wstring());
} else
warn(L"Found custom user folder path (" + userPath + L") in BeamNG.Drive.ini but it doesn't exist, skipping");
if (userPath = std::filesystem::path(Utils::ExpandEnvVars(userPath)); std::filesystem::exists(userPath)) {
Path = userPath;
debug(L"Using custom user folder path from BeamNG.Drive.ini: " + Path.wstring());
} else
warn(L"Found custom user folder path (" + userPath + L") in BeamNG.Drive.ini but it doesn't exist, skipping");
}
}

View File

@@ -190,7 +190,7 @@ void CoreSend(std::string data) {
if (CoreSocket != -1) {
auto ToSend = Utils::PrependHeader(data);
int res = send(CoreSocket, ToSend.data(), ToSend.size(), MSG_WAITALL);
int res = send(CoreSocket, ToSend.data(), ToSend.size(), 0);
if (res < 0) {
debug("(Core) send failed with error: " + std::to_string(WSAGetLastError()));
}
@@ -352,7 +352,7 @@ void Parse(std::string Data, SOCKET CSocket) {
}
if (!Data.empty() && CSocket != -1) {
auto ToSend = Utils::PrependHeader(Data);
int res = send(CSocket, ToSend.data(), ToSend.size(), MSG_WAITALL);
int res = send(CSocket, ToSend.data(), ToSend.size(), 0);
if (res < 0) {
debug("(Core) send failed with error: " + std::to_string(WSAGetLastError()));
}

View File

@@ -65,7 +65,7 @@ void GameSend(std::string_view Data) {
static std::mutex Lock;
std::scoped_lock Guard(Lock);
auto ToSend = Utils::PrependHeader<std::string_view>(Data);
auto Result = send(CSocket, ToSend.data(), ToSend.size(), MSG_WAITALL);
auto Result = send(CSocket, ToSend.data(), ToSend.size(), 0);
if (Result < 0) {
error("(Game) send failed with error: " + std::to_string(WSAGetLastError()));
}