Skip to content

Commit

Permalink
webMAN MOD 1.47.46f
Browse files Browse the repository at this point in the history
♻️ Replaced reload XMB with the user logout method by @LuanTeles
If there is only one user, RELOADXMB is be used

wait & multi-pad commands are supported by a single call to /pad.ps3. For wait use: |<seconds>|
  • Loading branch information
aldostools committed Jun 19, 2024
1 parent 681a6fd commit b610669
Show file tree
Hide file tree
Showing 14 changed files with 130 additions and 34 deletions.
22 changes: 22 additions & 0 deletions _Projects_/ps3netsrv/bins/Windows/PS3_NET_Server.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[Settings]
whitelist=
path0="d:\"
port0="38008"
path1=""
port1="38009"
path2=""
port2="38010"
path3=""
port3="38011"
path4=""
port4="38012"
path5=""
port5="38013"
path6=""
port6="38014"
path7=""
port7="38015"
path8=""
port8="38016"
path9=""
port9="38017"
Binary file modified _Projects_/updater/pkgfiles/USRDIR/webftp_server_full.sprx
Binary file not shown.
Binary file modified _Projects_/updater/pkgfiles/USRDIR/webftp_server_noncobra.sprx
Binary file not shown.
Binary file not shown.
Binary file modified _Projects_/updater/update/dev_hdd0/plugins/webftp_server.sprx
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion include/cmd/refresh.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

refresh_xml(templn); show_scan_progress = false;

if(strstr(params, "xmb")) reload_xmb();
if(strstr(params, "xmb")) reload_xmb(0);

#ifndef ENGLISH_ONLY
char *STR_XMLRF = (char *)templn;
Expand Down
7 changes: 1 addition & 6 deletions include/cmd/refresh_ps3.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@
{
refresh_xml(param);

if(IS_ON_XMB && is_app_dir(_HDD0_GAME_DIR, "RELOADXMB") && is_app_home_onxmb())
{
reload_xmb();
sys_ppu_thread_sleep(3);
if(IS_ON_XMB) launch_app_home_icon(true);
}
reload_xmb(0);

#ifdef WM_REQUEST
if(!wm_request)
Expand Down
2 changes: 1 addition & 1 deletion include/cmd/reloadxmb.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
if(islike(param, "/reloadxmb.ps3") && refreshing_xml == 0)
{
reload_xmb();
reload_xmb(param[14]);
sprintf(param, "/index.ps3");
}
28 changes: 26 additions & 2 deletions include/feat/vpad.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ static s32 unregister_ldd_controller(void)
}

static void press_cancel_button(bool do_enter);
static void press_accept_button(void);

static u8 parse_pad_command(const char *param, u8 is_combo)
static u8 parse_pad_command(const char *pad_cmds, u8 is_combo)
{
register_ldd_controller();

Expand All @@ -94,10 +95,22 @@ static u8 parse_pad_command(const char *param, u8 is_combo)
data.button[CELL_PAD_BTN_OFFSET_SENSOR_Z] = // 0x0200;
data.button[CELL_PAD_BTN_OFFSET_SENSOR_G] = 0x0200;

char *sep, *param; param = (char*)pad_cmds;

if(IS(param, "off")) unregister_ldd_controller(); else
{
u32 delay = 70000;

parse_buttons:
sep = strchr(param, '|'); if(sep) *sep = '\0';

if(sep && BETWEEN('0', *param, '9'))
{
sys_ppu_thread_sleep(val(param));
param = sep + 1;
goto parse_buttons;
}

// press button
if(strcasestr(param, "psbtn") ) {data.button[0] |= CELL_PAD_CTRL_LDD_PS;}

Expand Down Expand Up @@ -176,8 +189,14 @@ static u8 parse_pad_command(const char *param, u8 is_combo)
cellPadLddDataInsert(vpad_handle, &data);
}

if(strcasestr(param, "accept") ) press_cancel_button(1);
if(strcasestr(param, "accept") ) press_accept_button();
if(strcasestr(param, "cancel") ) press_cancel_button(0);

if(sep)
{
param = sep + 1;
goto parse_buttons;
}
}

return CELL_OK;
Expand All @@ -198,6 +217,11 @@ static void press_cancel_button(bool do_enter)
unregister_ldd_controller();
}

static void press_accept_button(void)
{
press_cancel_button(1);
}

#endif // #ifdef VIRTUAL_PAD

static CellPadData pad_data;
Expand Down
95 changes: 73 additions & 22 deletions include/init/vsh.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Explore_Plugin Commands: https://www.psdevwiki.com/ps3/Explore_plugin

#define EXPLORE_CLOSE_ALL 3

static void * getNIDfunc(const char * vsh_module, u32 fnid, s32 offset)
Expand Down Expand Up @@ -340,7 +342,7 @@ static void start_xmb_player(const char* column)
if(wait_for_abort(2)) return;
parse_pad_command("triangle", 0);
if(wait_for_abort(2)) return;
parse_pad_command("cross", 0);
press_accept_button();
if(wait_for_abort(2)) return;
parse_pad_command("psbtn", 0);
sys_ppu_thread_sleep(1);
Expand All @@ -349,45 +351,94 @@ static void start_xmb_player(const char* column)
}
#endif

#ifdef COBRA_ONLY
static void reload_xmb(void)
static void reload_by_logoff(void)
{
if(!cobra_version) return;
if(IS_ON_XMB)
// /xmb.ps3$focus_category%20user;/pad.ps3?cross|1|cross|5|cross
exec_xmb_command("close_all_list");
exec_xmb_command2("focus_category %s", "user");
press_accept_button();
sys_ppu_thread_usleep(1);
press_accept_button();
sys_ppu_thread_sleep(2);
exec_xmb_command("exec_push");
sys_ppu_thread_sleep(6);
exec_xmb_command2("focus_category %s", "game");
exec_xmb_command2("focus_segment_index %s", "xmb_app3");
}

static int count_items(const char *path)
{
int fd; u32 count = 0;
if(cellFsOpendir(path, &fd) == CELL_FS_SUCCEEDED)
{
mount_unk = EMU_OFF;
if(is_app_dir(_HDD0_GAME_DIR, "RELOADXMB") && is_app_home_onxmb())
CellFsDirectoryEntry entry; size_t read_e;

while(working)
{
set_app_home(RELOADXMB_DIR);
mount_unk = APP_GAME;
if(cellFsGetDirectoryEntries(fd, &entry, sizeof(entry), &read_e) || !read_e) break;
if(entry.entry_name.d_name[0] != '.') ++count;
}
else if(file_exists(RELOADXMB_ISO))
cellFsClosedir(fd);
}
return count;
}

#ifdef COBRA_ONLY
static void reload_xmb(u8 use_app)
{
if(IS_ON_XMB)
{
if(!use_app && count_items(HDD0_HOME_DIR) <= 1) use_app = true;

if(!use_app || !cobra_version)
{
mount_unk = mount_game(RELOADXMB_ISO, 0); // MOUNT_SILENT
reload_by_logoff();
}
if(mount_unk)
else
{
patch_gameboot(0); // None
launch_disc(true);
mount_unk = EMU_OFF;
if(is_app_dir(_HDD0_GAME_DIR, "RELOADXMB") && is_app_home_onxmb())
{
set_app_home(RELOADXMB_DIR);
mount_unk = APP_GAME;
}
else if(file_exists(RELOADXMB_ISO))
{
mount_unk = mount_game(RELOADXMB_ISO, 0); // MOUNT_SILENT
}
if(mount_unk)
{
patch_gameboot(0); // None
launch_disc(true);
mount_unk = EMU_OFF;
}
}
}
}
#else
static void reload_xmb(void)
static void reload_xmb(u8 use_app)
{
// hold L2 to cancel reload xmb
if(is_pressed(CELL_PAD_CTRL_L2)) return; // hold L2 to cancel reload xmb

if(IS_ON_XMB && is_app_dir(_HDD0_GAME_DIR, "RELOADXMB"))
if(IS_ON_XMB)
{
if(!get_explore_interface()) return;
if(!use_app && count_items(HDD0_HOME_DIR) <= 1) use_app = true;

exec_xmb_command("close_all_list");
exec_xmb_command2("focus_category %s", "network");
exec_xmb_command2("focus_segment_index %s", "-1");
if(wait_for_abort(1)) return;
explore_exec_push(0, false);
if(!use_app)
{
reload_by_logoff();
}
else if(is_app_dir(_HDD0_GAME_DIR, "RELOADXMB"))
{
if(!get_explore_interface()) return;

exec_xmb_command("close_all_list");
exec_xmb_command2("focus_category %s", "network");
exec_xmb_command2("focus_segment_index %s", "-1");
if(wait_for_abort(1)) return;
explore_exec_push(0, false);
}
}
}
#endif
4 changes: 4 additions & 0 deletions include/mount/netclient.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,11 @@ static bool is_netsrv_enabled(u8 server_id)

if(netiso_svrid == server_id) return true;

#ifdef NET3NET4
if(server_id > 4) return false;
#else
if(server_id > 2) return false;
#endif

s32 net_enabled = 0;
xnet()->GetSettingNet_enable(&net_enabled);
Expand Down
2 changes: 1 addition & 1 deletion include/poll/combos.h
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@
if(pad_data.button[CELL_PAD_BTN_OFFSET_DIGITAL2] == (CELL_PAD_CTRL_R1 | CELL_PAD_CTRL_L1)) n = 11;

refresh_xml(msg);
if(n > 10) reload_xmb();
if(n > 10) reload_xmb(0);
}
#ifdef VIDEO_REC
else
Expand Down
2 changes: 1 addition & 1 deletion main.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ SYS_MODULE_STOP(wwwd_stop);
SYS_MODULE_EXIT(wwwd_stop);

#define WM_APPNAME "webMAN"
#define WM_VERSION "1.47.46e MOD"
#define WM_VERSION "1.47.46f MOD"
#define WM_APP_VERSION WM_APPNAME " " WM_VERSION
#define WEBMAN_MOD WM_APPNAME " MOD"

Expand Down

0 comments on commit b610669

Please sign in to comment.