diff --git a/src/modules/remote-play-manager.ts b/src/modules/remote-play-manager.ts index b9a0940..7b418af 100644 --- a/src/modules/remote-play-manager.ts +++ b/src/modules/remote-play-manager.ts @@ -53,48 +53,6 @@ export class RemotePlayManager { private consoles!: Array; private regions: Array = []; - static readonly BASE_DEVICE_INFO = { - appInfo: { - env: { - clientAppId: window.location.host, - clientAppType: 'browser', - clientAppVersion: '24.17.36', - clientSdkVersion: '10.1.14', - httpEnvironment: 'prod', - sdkInstallId: '', - }, - }, - dev: { - displayInfo: { - dimensions: { - widthInPixels: 1920, - heightInPixels: 1080, - }, - pixelDensity: { - dpiX: 1, - dpiY: 1, - }, - }, - hw: { - make: 'Microsoft', - model: 'unknown', - sdktype: 'web', - }, - os: { - name: 'windows', - ver: '22631.2715', - platform: 'desktop', - }, - browser: { - browserName: 'chrome', - browserVersion: '125.0', - }, - }, - }; - - constructor() { - } - initialize() { if (this.isInitialized) { return; @@ -206,11 +164,9 @@ export class RemotePlayManager { // Store working server STATES.remotePlay.server = region.baseUri; - } catch (e) {} - if (this.consoles) { break; - } + } catch (e) {} } // None of the servers worked @@ -270,7 +226,7 @@ export class RemotePlayManager { } } - private isReady() { + isReady() { return this.consoles !== null; } } diff --git a/src/utils/xhome-interceptor.ts b/src/utils/xhome-interceptor.ts index 8ea9153..c39073a 100644 --- a/src/utils/xhome-interceptor.ts +++ b/src/utils/xhome-interceptor.ts @@ -12,6 +12,46 @@ import { RemotePlayManager } from "@/modules/remote-play-manager"; export class XhomeInterceptor { static #consoleAddrs: RemotePlayConsoleAddresses = {}; + private static readonly BASE_DEVICE_INFO = { + appInfo: { + env: { + clientAppId: window.location.host, + clientAppType: 'browser', + clientAppVersion: '24.17.36', + clientSdkVersion: '10.1.14', + httpEnvironment: 'prod', + sdkInstallId: '', + }, + }, + + dev: { + displayInfo: { + dimensions: { + widthInPixels: 1920, + heightInPixels: 1080, + }, + pixelDensity: { + dpiX: 1, + dpiY: 1, + }, + }, + hw: { + make: 'Microsoft', + model: 'unknown', + sdktype: 'web', + }, + os: { + name: 'windows', + ver: '22631.2715', + platform: 'desktop', + }, + browser: { + browserName: 'chrome', + browserVersion: '125.0', + }, + }, + }; + static async #handleLogin(request: Request) { try { const clone = (request as Request).clone(); @@ -149,7 +189,7 @@ export class XhomeInterceptor { headers.authorization = `Bearer ${RemotePlayManager.getInstance().xhomeToken}`; // Patch resolution - const deviceInfo = RemotePlayManager.BASE_DEVICE_INFO; + const deviceInfo = XhomeInterceptor.BASE_DEVICE_INFO; if (getPref(PrefKey.REMOTE_PLAY_RESOLUTION) === StreamResolution.DIM_720P) { deviceInfo.dev.os.name = 'android'; }