mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2025-07-22 12:13:35 +00:00
Don't attempt to start or resume a game if the device isn't paired
This commit is contained in:
parent
ae9abf2911
commit
ba022da665
@ -41,11 +41,20 @@
|
|||||||
|
|
||||||
NSData* serverInfoResp = [hMan executeRequestSynchronously:[hMan newServerInfoRequest]];
|
NSData* serverInfoResp = [hMan executeRequestSynchronously:[hMan newServerInfoRequest]];
|
||||||
NSString* currentGame = [HttpManager getStringFromXML:serverInfoResp tag:@"currentgame"];
|
NSString* currentGame = [HttpManager getStringFromXML:serverInfoResp tag:@"currentgame"];
|
||||||
if (currentGame == NULL) {
|
NSString* pairStatus = [HttpManager getStringFromXML:serverInfoResp tag:@"PairStatus"];
|
||||||
|
if (currentGame == NULL || pairStatus == NULL) {
|
||||||
[_callbacks launchFailed];
|
[_callbacks launchFailed];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (![currentGame isEqualToString:@"0"]) {
|
|
||||||
|
if (![pairStatus isEqualToString:@"1"]) {
|
||||||
|
// Not paired
|
||||||
|
// TODO: Display better error message
|
||||||
|
[_callbacks launchFailed];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (![currentGame isEqualToString:@"0"]) {
|
||||||
// App already running, resume it
|
// App already running, resume it
|
||||||
if (![self resumeApp:hMan]) {
|
if (![self resumeApp:hMan]) {
|
||||||
[_callbacks launchFailed];
|
[_callbacks launchFailed];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user