for generate_emu_config: new options -de and -cve to generate some disable_xxx files, or enable some convenient features

This commit is contained in:
otavepto 2024-03-31 21:12:50 +02:00 committed by otavepto
parent 93172e642e
commit 07f3c7a2d2
6 changed files with 42 additions and 15 deletions

View File

@ -17,6 +17,11 @@
* separate 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`:
- 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
* 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

View File

@ -1 +1 @@
Rename this to: disable_lan_only.txt to disable LAN only functionality.
Rename this to: disable_lan_only.txt to prevent hooking OS networking APIs and allow all external requests.

View File

@ -1 +1 @@
Rename this to: disable_networking.txt to disable all networking functionality.
Rename this to: disable_networking.txt to disable all networking functionality of the emu.

View File

@ -1 +1 @@
Rename this file to disable_sharing_stats_with_gameserver.txt to prevent sharing stats and achievements with any game server, this also disables the interface ISteamGameServerStats
Rename this file to disable_sharing_stats_with_gameserver.txt to prevent sharing stats and achievements with any game server, this also disables the interface ISteamGameServerStats.

View File

@ -484,26 +484,41 @@ def get_dlc(raw_infos):
print("could not get dlc infos, are there any dlcs ?")
return (set(), set(), set())
EXTRA_FEATURES: list[tuple[str, str]] = [
EXTRA_FEATURES_DISABLE: list[tuple[str, str]] = [
("disable_account_avatar.txt", "disable avatar functionality."),
("disable_networking.txt", "disable all networking functionality."),
("disable_networking.txt", "disable all networking functionality of the emu."),
("disable_overlay.txt", "disable the overlay."),
("disable_source_query.txt", "do not send server details for the server browser. Only works for game servers."),
("disable_sharing_leaderboards.txt", "disable sharing leaderboards scroes with people playing the same game on the same network."),
("disable_sharing_stats_with_gameserver.txt", "prevent sharing stats and achievements with any game server, this also disables the interface ISteamGameServerStats."),
]
EXTRA_FEATURES_CONVENIENT: list[tuple[str, str]] = [
("disable_lan_only.txt", "don't hook OS networking APIs and allow all external requests."),
("disable_overlay_warning_any.txt", "disable all overlay warnings and allow modifying locked settings, if any."),
("download_steamhttp_requests.txt", "try to download all requests made via the Steam HTTP interface locally."),
("new_app_ticket.txt", "generate new app ticket."),
("gc_token.txt", "generate GC inside new App Ticket."),
("share_leaderboards_over_network.txt", "enable sharing Leaderboards scores with people playing the same game on the same network."),
]
def disable_all_extra_features(emu_settings_dir : str) -> None:
for item in EXTRA_FEATURES:
for item in EXTRA_FEATURES_DISABLE:
with open(os.path.join(emu_settings_dir, item[0]), 'wt', encoding='utf-8') as f:
f.write(item[1])
def enable_convenient_extra_features(emu_settings_dir : str) -> None:
for item in EXTRA_FEATURES_CONVENIENT:
with open(os.path.join(emu_settings_dir, item[0]), 'wt', encoding='utf-8') as f:
f.write(item[1])
def help():
exe_name = os.path.basename(sys.argv[0])
print(f"\nUsage: {exe_name} [-shots] [-thumbs] [-vid] [-imgs] [-name] [-cdx] [-aw] [-clean] appid appid appid ... ")
print(f"\nUsage: {exe_name} [Switches] appid appid appid ... ")
print(f" Example: {exe_name} 421050 420 480")
print(f" Example: {exe_name} -shots -thumbs -vid -imgs -name -cdx -aw -clean -nd 421050")
print(f" Example: {exe_name} -shots -thumbs -vid -imgs -name -cdx -aw -clean 421050")
print(f" Example: {exe_name} -shots -thumbs -vid -imgs -name -cdx -aw -clean -de 421050 480")
print(f" Example: {exe_name} -shots -thumbs -vid -imgs -name -cdx -aw -clean -de -cve 421050")
print(f" Example: {exe_name} -shots -thumbs -vid -imgs -name -cdx -aw -clean -cve 421050")
print("\nSwitches:")
print(" -shots: download screenshots for each app if they're available")
print(" -thumbs: download screenshots thumbnails for each app if they're available")
@ -514,7 +529,8 @@ def help():
print(" -aw: generate schemas of all possible languages for Achievement Watcher")
print(" -clean: delete any folder/file with the same name as the output before generating any data")
print(" -anon: login as an anonymous account, these have very limited access and cannot get all app details")
print(" -nd: not making predeterminated disable files")
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")
@ -522,7 +538,8 @@ def main():
USERNAME = ""
PASSWORD = ""
NODISABLE = False
DISABLE_EXTRA = False
CONVENIENT_EXTRA = False
DOWNLOAD_SCREESHOTS = False
DOWNLOAD_THUMBNAILS = False
DOWNLOAD_VIDEOS = False
@ -562,8 +579,10 @@ def main():
CLEANUP_BEFORE_GENERATING = True
elif f'{appid}'.lower() == '-anon':
ANON_LOGIN = True
elif f'{appid}'.lower() == '-nd':
NODISABLE = True
elif f'{appid}'.lower() == '-de':
DISABLE_EXTRA = True
elif f'{appid}'.lower() == '-cve':
CONVENIENT_EXTRA = True
elif f'{appid}'.lower() == '-reldir':
RELATIVE_DIR = True
else:
@ -872,9 +891,12 @@ def main():
logo,
logo_small)
if not NODISABLE:
if DISABLE_EXTRA:
disable_all_extra_features(emu_settings_dir)
if CONVENIENT_EXTRA:
enable_convenient_extra_features(emu_settings_dir)
inventory_data = generate_inventory(client, appid)
if inventory_data is not None:
out_inventory = {}