Add launch section to manifest

This commit is contained in:
mtkennerly 2022-06-03 06:41:45 +08:00
parent cb242f6433
commit a046c18ad4
No known key found for this signature in database
GPG key ID: E764BE00BE6E6408
7 changed files with 266804 additions and 373 deletions

View file

@ -1,12 +1,23 @@
import { DELAY_BETWEEN_GAMES_MS, REPO, YamlFile } from ".";
import * as SteamUser from "steam-user";
type SteamGameCache = {
export type SteamGameCache = {
[appId: string]: {
installDir?: string,
unknown?: boolean,
nameLocalized?: Map<string, string>;
launch?: Array<object>;
launch?: Array<{
executable?: string;
arguments?: string;
workingdir?: string;
type?: string;
config?: {
betakey?: string;
osarch?: string;
oslist?: string;
ownsdlc?: string;
},
}>;
irregular?: boolean;
};
};
@ -14,8 +25,9 @@ type SteamGameCache = {
export class SteamGameCacheFile extends YamlFile<SteamGameCache> {
path = `${REPO}/data/steam-game-cache.yaml`;
defaultData = {};
steamClient: SteamUser | null = null;
constructor(public steamClient: SteamUser) {
constructor(private makeSteamClient: () => Promise<SteamUser>) {
super();
}
@ -33,6 +45,10 @@ export class SteamGameCacheFile extends YamlFile<SteamGameCache> {
return this.data[key];
}
if (this.steamClient === null) {
this.steamClient = await this.makeSteamClient();
}
const info: SteamProductInfoResponse = await this.steamClient.getProductInfo([appId], []);
if (info.unknownApps.includes(appId)) {