feat(launcher): launch the game through the guarded lab

This commit is contained in:
N0VAN0M4LY committed 2026-11-29 15:02:39 +08:00
1 parent d633280e23
commit e41b73aaa3
25 files changed
+920 -23

No files matched your search

+9
View File
@@ -9,6 +9,8 @@ import { inspectGameFolder, requireFolder } from '../services/game-folder/inspec
import { inspectTargetFolder } from '../services/game-folder/inspect-target-folder.ts';
import { cancelInstall, checkGameFolder, installGame } from '../services/install/install-game.ts';
import { defaultDataPath, readInstallRecord } from '../services/install/install-record.ts';
import { readInstalledLab } from '../services/launch/lab-handoff.ts';
import { getLaunchState, openServerStatus, startLaunch, stopLaunch } from '../services/launch/launch-controller.ts';
import { resourcePaths } from '../services/resources/resource-paths.ts';
import { broadcast, handle } from './register.ts';
@@ -19,6 +21,7 @@ export function registerIpcHandlers(): void {
return {
version: app.getVersion(),
electron: process.versions.electron,
development: !app.isPackaged,
systemLocale: app.getLocale(),
userDataPath: app.getPath('userData'),
supportedGameVersions: recordedGameVersions(resources.patches),
@@ -72,6 +75,12 @@ export function registerIpcHandlers(): void {
return patchFeatures(resources.patches).map((feature) => ({ ...feature, patchIds: [...feature.patchIds] }));
});
handle('launch:getState', () => getLaunchState());
handle('launch:getLabInfo', () => readInstalledLab().catch(() => null));
handle('launch:start', () => startLaunch((state) => broadcast('event:launch-state', state)));
handle('launch:stop', async () => { await stopLaunch(); });
handle('launch:openServerStatus', () => openServerStatus());
handle('settings:get', () => getSettings());
handle('settings:update', async (patch) => {
const settings = await updateSettings(patch);