From 0fe15be7b67de391989314c1e36e4ad9ee16740d Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Thu, 10 Mar 2016 23:21:51 -0800 Subject: [PATCH] If the server is available, ignore the current game in serverinfo --- static/js/utils.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/static/js/utils.js b/static/js/utils.js index 5f11ad2..9dedc20 100644 --- a/static/js/utils.js +++ b/static/js/utils.js @@ -42,6 +42,13 @@ NvHTTP.prototype = { _self.paired = $root.find("PairStatus").text().trim() == 1; _self.currentGame = parseInt($root.find("currentgame").text().trim(), 10); _self.serverMajorVersion = parseInt($root.find("appversion").text().trim().substring(0, 1), 10); + + // 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. + if ($root.find("state").text().trim().endsWith("_SERVER_AVAILABLE")) { + _self.currentGame = 0; + } } }); },