mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-08-06 21:28:27 +02:00
Rename EventBus to BxEventBus
This commit is contained in:
@@ -12,7 +12,7 @@ import { BypassServerIps } from "@/enums/bypass-servers";
|
||||
import { PrefKey } from "@/enums/pref-keys";
|
||||
import { getPref } from "./settings-storages/global-settings-storage";
|
||||
import { NativeMkbMode, StreamResolution, TouchControllerMode } from "@/enums/pref-values";
|
||||
import { EventBus } from "./event-bus";
|
||||
import { BxEventBus } from "./bx-event-bus";
|
||||
|
||||
export class XcloudInterceptor {
|
||||
private static readonly SERVER_EXTRA_INFO: Record<string, [string, ServerContinent]> = {
|
||||
@@ -52,7 +52,7 @@ export class XcloudInterceptor {
|
||||
const response = await NATIVE_FETCH(request, init);
|
||||
if (response.status !== 200) {
|
||||
// Unsupported region
|
||||
EventBus.Script.emit('xcloudServerUnavailable', {});
|
||||
BxEventBus.Script.emit('xcloudServerUnavailable', {});
|
||||
return response;
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ export class XcloudInterceptor {
|
||||
STATES.serverRegions[region.name] = Object.assign({}, region);
|
||||
}
|
||||
|
||||
EventBus.Script.emit('xcloudServerReady', {});
|
||||
BxEventBus.Script.emit('xcloudServerReady', {});
|
||||
|
||||
const preferredRegion = getPreferredServerRegion();
|
||||
if (preferredRegion && preferredRegion in STATES.serverRegions) {
|
||||
@@ -107,7 +107,7 @@ export class XcloudInterceptor {
|
||||
}
|
||||
|
||||
private static async handlePlay(request: RequestInfo | URL, init?: RequestInit) {
|
||||
EventBus.Stream.emit('stateLoading', {});
|
||||
BxEventBus.Stream.emit('stateLoading', {});
|
||||
|
||||
const PREF_STREAM_TARGET_RESOLUTION = getPref<StreamResolution>(PrefKey.STREAM_RESOLUTION);
|
||||
const PREF_STREAM_PREFERRED_LOCALE = getPref<StreamPreferredLocale>(PrefKey.STREAM_PREFERRED_LOCALE);
|
||||
@@ -189,7 +189,7 @@ export class XcloudInterceptor {
|
||||
return response;
|
||||
}
|
||||
|
||||
EventBus.Stream.emit('stateStarting', {});
|
||||
BxEventBus.Stream.emit('stateStarting', {});
|
||||
|
||||
const obj = JSON.parse(text);
|
||||
let overrides = JSON.parse(obj.clientStreamingConfigOverrides || '{}') || {};
|
||||
|
Reference in New Issue
Block a user