From f7c7d79e0afe5ad20401598715a9e7ea024049a0 Mon Sep 17 00:00:00 2001
From: otavepto <153766569+otavepto@users.noreply.github.com>
Date: Fri, 7 Jun 2024 19:55:30 +0300
Subject: [PATCH] restore accidentally removed flag for ipv6 for SteamClient020
+ VS warning fix + small refactor
---
dll/base.cpp | 7 ++++---
dll/dll.cpp | 3 ++-
dll/dll/base.h | 3 +++
dll/dll/dll.h | 1 +
dll/local_storage.cpp | 2 +-
5 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/dll/base.cpp b/dll/base.cpp
index c02157e2..69142077 100644
--- a/dll/base.cpp
+++ b/dll/base.cpp
@@ -16,6 +16,8 @@
. */
#include "dll/base.h"
+#include "dll/settings_parser.h"
+
std::recursive_mutex global_mutex{};
// some arbitrary counter/time for reference
@@ -299,6 +301,7 @@ unsigned int file_size_(const std::string &full_path)
return buffer.st_size;
}
+
#ifdef EMU_EXPERIMENTAL_BUILD
#ifdef __WINDOWS__
@@ -591,9 +594,6 @@ HINTERNET WINAPI Mine_WinHttpOpenRequest(
}
-
-#include "dll/settings_parser.h"
-
static bool network_functions_attached = false;
BOOL WINAPI DllMain( HINSTANCE, DWORD dwReason, LPVOID )
{
@@ -659,3 +659,4 @@ void set_whitelist_ips(uint32_t *from, uint32_t *to, unsigned num_ips)
}
#endif
+
diff --git a/dll/dll.cpp b/dll/dll.cpp
index 8195e66b..e6e91d08 100644
--- a/dll/dll.cpp
+++ b/dll/dll.cpp
@@ -241,10 +241,11 @@ static void *create_client_interface(const char *ver)
} else if (strcmp(ver, "SteamClient019") == 0) {
steam_client = static_cast(get_steam_client());
} else if (strcmp(ver, "SteamClient020") == 0) {
+ steamclient_has_ipv6_functions_flag = true;
steam_client = static_cast(get_steam_client());
} else if (strcmp(ver, STEAMCLIENT_INTERFACE_VERSION) == 0) {
- steam_client = static_cast(get_steam_client());
steamclient_has_ipv6_functions_flag = true;
+ steam_client = static_cast(get_steam_client());
} else {
PRINT_DEBUG("requested unknown steamclient version '%s'", ver);
steam_client = static_cast(get_steam_client());
diff --git a/dll/dll/base.h b/dll/dll/base.h
index 1e02d699..b7b388d9 100644
--- a/dll/dll/base.h
+++ b/dll/dll/base.h
@@ -53,9 +53,12 @@ bool file_exists_(const std::string &full_path);
unsigned int file_size_(const std::string &full_path);
void set_whitelist_ips(uint32_t *from, uint32_t *to, unsigned num_ips);
+
+
#ifdef EMU_EXPERIMENTAL_BUILD
bool crack_SteamAPI_RestartAppIfNecessary(uint32 unOwnAppID);
bool crack_SteamAPI_Init();
#endif
+
#endif // BASE_INCLUDE_H
diff --git a/dll/dll/dll.h b/dll/dll/dll.h
index 5d266046..87ed43e3 100644
--- a/dll/dll/dll.h
+++ b/dll/dll/dll.h
@@ -36,4 +36,5 @@ HSteamPipe flat_hsteampipe();
HSteamUser flat_gs_hsteamuser();
HSteamPipe flat_gs_hsteampipe();
+
#endif // __INCLUDED_DLL_H__
diff --git a/dll/local_storage.cpp b/dll/local_storage.cpp
index 49f2a6e5..286eda79 100644
--- a/dll/local_storage.cpp
+++ b/dll/local_storage.cpp
@@ -490,7 +490,7 @@ std::string Local_Storage::get_user_appdata_path()
static std::string replace_with(std::string s, std::string const &old, const char *new_str)
{
- int pos;
+ size_t pos{};
while ((pos = s.find(old)) != std::string::npos)
s.replace(pos, old.length(), new_str);