Skip to content

Commit d9cbdb6

Browse files
committed
rpcObeysDetection: linked games support
1 parent 568c53e commit d9cbdb6

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/rpcObeysDetection/webpackModules/entrypoint.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import {
33
GameStore,
44
RunningGameStore,
55
LibraryApplicationStore,
6-
SelfPresenceStore
6+
SelfPresenceStore,
7+
ApplicationStore
78
} from "@moonlight-mod/wp/common_stores";
89
import spacepack from "@moonlight-mod/wp/spacepack_spacepack";
910

@@ -17,7 +18,11 @@ Dispatcher.addInterceptor((event) => {
1718
if (event.type !== "LOCAL_ACTIVITY_UPDATE") return false;
1819
if (event.activity?.application_id == null) return false;
1920

20-
const game = RunningGameStore.getRunningGames().find((g: any) => g.id === event.activity.application_id);
21+
const app = ApplicationStore.getApplication(event.activity.application_id);
22+
const linked = (app?.linkedGames ?? []).map((a: any) => a.id);
23+
const game = RunningGameStore.getRunningGames().find(
24+
(g: any) => g.id === event.activity.application_id || linked.includes(g.id)
25+
);
2126
if (game != null) {
2227
const extended = extendGameEntry!(game, RunningGameStore, GameStore, LibraryApplicationStore);
2328
if (!extended.detectable) {

0 commit comments

Comments
 (0)