diff --git a/Limelight/Database/TemporaryHost.h b/Limelight/Database/TemporaryHost.h index 76af87a7..3cf5110c 100644 --- a/Limelight/Database/TemporaryHost.h +++ b/Limelight/Database/TemporaryHost.h @@ -16,6 +16,7 @@ @property (atomic, nullable, retain) NSString * activeAddress; @property (atomic, nullable, retain) NSString * currentGame; @property (atomic) unsigned short httpsPort; +@property (atomic) BOOL isNvidiaServerSoftware; @property (atomic, nullable, retain) NSData *serverCert; @property (atomic, nullable, retain) NSString *address; diff --git a/Limelight/Network/ServerInfoResponse.m b/Limelight/Network/ServerInfoResponse.m index 08f55953..e210369d 100644 --- a/Limelight/Network/ServerInfoResponse.m +++ b/Limelight/Network/ServerInfoResponse.m @@ -85,6 +85,9 @@ host.currentGame = @"0"; } + // GFE uses the Mjolnir codename in their state enum values + host.isNvidiaServerSoftware = [state containsString:@"MJOLNIR"]; + NSInteger pairStatus; if ([self getIntTag:TAG_PAIR_STATUS value:&pairStatus]) { host.pairState = pairStatus ? PairStatePaired : PairStateUnpaired; diff --git a/Limelight/Utility/Utils.h b/Limelight/Utility/Utils.h index 5d761df8..1616bf92 100644 --- a/Limelight/Utility/Utils.h +++ b/Limelight/Utility/Utils.h @@ -32,6 +32,10 @@ FOUNDATION_EXPORT NSString *const deviceName; + (unsigned short) addressPortStringToPort:(NSString*)addressPort; + (NSString*) addressAndPortToAddressPortString:(NSString*)address port:(unsigned short)port; +#if !TARGET_OS_TV ++ (void) launchUrl:(NSString*)urlString; +#endif + @end @interface NSString (NSStringWithTrim) diff --git a/Limelight/Utility/Utils.m b/Limelight/Utility/Utils.m index 1960bb05..fded11b7 100644 --- a/Limelight/Utility/Utils.m +++ b/Limelight/Utility/Utils.m @@ -64,11 +64,17 @@ NSString *const deviceName = @"roth"; return NO; } +#if !TARGET_OS_TV ++ (void) launchUrl:(NSString*)urlString { + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlString] options:@{} completionHandler:nil]; +} +#endif + + (void) addHelpOptionToDialog:(UIAlertController*)dialog { #if !TARGET_OS_TV // tvOS doesn't have a browser [dialog addAction:[UIAlertAction actionWithTitle:@"Help" style:UIAlertActionStyleDefault handler:^(UIAlertAction* action){ - [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://github.com/moonlight-stream/moonlight-docs/wiki/Troubleshooting"]]; + [Utils launchUrl:@"https://github.com/moonlight-stream/moonlight-docs/wiki/Troubleshooting"]; }]]; #endif } diff --git a/Limelight/ViewControllers/MainFrameViewController.m b/Limelight/ViewControllers/MainFrameViewController.m index d8cee87e..fe105e6f 100644 --- a/Limelight/ViewControllers/MainFrameViewController.m +++ b/Limelight/ViewControllers/MainFrameViewController.m @@ -492,6 +492,14 @@ static NSMutableSet* hostList; self->_showHiddenApps = YES; [self hostClicked:host view:view]; }]]; + +#if !TARGET_OS_TV + if (host.isNvidiaServerSoftware) { + [longClickAlert addAction:[UIAlertAction actionWithTitle:@"NVIDIA GameStream End-of-Service" style:UIAlertActionStyleDefault handler:^(UIAlertAction* action){ + [Utils launchUrl:@"https://github.com/moonlight-stream/moonlight-docs/wiki/NVIDIA-GameStream-End-Of-Service-Announcement-FAQ"]; + }]]; + } +#endif } [longClickAlert addAction:[UIAlertAction actionWithTitle:@"Test Network" style:UIAlertActionStyleDefault handler:^(UIAlertAction* action) { [self showLoadingFrame:^{ @@ -524,8 +532,11 @@ static NSMutableSet* hostList; }]]; #if !TARGET_OS_TV if (host.state != StateOnline) { + [longClickAlert addAction:[UIAlertAction actionWithTitle:@"NVIDIA GameStream End-of-Service" style:UIAlertActionStyleDefault handler:^(UIAlertAction* action){ + [Utils launchUrl:@"https://github.com/moonlight-stream/moonlight-docs/wiki/NVIDIA-GameStream-End-Of-Service-Announcement-FAQ"]; + }]]; [longClickAlert addAction:[UIAlertAction actionWithTitle:@"Connection Help" style:UIAlertActionStyleDefault handler:^(UIAlertAction* action){ - [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://github.com/moonlight-stream/moonlight-docs/wiki/Troubleshooting"]]; + [Utils launchUrl:@"https://github.com/moonlight-stream/moonlight-docs/wiki/Troubleshooting"]; }]]; } #endif