Fix propagation of PPK after pairing via Add PC and a couple launch cosmetic issues

This commit is contained in:
Cameron Gutman 2018-12-24 18:39:22 -08:00
parent d19bc0ca7d
commit db49a33a0f

View File

@ -340,25 +340,28 @@ function addHost() {
var _nvhttpHost = new NvHTTP(inputHost, myUniqueid, inputHost);
_nvhttpHost.refreshServerInfoAtAddress(inputHost).then(function(success) {
if (hosts[_nvhttpHost.serverUid] != null) {
_nvhttpHost.ppkstr = hosts[_nvhttpHost.serverUid].ppkstr;
}
modal.close();
pairTo(_nvhttpHost, function() {
// Check if we already have record of this host
// Check if we already have record of this host. If so,
// we'll need the PPK string to ensure our pairing status is accurate.
if (hosts[_nvhttpHost.serverUid] != null) {
// Just update the addresses
// Update the addresses
hosts[_nvhttpHost.serverUid].address = _nvhttpHost.address;
hosts[_nvhttpHost.serverUid].userEnteredAddress = _nvhttpHost.userEnteredAddress;
} else {
// Use the host in the array directly to ensure the PPK propagates after pairing
pairTo(hosts[_nvhttpHost.serverUid], function() {
saveHosts();
});
}
else {
pairTo(_nvhttpHost, function() {
// Host must be in the grid before starting background polling
addHostToGrid(_nvhttpHost);
beginBackgroundPollingOfHost(_nvhttpHost);
}
saveHosts();
});
}
}.bind(this),
function(failure) {
snackbarLog('Failed to connect to ' + _nvhttpHost.hostname + '! Ensure that GameStream is enabled in GeForce Experience.');
@ -701,6 +704,7 @@ function startGame(host, appID) {
]);
}, function(failedResumeApp) {
console.eror('%c[index.js, startGame]', 'color:green;', 'Failed to resume the app! Returned error was' + failedResumeApp);
showApps(host);
return;
});
}
@ -729,6 +733,7 @@ function startGame(host, appID) {
]);
}, function(failedLaunchApp) {
console.error('%c[index.js, launchApp]', 'color: green;', 'Failed to launch app width id: ' + appID + '\nReturned error was: ' + failedLaunchApp);
showApps(host);
return;
});