for gen_emu_config: allow specifying the username and password via env vars GSE_CFG_USERNAME and GSE_CFG_PASSWORD

This commit is contained in:
otavepto 2024-04-02 03:38:51 +02:00
parent 3cedf8dbe3
commit 6c99b29d24
3 changed files with 60 additions and 20 deletions

View File

@ -5,34 +5,36 @@
- if the script was ran without root, and `-packages_skip` wasn't specified,
the script will attempt to detect and use the built-in tool `sudo` if it was available
* **[Detanup01]** Added Steamwork SDK version 159
* **[detiam]** added schinese and tchinese translations to the overlay strings
* share leaderboards scores with connected players, adjust players ranks locally, and sort entries as needed by the game, suggested by **[M4RCK5]**
this will only work when people connected on the same network are playing the same game, once they disconnect their leaderboard entry will be lost (no data persistence for other players), also doesn't work well with VPN clients.
* **[detiam]** added schinese and tchinese translations to the overlay
* allow sharing leaderboards scores with connected players, adjust players ranks locally, and sort entries as needed by the game, suggested by **[M4RCK5]**
this will only work when people connected on the same network are playing the same game, once they disconnect their leaderboard entry will be lost (no data persistence for other players), also it doesn't work well with VPN clients.
this behavior could be enabled via `share_leaderboards_over_network.txt`
* implemented the missing interface `ISteamGameServerStats`, allowing game servers to exchange user stats & achievements with players
could be disabled via `disable_sharing_stats_with_gameserver.txt`,
you can also create `immediate_gameserver_stats.txt` to sync data immediately but **not recommended**
you can also create `immediate_gameserver_stats.txt` to sync data immediately, but **not recommended**
* for windows: updated stub drm patterns and added a workaround for older variants,
this increases the compatibility, but makes it easier to be detected
* new stub/mock dll `GameOverlayRenderer` for the experiemntal steamclient setup,
* for windows: new stub/mock dll `GameOverlayRenderer(64).dll` for the experiemntal cold client setup,
some apps verify the existence of this dll, either on disk, or inside their memory space.
**not recommended** to ignore it
* separate the config file `disable_leaderboards_create_unknown.txt`, previously it was tied to `leaderboards.txt`,
* separated the config file `disable_leaderboards_create_unknown.txt`, previously it was tied to `leaderboards.txt`,
by default the emu will create any unknown leaderboards, you can disable this behavior with this file
**not recommended** to disable this behavior
* for the tool `generate_emu_confog`:
* for the tool `generate_emu_config`:
- don't generate `disable_xxx` config files by default
- new option `-de`: generate config files inside `steam_settings` folder to disable some extra features of the emu
note that this option deprecates the option `-nd`
- new option `-cve`: generate config files inside `steam_settings` folder to enable some convenient extra features of the emu
- allow specifying the username and password via the environment variables `GSE_CFG_USERNAME` and `GSE_CFG_PASSWORD`,
this will override the data specified in `my_login.txt`
* properly implement `Steam_User_Stats::ResetAllStats()`
* added missing example file `disable_lobby_creation.txt` in `steam_settings` folder + updated release `README`
* set the minimum game server latency/ping to 2ms
* added new function `rmCallbacks()` for the networking, to be able to cleanup callbacks on object destruction
* for windows build script: prevent permissive language extensions via the compiler flag `/permissive-`
* missing `delete` for ugc_bridge + reset pointers on client objects destruction
* allow overlay invitations to obscure game input to be able to accept/reject the request
* fixed a problem in the overlay where players connected on the same network might be missed during startup, resulting in an empty friend list
* fixed a problem in the overlay where players connected on the same network might be ignored during startup, resulting in an empty friend list
* set the minimum game server latency/ping to `2ms`
* added new function `rmCallbacks()` for the networking, to be able to cleanup callbacks on object destruction
* missing `delete` (cleanup) for `ugc_bridge` instance + reset pointers on client objects destruction
* for windows build script: prevent permissive language extensions via the compiler flag `/permissive-`
---

View File

@ -17,17 +17,37 @@ To get all available options, run the tool without any arguments.
---
### Login:
You'll be asked each time to enter your username and password.
You can also place a file called `my_login.txt` beside this tool with the following data:
* Your **username** on the **first** line
* Your **password** on the **second** line
You'll be asked each time to enter your username and password, but you can automate this prompt.
* You can create a file called `my_login.txt` beside this tool with the following data:
- Your **username** on the **first** line
- Your **password** on the **second** line
**But beware though of accidentally distributing your login data when using this file**.
---
* You can define these environment variables, note that these environment variables will override the file `my_login.txt`:
- `GSE_CFG_USERNAME`
- `GSE_CFG_PASSWORD`
When defining these environment variables in a script, take care of special characters.
Example for Windows:
```shell
set GSE_CFG_USERNAME=my_username
set GSE_CFG_PASSWORD=123 abc
generate_emu_config.exe 480
```
Example for Linux:
```shell
export GSE_CFG_USERNAME=my_username
export GSE_CFG_PASSWORD=123 abc
./generate_emu_config 480
```
---
### Account ID:
### Downloading data for new apps/games and defining extra account IDs:
The script uses public Steam IDs (in Steam64 format) of apps/games owners in order to query the required info, such as achievement data.
By default, it has a built-in list of public users IDs, and you can extend this list by creating a file called `top_owners_ids.txt` beside the script, then add each new ID in Steam64 format on a separate line.

View File

@ -532,7 +532,15 @@ def help():
print(" -de: disable some extra features by generating the corresponding config files in steam_settings folder")
print(" -cve: enable some convenient extra features by generating the corresponding config files in steam_settings folder")
print(" -reldir: generate temp files/folders, and expect input files, relative to the current working directory")
print("\nAll switches are optional except app id, at least 1 app id must be provided\n")
print("\nAll switches are optional except app id, at least 1 app id must be provided")
print("\nAutomate the login prompt:")
print(" * You can create a file called 'my_login.txt' beside the script, then add your username on the first line")
print(" and your password on the second line.")
print(" * You can set these 2 environment variables (will override 'my_login.txt'):")
print(" GSE_CFG_USERNAME")
print(" GSE_CFG_PASSWORD")
print("")
def main():
USERNAME = ""
@ -601,6 +609,7 @@ def main():
os.makedirs(login_tmp_folder)
client.set_credential_location(login_tmp_folder)
# first read the 'my_login.txt' file
my_login_file = os.path.join(get_exe_dir(RELATIVE_DIR), "my_login.txt")
if not ANON_LOGIN and os.path.isfile(my_login_file):
filedata = ['']
@ -612,6 +621,15 @@ def main():
USERNAME = filedata[0]
PASSWORD = filedata[1]
# then allow the env vars to override the login details
env_username = os.environ.get('GSE_CFG_USERNAME', None)
env_password = os.environ.get('GSE_CFG_PASSWORD', None)
if env_username:
USERNAME = env_username
if env_password:
PASSWORD = env_password
if ANON_LOGIN:
result = client.anonymous_login()
trials = 5