From 3b3dc98b3a997c2b6344ea2aca2d5d66f665b799 Mon Sep 17 00:00:00 2001 From: Mr_Goldberg Date: Mon, 18 May 2020 11:21:04 -0400 Subject: [PATCH] Add a way to force emu account name, language and steamid in steam_settings folder. --- Readme_release.txt | 3 +++ dll/settings_parser.cpp | 14 ++++++++++++++ .../force_account_name.EXAMPLE.txt | 1 + .../force_language.EXAMPLE.txt | 1 + .../force_steamid.EXAMPLE.txt | 1 + 5 files changed, 20 insertions(+) create mode 100644 files_example/steam_settings.EXAMPLE/force_account_name.EXAMPLE.txt create mode 100644 files_example/steam_settings.EXAMPLE/force_language.EXAMPLE.txt create mode 100644 files_example/steam_settings.EXAMPLE/force_steamid.EXAMPLE.txt diff --git a/Readme_release.txt b/Readme_release.txt index 8fb633b..b4d573d 100644 --- a/Readme_release.txt +++ b/Readme_release.txt @@ -29,6 +29,9 @@ Note that these are global so you won't have to change them for each game. For g If you want to change your steam_id on a per game basis, simply create a settings folder in the game unique directory (Full path: C:\Users\\AppData\Roaming\Goldberg SteamEmu Saves\\settings) In that settings folder create a user_steam_id.txt file that contains the valid steam id that you want to use for that game only. +You can also make the emu ignore certain global settings by using a force_account_name.txt, force_language.txt or force_steamid.txt that you put in the \steam_settings\ folder. +See the steam_settings.EXAMPLE folder for an example. + If for some reason you want it to save in the game directory you can create a file named local_save.txt right beside steam_api(64).dll (libsteam_api.so on linux) The only thing that file should contain is the name of the save directory. This can be useful if you want to use different global settings like a different account name or steam id for a particular game. Note that this save directory will be beside where the emu dll (or .so) is which may not be the same as the game path. diff --git a/dll/settings_parser.cpp b/dll/settings_parser.cpp index a9a864a..38484c2 100644 --- a/dll/settings_parser.cpp +++ b/dll/settings_parser.cpp @@ -276,6 +276,20 @@ uint32 create_localstorage_settings(Settings **settings_client_out, Settings **s disable_networking = true; } else if (p == "disable_overlay.txt") { disable_overlay = true; + } else if (p == "force_language.txt") { + int len = Local_Storage::get_file_data(steam_settings_path + "force_language.txt", language, sizeof(language) - 1); + if (len > 0) language[len] = 0; + } else if (p == "force_steamid.txt") { + char steam_id_text[32] = {}; + if (Local_Storage::get_file_data(steam_settings_path + "force_steamid.txt", steam_id_text, sizeof(steam_id_text) - 1) > 0) { + CSteamID temp_id = CSteamID((uint64)std::atoll(steam_id_text)); + if (temp_id.IsValid()) { + user_id = temp_id; + } + } + } else if (p == "force_account_name.txt") { + int len = Local_Storage::get_file_data(steam_settings_path + "force_account_name.txt", name, sizeof(name) - 1); + if (len > 0) name[len] = 0; } } } diff --git a/files_example/steam_settings.EXAMPLE/force_account_name.EXAMPLE.txt b/files_example/steam_settings.EXAMPLE/force_account_name.EXAMPLE.txt new file mode 100644 index 0000000..62360aa --- /dev/null +++ b/files_example/steam_settings.EXAMPLE/force_account_name.EXAMPLE.txt @@ -0,0 +1 @@ +Mr_Goldberg \ No newline at end of file diff --git a/files_example/steam_settings.EXAMPLE/force_language.EXAMPLE.txt b/files_example/steam_settings.EXAMPLE/force_language.EXAMPLE.txt new file mode 100644 index 0000000..1ebabf7 --- /dev/null +++ b/files_example/steam_settings.EXAMPLE/force_language.EXAMPLE.txt @@ -0,0 +1 @@ +english \ No newline at end of file diff --git a/files_example/steam_settings.EXAMPLE/force_steamid.EXAMPLE.txt b/files_example/steam_settings.EXAMPLE/force_steamid.EXAMPLE.txt new file mode 100644 index 0000000..bbdbc52 --- /dev/null +++ b/files_example/steam_settings.EXAMPLE/force_steamid.EXAMPLE.txt @@ -0,0 +1 @@ +76561197960287930 \ No newline at end of file