Nonary / PlayNiteWatcher

Configure Steam/PlayNite Games to launch and terminate with Sunshine as well as automatically end streams when a game closes.
88 stars 2 forks source link

Continues Streaming after Diablo IV exit (battle.net game) exists #14

Closed jdkang closed 1 month ago

jdkang commented 1 month ago

Not sure if this is a bug or something unavoidable since I believe it's impossible to run Diablo IV not as a child process of the battle.net client?

Sunshine Version: v2024.914.221909 OS Version: Windows 11 Home 23H2

  1. The wrapper script appears to be installed correctly in Sunshine and working.
  2. Log seems to indicate it is detecting the exit from the game process okay:
    **********************
    Windows PowerShell transcript start
    Start time: 20240917100235
    Username: coloso\Jai
    RunAs User: coloso\Jai
    Configuration Name: 
    Machine: COLOSO (Microsoft Windows NT 10.0.22631.0)
    Host Application: powershell.exe -executionpolicy bypass -windowstyle hidden -file D:\git\PlayNiteWatcher\PlayniteWatcher.ps1 19c68cf0-b41d-4336-93d0-86730be9508b
    Process ID: 16104
    PSVersion: 5.1.22621.4111
    PSEdition: Desktop
    PSCompatibleVersions: 1.0, 2.0, 3.0, 4.0, 5.0, 5.1.22621.4111
    BuildVersion: 10.0.22621.4111
    CLRVersion: 4.0.30319.42000
    WSManStackVersion: 3.0
    PSRemotingProtocolVersion: 2.3
    SerializationVersion: 1.1.0.1
    **********************
    Transcript started, output file is D:\git\PlayNiteWatcher\log.txt
    2      PlayniteWatc... BackgroundJob   Running       True            localhost            ...
    4      Playnite-Wat... BackgroundJob   Running       True            localhost            ...
    Received GamePath: C:\Program Files (x86)\Diablo IV
    Waiting for named pipe to recieve kill command
    Terminating pipe...
    Terminating...
    **********************
    Windows PowerShell transcript end
    End time: 20240917102306
    **********************
  3. When one properly exists out of Diablo IV from the main menu, it simply exits to the battle.net launcher
  4. When the Diablo IV process exists one can see the powershell background jobs clear out of task manager

Workaround / Fix?

Unchecking Continue streaming until all app processes exit in the Sunshine Application properties for the game causes the session to terminate.

However, it does seem to exit with -1 which the moonlight client interprets as an error.

Given the way the wrapper script works, perhaps it would be worthwhile to uncheck this option when the installer is writing to the JSON file?