mirror of
https://github.com/moonlight-stream/moonlight-chrome.git
synced 2025-08-17 08:36:42 +00:00
parsed more info from server
This commit is contained in:
parent
0a84d27386
commit
286bc316e6
@ -41,6 +41,12 @@ function NvHTTP(address, clientUid) {
|
||||
this._baseUrlHttps = 'https://' + address + ':47984';
|
||||
this._baseUrlHttp = 'http://' + address + ':47989';
|
||||
this._memCachedBoxArtArray = {};
|
||||
|
||||
this.serverUid = '';
|
||||
this.GfeVersion = '';
|
||||
this.supportedDisplayModes = {}; // key: y-resolution:x-resolution, value: array of supported framerates (only ever seen 30 or 60, here)
|
||||
this.gputype = '';
|
||||
this.numofapps = 0;
|
||||
_self = this;
|
||||
};
|
||||
|
||||
@ -86,6 +92,23 @@ 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);
|
||||
_self.serverUid = $root.find('uniqueid').text().trim();
|
||||
_self.GfeVersion = $root.find('GfeVersion').text().trim();
|
||||
_self.gputype = $root.find('gputype').text().trim();
|
||||
_self.numofapps = $root.find('numofapps').text().trim();
|
||||
// now for the hard part: parsing the supported streaming
|
||||
$root.find('DisplayMode').each(function(index, value) { // for each resolution:FPS object
|
||||
var yres = parseInt($(value).find('Height').text());
|
||||
var xres = parseInt($(value).find('Width').text());
|
||||
var fps = parseInt($(value).find('RefreshRate').text());
|
||||
if(!_self.supportedDisplayModes[yres + ':' + xres]) {
|
||||
_self.supportedDisplayModes[yres + ':' + xres] = [];
|
||||
}
|
||||
if(!_self.supportedDisplayModes[yres + ':' + xres].includes(fps)) {
|
||||
_self.supportedDisplayModes[yres + ':' + xres].push(fps);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// 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
|
||||
|
Loading…
x
Reference in New Issue
Block a user