Skip to content

Commit

Permalink
Merge branch 'release/webman_classics_maker_2.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Niclas Jacobsson committed Mar 23, 2021
2 parents ec544ec + d563d0a commit 8fdc42f
Show file tree
Hide file tree
Showing 31 changed files with 1,186 additions and 598 deletions.
Binary file modified resources/images/pdn/xmb/XMB_icons.pdn
Binary file not shown.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file modified resources/images/xmb/XMB_icons.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed resources/pkg/PARAM.SFO
Binary file not shown.
Binary file modified resources/pkg/PIC1.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed resources/pkg/USRDIR/EBOOT.BIN
Binary file not shown.
1 change: 0 additions & 1 deletion resources/pkg/USRDIR/launch.txt

This file was deleted.

1 change: 0 additions & 1 deletion resources/pkg/USRDIR/url.txt

This file was deleted.

Binary file removed resources/tools/util_resources/PARAM.SFO_MOD.BAK
Binary file not shown.
16 changes: 8 additions & 8 deletions resources/tools/util_resources/ftp_settings.cfg.BAK
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"ftp_user":"",
"ftp_pasv_mode":false,
"ftp_chunk_size_kb":4000,
"ftp_folder_depth":16,
"ftp_timeout":8,
"ftp_password":"",
"ftp_password":"",
"ps3_lan_ip":"",
"ftp_chunk_size_kb":4000,
"ftp_psp_png_offset_kb":20000,
"webcommand":"[filepath_var]",
"ftp_folder_depth":16,
"ftp_retry_count":10,
"legacy_webcommand":"/wait.ps3?6;/mount_ps3[filepath_var];/wait.ps3?4;/play.ps3"
"use_w_title_id":true,
"ftp_psp_png_offset_kb":20000,
"ftp_password":"",
"legacy_webcommand":"/wait.ps3?6;/mount_ps3[filepath_var];/wait.ps3?5;/play.ps3",
"ftp_retry_count":10,
"webcommand":"[filepath_var]"
}
11 changes: 6 additions & 5 deletions resources/tools/util_resources/game_list_data.json.BAK
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"psx_games":[],
"ps2_games":[],
"ps3_games":[],
"psp_games":[],
"ntfs_games":[]
"PSXISO_games":[],
"PS2ISO_games":[],
"PS3ISO_games":[],
"PSPISO_games":[],
"NTFS_games":[],
"GAMES_games":[]
}
8 changes: 8 additions & 0 deletions resources/tools/util_resources/game_structure.json.BAK
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"title_id": "",
"title": "",
"platform": "",
"filename": "",
"path": "",
"meta_data_link": ""
}
4 changes: 3 additions & 1 deletion resources/tools/util_resources/pkg.json.BAK
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"title":"",
"iso_filepath":"",
"title_id":"",
"filename":"",
"platform":"",
"path":"",
"content_id":""
}
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def zipdir(path, ziph):
if __name__ == '__main__':

# windows release
zip_archive_name = 'webman_classics_maker_v2.0_win.zip'
zip_archive_name = 'webman_classics_maker_v2.2.x_win.zip'
zip_dir_path = BuildPaths.zip_dir
release_dir = BuildPaths.release

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
# pyinstaller.exe --onefile --icon=./resources/image_resources/webman.ico ./resources/tools/util_scripts/build_all_scripts.py
# NOTE: '--noconsole' is optional and seems to give a false positive on my AV

import os, subprocess
import os, subprocess, sys
from shutil import rmtree

import application_path
from global_paths import Image as ImagePaths
from global_paths import App as AppPaths
from global_paths import Build as BuildPaths

if not os.path.exists('build'):
os.makedirs('build')
Expand All @@ -23,7 +24,7 @@
dist_path=AppPaths.application_path
spec_path='build'

hidden_imports = '--hidden-import=' + 'ConfigParser' + ' ' + '--hidden-import=' + 'glob'
hidden_imports = '--hidden-import=' + 'ConfigParser' + ' ' + '--hidden-import=' + 'glob' + ' ' + '--hidden-import=' + 'tqdm'

app = 'pyinstaller.exe'
args = hidden_imports + ' ' + '--distpath=' + dist_path + ' ' + '--specpath=' + spec_path + ' ' + '--name=' + executable_name + ' ' + '--onefile' + ' ' + '--icon=' + os.path.join(icon_path, icon_name) + ' ' + os.path.join(script_folder_path, script_filename)
Expand All @@ -42,6 +43,14 @@
if 'pyc' in str(file):
os.remove(file)

# open builds folder in windows explorer
if 'win' in sys.platform:
# print('DEBUG opening folder: ' + os.path.join(AppPaths.game_work_dir, '..'))
try:
os.startfile(os.path.join(BuildPaths.release))
except:
print('ERROR: Could open the pkg build dir from Windows explorer')

print('\n----------------------------------------------------')
print('Succesfully built \"' + executable_name + '.exe\"')
print('----------------------------------------------------\n\n')
7 changes: 7 additions & 0 deletions resources/tools/util_scripts/build_all_scripts.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import traceback

from write_json_to_param_sfo import Write_param_sfo
from content_id_elf_replace import Elf_replace
from edit_launch_txt import Edit_launch_txt
Expand Down Expand Up @@ -35,10 +37,15 @@ def build(self):
if build_is_ok:
pkg_name = webman_pkg.execute()
except Exception as e:
print('[5/5] Execution of \'webman_pkg.py\': FAILED')
print('-----------------------------------------------------')
print('Could not build pkg and/or return pkg_name!')
if e.message:
print('ERROR: ' + e.message)

if repr(e):
print('DEBUG ERROR traceback: ' + str(traceback.print_exc()))

# clean up .pyc-files
import os
util_scripts = AppPaths.util_scripts
Expand Down
7 changes: 3 additions & 4 deletions resources/tools/util_scripts/content_id_elf_replace.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@ def execute(self):

# load it
with open(os.path.join(AppPaths.util_resources, 'EBOOT.ELF.BAK'), 'rb') as f:
file = f.read()
eboot_elf_file = f.read()

try:
file = file.replace('PKGLAUNCH', str(json_data['title_id']))

eboot_elf_file = eboot_elf_file.replace('PKGLAUNCH', str(json_data['title_id']))
newFile = open(os.path.join(AppPaths.scetool, 'EBOOT.ELF'), 'wb')
newFileByteArray = bytearray(file)
newFileByteArray = bytearray(eboot_elf_file)
newFile.write(newFileByteArray)

print('[2/5] Execution of \'content_id_elf_replace.py\': DONE')
Expand Down
40 changes: 19 additions & 21 deletions resources/tools/util_scripts/edit_launch_txt.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,56 +9,54 @@ def execute(self):
with open(os.path.join(AppPaths.game_work_dir, 'pkg.json')) as f:
json_data = json.load(f)

with open(os.path.join(AppPaths.settings, 'ftp_settings.cfg'), 'r') as settings_file:
json_settings_data = json.load(settings_file)
settings_file.close()
from global_paths import FtpSettings

# init variables
web_command_string = ''
iso_filepath = str(json_data['iso_filepath'])
cfg_webcommand = json_settings_data['webcommand']
path = str(json_data['path'])
full_path = path + str(json_data['filename'])

if '/pspiso/' in iso_filepath.lower():
web_command_string = '/mount_ps3' + iso_filepath + ';/wait.ps3?8;/browser.ps3$focus_segment_index xmb_app3 0;/wait.ps3?1;/browser.ps3$exec_push;/wait.ps3?1;/browser.ps3$focus_index 0 4;/wait.ps3?1;/browser.ps3$exec_push;/wait.ps3?1;/browser.ps3$exec_push;/wait.ps3?1;/browser.ps3$exec_push'
cfg_webcommand = FtpSettings.webcommand

if '/PSPISO/' in path:
web_command_string = '/mount_ps3' + path + ';/wait.ps3?8;/browser.ps3$focus_segment_index xmb_app3 0;/wait.ps3?1;/browser.ps3$exec_push;/wait.ps3?1;/browser.ps3$focus_index 0 4;/wait.ps3?1;/browser.ps3$exec_push;/wait.ps3?1;/browser.ps3$exec_push;/wait.ps3?1;/browser.ps3$exec_push'
elif '/GAMES/' in path or '/GAMEZ/' in path:
split_path = path.split('/')
folder_path = '/'.join(split_path[0:len(split_path) -1])
pre_delay = 'xmb'
post_delay = 4
pre_cmd = '/wait.ps3?' + str(pre_delay) + ';/mount_ps3'
post_cmd = ';/wait.ps3?' + str(post_delay) + ';/play.ps3'
web_command_string = pre_cmd + str(full_path) + post_cmd

# check if the user has added a custom webcommand in the config file
else:
if len(cfg_webcommand) > len('[filepath_var]'):
if '[filepath_var]' in cfg_webcommand:
web_command_string = cfg_webcommand.replace('[filepath_var]', str(json_data['iso_filepath']))
web_command_string = cfg_webcommand.replace('[filepath_var]', str(full_path))
web_command_string = web_command_string.replace('//', '/')
else:
print("""Error: make sure the string [filepath_var] (including brackets) is present in webcommand of settings.cfg""")
print("""Will revert back to the default webcommand""")

# # webman-mod v.47.30 and older
# if web_command_string == '':
# pre_delay = 6
# post_delay = 4
# pre_cmd = '/wait.ps3?' + str(pre_delay) + ';/mount_ps3'
# post_cmd = ';/wait.ps3?' + str(post_delay) + ';/play.ps3'
# web_command_string = pre_cmd + str(json_data['iso_filepath'] + post_cmd)

# legacy command example: /wait.ps3?6;/mount_ps3/dev_hdd0/PS3ISO/game.iso;/wait.ps3?4;/play.ps3

# webman-mod v.47.30 and newer
if web_command_string == '':
pre_delay = 'xmb'
post_delay = 4
pre_cmd = '/wait.ps3?' + str(pre_delay) + ';/mount_ps3'
post_cmd = ';/wait.ps3?' + str(post_delay) + ';/play.ps3'
web_command_string = pre_cmd + str(json_data['iso_filepath'] + post_cmd)
web_command_string = pre_cmd + str(full_path + post_cmd)

web_url_string = 'GET ' + urllib.quote(web_command_string) + ' HTTP/1.0'

if not os.path.exists(os.path.join(AppPaths.game_work_dir, 'pkg', 'USRDIR')):
os.makedirs(os.path.join(AppPaths.game_work_dir, 'pkg', 'USRDIR'))

launch_txt = open(os.path.join(AppPaths.pkg, 'USRDIR', 'launch.txt'), 'wb')
launch_txt = open(os.path.join(AppPaths.game_work_dir, 'pkg', 'USRDIR', 'launch.txt'), 'wb')
launch_txt_byteArray = bytearray(web_command_string, 'utf8') + os.linesep
launch_txt.write(launch_txt_byteArray)

url_txt = open(os.path.join(AppPaths.pkg, 'USRDIR', 'url.txt'), 'wb')
url_txt = open(os.path.join(AppPaths.game_work_dir, 'pkg', 'USRDIR', 'url.txt'), 'wb')
url_txt_byteArray = bytearray(web_url_string) + os.linesep
url_txt.write(url_txt_byteArray)

Expand Down
Loading

0 comments on commit 8fdc42f

Please sign in to comment.