fix(copies): honor confirmed Steam locations
Bind confirmation to the selected copy and data paths throughout installation, launch, and maintenance. Validate redirected runtime data paths and recheck original files before refreshing an in-place backup. Verified by type checking and build. The acceptance checklist covers directory links and Steam confirmation.
This commit is contained in:
1 parent
84158f719d
commit
5a78b1fdf8
28 files changed
+813
-459
No files matched your search
@@ -56,6 +56,7 @@ export const APP_ERROR_CODES = [
|
||||
'launch_lab_failed',
|
||||
'launch_game_running',
|
||||
'launch_copy_in_steam',
|
||||
'launch_steam_confirmation_required',
|
||||
'launch_location',
|
||||
'launch_stock_version',
|
||||
'launch_build_failed',
|
||||
@@ -70,7 +71,7 @@ export const APP_ERROR_CODES = [
|
||||
'not_a_game_folder',
|
||||
/** The folder chosen for the copy cannot take it (params: problem, one of TARGET_PROBLEMS). */
|
||||
'target_not_usable',
|
||||
/** The game copy would go into a Steam library and the player has not confirmed the warning. */
|
||||
/** A copy or data folder is inside a Steam library and the player has not confirmed the warning. */
|
||||
'steam_library_not_confirmed',
|
||||
/** The target drive has too little room (params: neededGb, freeGb). */
|
||||
'not_enough_space',
|
||||
|
||||
@@ -80,6 +80,10 @@ export const ipcContract = {
|
||||
input: z.object({ path: z.string().min(1), stockPath: z.string().min(1) }),
|
||||
output: TargetFolderInspectionSchema,
|
||||
},
|
||||
'install:inspectDataFolder': {
|
||||
input: z.object({ path: z.string().min(1) }),
|
||||
output: z.object({ path: z.string(), inSteam: z.boolean() }),
|
||||
},
|
||||
'install:measureFolder': {
|
||||
input: z.object({ path: z.string().min(1), version: z.string().nullable().optional() }),
|
||||
output: FolderSizeSchema,
|
||||
|
||||
@@ -3,6 +3,7 @@ import { z } from 'zod';
|
||||
/** What the launcher found in a folder the player chose as their War Thunder installation. */
|
||||
export const GameFolderInspectionSchema = z.object({
|
||||
path: z.string(),
|
||||
resolvedPath: z.string(),
|
||||
/** Files a game folder must have that this one lacks; empty for a game folder. */
|
||||
missingFiles: z.array(z.string()),
|
||||
/** The file version of win64/aces.exe, or null when it has none or is missing. */
|
||||
@@ -26,6 +27,7 @@ export const TARGET_PROBLEMS = [
|
||||
|
||||
export const TargetFolderInspectionSchema = z.object({
|
||||
path: z.string(),
|
||||
resolvedPath: z.string(),
|
||||
problem: z.enum(TARGET_PROBLEMS).nullable(),
|
||||
inSteamLibrary: z.boolean(),
|
||||
/** Bytes free on the drive the folder is on; null when the drive cannot be read. */
|
||||
@@ -87,8 +89,9 @@ const InstallChoicesSchema = z.object({
|
||||
/** Where the local server keeps saves, caches and logs. */
|
||||
dataPath: z.string().min(1),
|
||||
decalSourcePath: z.string().min(1).optional(),
|
||||
/** The player confirmed installing into a Steam library after the warning. */
|
||||
steamLibraryConfirmed: z.boolean(),
|
||||
/** Resolved Steam locations shown in the risk prompts the player confirmed. */
|
||||
confirmedSteamCopyPath: z.string().min(1).optional(),
|
||||
confirmedSteamDataPath: z.string().min(1).optional(),
|
||||
/** The player chose to go on without the features of the unavailable patches. */
|
||||
missingFeaturesAccepted: z.boolean(),
|
||||
});
|
||||
@@ -132,6 +135,11 @@ export const InstallRecordSchema = z.object({
|
||||
dataPath: z.string(),
|
||||
/** The stock files every build starts from, inside the copy. */
|
||||
stockBackupPath: z.string(),
|
||||
/** Confirmation applies only to these resolved copy and data paths. */
|
||||
steamLibraryConfirmation: z.object({
|
||||
copyPath: z.string(),
|
||||
dataPath: z.string(),
|
||||
}).optional(),
|
||||
gameVersion: z.string().nullable(),
|
||||
/** Patches that did not fit when the copy was installed; their features are missing. */
|
||||
unavailablePatches: z.array(UnavailablePatchSchema),
|
||||
|
||||
@@ -1,16 +1,27 @@
|
||||
import { z } from 'zod';
|
||||
import { CopyIdSchema } from './install.ts';
|
||||
|
||||
export const MaintenanceOperationSchema = z.enum(['check', 'repair', 'update', 'compact', 'delete']);
|
||||
export const MaintenanceOperationSchema = z.enum(['check', 'repair', 'update', 'compact', 'delete', 'confirm-steam']);
|
||||
export const MaintenanceRequestSchema = z.object({
|
||||
id: CopyIdSchema,
|
||||
operation: MaintenanceOperationSchema,
|
||||
deleteData: z.boolean().default(false),
|
||||
steamLocations: z.object({
|
||||
copyPath: z.string().min(1),
|
||||
dataPath: z.string().min(1),
|
||||
}).optional(),
|
||||
});
|
||||
export const MaintenanceInfoSchema = z.object({
|
||||
sourceVersion: z.string().nullable(),
|
||||
updateAvailable: z.boolean(),
|
||||
spaceSavingAvailable: z.boolean(),
|
||||
steamConfirmationRequired: z.boolean(),
|
||||
steamLocations: z.object({
|
||||
copyPath: z.string(),
|
||||
dataPath: z.string(),
|
||||
copyInSteam: z.boolean(),
|
||||
dataInSteam: z.boolean(),
|
||||
}).nullable(),
|
||||
});
|
||||
export const MaintenanceProgressSchema = z.object({
|
||||
id: CopyIdSchema,
|
||||
|
||||
Reference in new issue
Block a user