From a647c6cfddd58a0afc6d3b9812f99882235d4835 Mon Sep 17 00:00:00 2001 From: a Date: Sat, 3 Aug 2024 07:05:51 +0300 Subject: [PATCH] new ini option `steam_game_stats_reports_dir` to define a folder where statistics from ISteamGameStats will be saved --- dll/dll/settings.h | 3 +++ dll/settings_parser.cpp | 15 +++++++++++++++ .../configs.main.EXAMPLE.ini | 4 ++++ 3 files changed, 22 insertions(+) diff --git a/dll/dll/settings.h b/dll/dll/settings.h index d0450bd2..584bafd1 100644 --- a/dll/dll/settings.h +++ b/dll/dll/settings.h @@ -295,6 +295,9 @@ public: // synchronize user stats/achievements with game servers as soon as possible instead of caching them. bool immediate_gameserver_stats = false; + // steam_game_stats + std::string steam_game_stats_reports_dir{}; + //overlay bool disable_overlay = true; int overlay_hook_delay_sec = 0; // "Saints Row (2022)" needs a lot of time to initialize, otherwise detection will fail diff --git a/dll/settings_parser.cpp b/dll/settings_parser.cpp index 772b7c13..c778dd9d 100644 --- a/dll/settings_parser.cpp +++ b/dll/settings_parser.cpp @@ -1345,6 +1345,20 @@ static void parse_overlay_general_config(class Settings *settings_client, class } +// main::general::steam_game_stats_reports_dir +static void parse_steam_game_stats_reports_dir(class Settings *settings_client, class Settings *settings_server) +{ + std::string line(common_helpers::string_strip(ini.GetValue("main::general", "steam_game_stats_reports_dir", ""))); + if (line.size()) { + auto folder = common_helpers::to_absolute(line, get_full_program_path()); + if (folder.size()) { + PRINT_DEBUG("ISteamGameStats reports will be saved to '%s'", folder.c_str()); + settings_client->steam_game_stats_reports_dir = folder; + settings_server->steam_game_stats_reports_dir = folder; + } + } +} + // mainly enable/disable features static void parse_simple_features(class Settings *settings_client, class Settings *settings_server) { @@ -1697,6 +1711,7 @@ uint32 create_localstorage_settings(Settings **settings_client_out, Settings **s parse_overlay_general_config(settings_client, settings_server); load_overlay_appearance(settings_client, settings_server, local_storage); + parse_steam_game_stats_reports_dir(settings_client, settings_server); *settings_client_out = settings_client; *settings_server_out = settings_server; diff --git a/post_build/steam_settings.EXAMPLE/configs.main.EXAMPLE.ini b/post_build/steam_settings.EXAMPLE/configs.main.EXAMPLE.ini index c3a3290b..a053b983 100644 --- a/post_build/steam_settings.EXAMPLE/configs.main.EXAMPLE.ini +++ b/post_build/steam_settings.EXAMPLE/configs.main.EXAMPLE.ini @@ -57,6 +57,10 @@ matchmaking_server_details_via_source_query=0 # this is intended to debug some annoying scenarios, and best used with the debug build of the emu # default= crash_printer_location=./path/relative/to/dll/crashes.txt +# some Source-based games use the interface ISteamGameStats to report some stats +# you can make the emu save this data to a folder +# empty value = don't save anything (default), otherwise the path specified must be writable +steam_game_stats_reports_dir=./path/relative/to/dll/ [main::connectivity] # 1=prevent hooking OS networking APIs and allow any external requests