From 25d7af94538007656819a933172ef2c378f31b27 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Mon, 16 Oct 2017 23:59:00 -0700 Subject: [PATCH] Fix pairing and game quitting issues with GFE 3.10 --- Limelight/Network/PairManager.m | 2 +- Limelight/Network/ServerInfoResponse.m | 2 +- Limelight/ViewControllers/MainFrameViewController.m | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Limelight/Network/PairManager.m b/Limelight/Network/PairManager.m index 7898be4..13193a6 100644 --- a/Limelight/Network/PairManager.m +++ b/Limelight/Network/PairManager.m @@ -38,7 +38,7 @@ return; } if ([serverInfoResp isStatusOk]) { - if (![[serverInfoResp getStringTag:@"state"] hasSuffix:@"_SERVER_AVAILABLE"]) { + if ([[serverInfoResp getStringTag:@"state"] hasSuffix:@"_SERVER_BUSY"]) { [_callback pairFailed:@"You must stop streaming before attempting to pair."]; } else if (![[serverInfoResp getStringTag:@"PairStatus"] isEqual:@"1"]) { NSString* appversion = [serverInfoResp getStringTag:@"appversion"]; diff --git a/Limelight/Network/ServerInfoResponse.m b/Limelight/Network/ServerInfoResponse.m index 3faf632..0eb479c 100644 --- a/Limelight/Network/ServerInfoResponse.m +++ b/Limelight/Network/ServerInfoResponse.m @@ -26,7 +26,7 @@ host.currentGame = [[self getStringTag:TAG_CURRENT_GAME] trim]; NSString *state = [[self getStringTag:TAG_STATE] trim]; - if ([state hasSuffix:@"_SERVER_AVAILABLE"]) { + if (![state hasSuffix:@"_SERVER_BUSY"]) { // 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. diff --git a/Limelight/ViewControllers/MainFrameViewController.m b/Limelight/ViewControllers/MainFrameViewController.m index 174d158..12c89fd 100644 --- a/Limelight/ViewControllers/MainFrameViewController.m +++ b/Limelight/ViewControllers/MainFrameViewController.m @@ -440,7 +440,7 @@ static NSMutableSet* hostList; ServerInfoResponse* serverInfoResp = [[ServerInfoResponse alloc] init]; [hMan executeRequestSynchronously:[HttpRequest requestForResponse:serverInfoResp withUrlRequest:[hMan newServerInfoRequest] fallbackError:401 fallbackRequest:[hMan newHttpServerInfoRequest]]]; - if (![serverInfoResp isStatusOk] || ![[serverInfoResp getStringTag:@"state"] hasSuffix:@"_SERVER_AVAILABLE"]) { + if (![serverInfoResp isStatusOk] || [[serverInfoResp getStringTag:@"state"] hasSuffix:@"_SERVER_BUSY"]) { // On newer GFE versions, the quit request succeeds even though the app doesn't // really quit if another client tries to kill your app. We'll patch the response // to look like the old error in that case, so the UI behaves.