forked from nexgen999/gbe_fork
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed generate_emu_config login, thanks to Sak32009
replaced 'client_id' error with simple 'wrong username and / or password' message, asking for correct username and / or password added pcgw_page script to download PCGamingWiki page (source code only), not yet enabled in main script generate steam_emu.ini for CODEX and RUNE versions
- Loading branch information
Showing
16 changed files
with
543 additions
and
156 deletions.
There are no files selected for viewing
Binary file modified
BIN
+194 Bytes
(100%)
tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/au3/scripts/generate_interfaces.a3x
Binary file not shown.
189 changes: 100 additions & 89 deletions
189
tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/au3/scripts/generate_interfaces.au3
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
tools/generate_emu_config/bat/generate_emu_config.py_run_anon.bat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
@echo off | ||
set /p arg="Generate Emu Config for Steam AppId: " | ||
python -W ignore::DeprecationWarning generate_emu_config.py -img -scr -vids_low -vids_max -scx -cdx -acw -clr -anon %arg% | ||
python -W ignore::DeprecationWarning generate_emu_config.py -img -scr -vids_low -vids_max -scx -cdx -rne -acw -clr -anon %arg% |
2 changes: 1 addition & 1 deletion
2
tools/generate_emu_config/bat/generate_emu_config.py_run_test.bat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
@echo off | ||
set /p arg="Generate Emu Config for Steam AppId: " | ||
python -W ignore::DeprecationWarning generate_emu_config.py -img -scr -vids_low -vids_max -scx -cdx -acw -clr %arg% | ||
python -W ignore::DeprecationWarning generate_emu_config.py -img -scr -vids_low -vids_max -scx -cdx -rne -acw -clr %arg% |
2 changes: 1 addition & 1 deletion
2
tools/generate_emu_config/bat/generate_emu_config.py_run_user.bat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
@echo off | ||
set /p arg="Generate Emu Config for Steam AppId: " | ||
python -W ignore::DeprecationWarning generate_emu_config.py -cdx -acw -clr %arg% | ||
python -W ignore::DeprecationWarning generate_emu_config.py -cdx -rne -acw -clr %arg% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
tools/generate_emu_config/external_components/pcgw_page.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import os | ||
import urllib.request | ||
|
||
# download PCGamingWiki page source code only | ||
# to be parsed for additional game info, e.g. config and saved games files locations, extended developer and publisher info, etc | ||
# not yet implemented in main script | ||
def download_pcgw(base_out_dir : str, appid : int): | ||
|
||
pcgw_link = f"https://www.pcgamingwiki.com/api/appid.php?appid={appid}" | ||
|
||
if not os.path.exists(os.path.join(base_out_dir, 'steam_misc\\app_info')): | ||
os.makedirs(os.path.join(base_out_dir, 'steam_misc\\app_info')) | ||
|
||
with urllib.request.urlopen(pcgw_link) as f: | ||
html = f.read().decode('utf-8') | ||
|
||
file = os.path.join(base_out_dir, f"steam_misc\\app_info\\pcgw.tmp") | ||
with open(file, 'w', encoding='utf-8') as f: | ||
f.write(html) | ||
|
||
if os.path.isfile(os.path.join(base_out_dir, 'steam_misc\\app_info\\pcgw.tmp')): | ||
with open(os.path.join(base_out_dir, 'steam_misc\\app_info\\pcgw.tmp'), 'r', encoding='utf-8') as app_pcgw: | ||
app_pcgw_line = app_pcgw.readlines() |
172 changes: 172 additions & 0 deletions
172
tools/generate_emu_config/external_components/rne_gen.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,172 @@ | ||
import os | ||
from steam_id_converter.SteamID import ( | ||
SteamID | ||
) | ||
|
||
__rune_ini = r'''### | ||
### \ / | ||
### _ _ _ _ \\__// | ||
### ____ ._/______:_//\//_/____ _ //___ ./_ __//_____:_\\// | ||
### :\ //_/ _ . /_/ / /_/__:_//_/ /\ /\__/_ _ . /\\\ | ||
### \\/// ____/___./ / / / / / / \X_/ //___/ /_\_ | ||
### . \/// _______ _/_ /_/ _/_/ \\/ // /_\_\ /. | ||
### z_/ _/\ _/ // / // / \ /// __// :\// | ||
### | / _ / /\// /__// __//_ _ /\ /X/ /__/ |/\/2 | ||
### --+-_=\__/ / / / \_____:__/ //\____// /\ /\/__:_______=_-+--\4 | ||
### |-\__\- / /________\____.__\/- -\--/_\/_______\--.\________\|___\ | ||
### = dS!\/- -\_______\ =-RUNE- -== \/ ==-\______\-= ======== --\__\ | ||
### | ||
### | ||
### Game data is stored at %SystemDrive%\Users\Public\Documents\Steam\RUNE\{rne_id} | ||
### | ||
[Settings] | ||
### | ||
### Game identifier (http://store.steampowered.com/app/{rne_id}) | ||
### | ||
AppId={rne_id} | ||
### | ||
### Steam Account ID, set it to 0 to get a random Account ID | ||
### | ||
AccountId={rne_accountid} | ||
### | ||
### Name of the current player | ||
### | ||
UserName={rne_username} | ||
### | ||
### Language that will be used in the game | ||
### | ||
Language={rne_language} | ||
### | ||
### Enable lobby mode | ||
### | ||
LobbyEnabled=1 | ||
### | ||
### Lobby port to listen on | ||
### | ||
#LobbyPort=31183 | ||
### | ||
### Enable/Disable Steam overlay | ||
### | ||
Overlays=1 | ||
### | ||
### Set Steam connection to offline mode | ||
### | ||
Offline=0 | ||
### | ||
BlockConnection=0 | ||
### | ||
[Interfaces] | ||
### | ||
### Steam Client API interface versions | ||
### | ||
SteamAppDisableUpdate= | ||
SteamAppList= | ||
SteamApps= | ||
SteamAppTicket= | ||
SteamClient= | ||
SteamController= | ||
SteamFriends= | ||
SteamGameCoordinator= | ||
SteamGameServerStats= | ||
SteamGameServer= | ||
SteamGameStats= | ||
SteamHTMLSurface= | ||
SteamHTTP= | ||
SteamInput= | ||
SteamInventory= | ||
SteamMasterServerUpdater= | ||
SteamMatchGameSearch= | ||
SteamMatchMakingServers= | ||
SteamMatchMaking= | ||
SteamMusic= | ||
SteamMusicRemote= | ||
SteamNetworkingMessages= | ||
SteamNetworkingSocketsSerialized= | ||
SteamNetworkingSockets= | ||
SteamNetworkingUtils= | ||
SteamNetworking= | ||
SteamParentalSettings= | ||
SteamParties= | ||
SteamRemotePlay= | ||
SteamRemoteStorage= | ||
SteamScreenshots= | ||
SteamTimeline= | ||
SteamTV= | ||
SteamUGC= | ||
SteamUnifiedMessages= | ||
SteamUserStats= | ||
SteamUser= | ||
SteamUtils= | ||
SteamVideo= | ||
### | ||
[DLC] | ||
### | ||
### Automatically unlock all DLCs | ||
### | ||
DLCUnlockall=0 | ||
### | ||
### Identifiers for DLCs | ||
### | ||
#ID=Name | ||
{rne_dlc_list} | ||
### | ||
[Crack] | ||
7f508eddb6d6c0b1=3681a9beddbae875 | ||
''' | ||
|
||
def generate_rne_ini( | ||
base_out_dir : str, | ||
appid: int, | ||
accountid: int, | ||
username: str, | ||
language: str, | ||
dlc: list[tuple[int, str]], | ||
achs: list[dict]) -> None: | ||
|
||
if not os.path.exists(os.path.join(base_out_dir, "steam_misc\\extra_crk\\RUNE")): | ||
os.makedirs(os.path.join(base_out_dir, "steam_misc\\extra_crk\\RUNE")) | ||
|
||
rune_ini_path = os.path.join(base_out_dir, "steam_misc\\extra_crk\\RUNE\\steam_emu.ini") | ||
print(f"[ ] Generating RUNE config --- writing 'steam_emu.ini'") | ||
print(f"[ ] __ if to be used, make sure it has the correct interface versions") | ||
|
||
dlc_list = [f"{d[0]}={d[1]}" for d in dlc] | ||
achs_list = [] | ||
for ach in achs: | ||
icon = ach.get("icon", None) | ||
if icon: | ||
icon = f"steam_settings\\img\\{icon}" | ||
else: | ||
icon = 'steam_settings\\img\\steam_default_icon_unlocked.jpg' | ||
|
||
icon_gray = ach.get("icon_gray", None) | ||
if icon_gray: | ||
icon_gray = f"steam_settings\\img\\{icon_gray}" | ||
else: | ||
icon_gray = 'steam_settings\\img\\steam_default_icon_locked.jpg' | ||
|
||
icongray = ach.get("icongray", None) | ||
if icongray: | ||
icon_gray = f"steam_settings\\img\\{icongray}" | ||
|
||
achs_list.append(f'{ach["name"]} Achieved={icon}') # unlocked | ||
achs_list.append(f'{ach["name"]} Unachieved={icon_gray}') # locked | ||
|
||
steam_id = SteamID(accountid) | ||
|
||
formatted_ini = __rune_ini.format( | ||
rne_id = appid, | ||
rne_username = username, | ||
rne_accountid = steam_id.get_steam32_id(), | ||
rne_language = language, | ||
rne_dlc_list = "\n".join(dlc_list), | ||
rne_ach_list = "\n".join(achs_list) | ||
) | ||
|
||
with open(rune_ini_path, "wt", encoding='utf-8') as f: | ||
f.writelines(formatted_ini) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.