dhleong / ps4-waker

Wake your PS4 over LAN (with help from the Playstation App)
MIT License
451 stars 40 forks source link

Force closing a running application #138

Closed thedmmatt closed 3 years ago

thedmmatt commented 4 years ago

Is there a way to force close a running game? I am using the ps4-waker tool to command my assistant to turn on my console, login on my profile, and open a specific game for me. Everything runs great if there is no games running or the PS4 is off. However, if I use it to change the game that the console is running, the module just freezes, although I could hit X on the controller. Is that a way to force the current application to close? Or to unfreeze the "start" verb and send a remote instruction to press Enter? Really loving the tool :)

dhleong commented 4 years ago

Glad you're enjoying it!

I'm not aware of any such functionality, but if it's possible from the official app it may be.

Are you running the CLI or interfacing directly with the NodeJS Device API? If the latter, it may be possible to detect that a game is running by using getDeviceStatus() and then send the PS button to leave it, if so (before then sending start()).

thedmmatt commented 4 years ago

Hi dhleong, thank your for your prompt response.

Your code has been a great addition to my IoT workbench -- so thanks a lot again.

I'm mainly using the CLI option, but I came up with a lazy solution that works fine for now. I just commented out the line 377 of device.js, so the startTitle() function does not report the error. So I just tell ps4-waker to start a title and then send a 'remote enter' to close anything stopping that title.

stale[bot] commented 3 years ago

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

dhleong commented 3 years ago

I decided to go ahead and update the start command to automatically quit any conflicting, running app before trying to start the requested one. Should be available now in 1.10.0

dhleong commented 3 years ago

I just released 1.10.1 that further improves this logic; if another game is running and the "do you want to quit?" confirmation shows up, we'll try to automatically agree. This behavior is also now accessible through the Device.startTitle API method, and not just the CLI.

thedmmatt commented 3 years ago

Great to hear that, buddy. Thank you so much for the effort here!

I just released 1.10.1 that further improves this logic; if another game is running and the "do you want to quit?" confirmation shows up, we'll try to automatically agree. This behavior is also now accessible through the Device.startTitle API method, and not just the CLI.

thedmmatt commented 3 years ago

Wonderful! Just update all my spcrits, and now I can turn it on right in a game on my way home.

dhleong commented 3 years ago

Glad to hear :)

On Mon, Sep 7, 2020 at 4:46 PM Mateus Dutra notifications@github.com wrote:

Wonderful! Just update all my spcrits, and now I can turn it on right in a game on my way home.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/dhleong/ps4-waker/issues/138#issuecomment-688505889, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGHIFTZSO2KN6R5IMTU5FTSEVBDPANCNFSM4N2ATCQA .