Add quit cli command and app quit option after stream session. Fixes #92 (#138)

* Add quit cli command and app quit option after stream session. Fixes #92

* Code review fixes.
This commit is contained in:
Janne Hakonen
2018-12-06 04:45:28 +02:00
committed by Cameron Gutman
parent ad47990a87
commit 0ab07303c9
22 changed files with 678 additions and 67 deletions

View File

@@ -57,8 +57,13 @@ NvHTTP::getCurrentGame(QString serverInfo)
// GFE 2.8 started keeping currentgame set to the last game played. As a result, it no longer
// has the semantics that its name would indicate. To contain the effects of this change as much
// as possible, we'll force the current game to zero if the server isn't in a streaming session.
//
// However, current game info must be available also in other states than just _SERVER_BUSY as
// it is required for quitting currently running app. Quitting app occurs at end of stream if
// configured so. At that point the server state may be in some other state than _SERVER_BUSY
// for a short while, but that must not prevent quitting of the app.
QString serverState = getXmlString(serverInfo, "state");
if (serverState != nullptr && serverState.endsWith("_SERVER_BUSY"))
if (serverState != nullptr && !serverState.endsWith("_SERVER_AVAILABLE"))
{
return getXmlString(serverInfo, "currentgame").toInt();
}