|
| 1 | +import type { ApiRequest, BooleanString } from "./common.js"; |
| 2 | +import { buildApiRequest } from "./common.js"; |
| 3 | + |
| 4 | +export type CreateNewGameRequest = ApiRequest< |
| 5 | + "CreateNewGame", |
| 6 | + { |
| 7 | + /** |
| 8 | + * Parameters needed to create new game session. |
| 9 | + */ |
| 10 | + newGameData: { |
| 11 | + /** |
| 12 | + * Name of the session to create. |
| 13 | + */ |
| 14 | + sessionName: string; |
| 15 | + /** |
| 16 | + * Path Name to the Map Package to use as a map. |
| 17 | + * |
| 18 | + * If not specified, default level. |
| 19 | + */ |
| 20 | + mapName?: string; |
| 21 | + /** |
| 22 | + * Name of the starting location to use. |
| 23 | + * |
| 24 | + * Leaving it empty will use random starting location. |
| 25 | + */ |
| 26 | + startingLocation: string; |
| 27 | + /** |
| 28 | + * Whenever the Onboarding should be skipped. |
| 29 | + * |
| 30 | + * Currently Onboarding is always skipped on the Dedicated Servers. |
| 31 | + */ |
| 32 | + skipOnboarding: boolean; |
| 33 | + /** |
| 34 | + * Advanced Game Settings to apply to the newly created session. |
| 35 | + */ |
| 36 | + advancedGameSettings: { |
| 37 | + "FG.GameRules.NoPower"?: BooleanString; |
| 38 | + "FG.GameRules.DisableArachnidCreatures"?: BooleanString; |
| 39 | + "FG.GameRules.NoUnlockCost"?: BooleanString; |
| 40 | + "FG.GameRules.SetGamePhase"?: string; |
| 41 | + "FG.GameRules.GiveAllTiers"?: BooleanString; |
| 42 | + "FG.GameRules.UnlockAllResearchSchematics"?: BooleanString; |
| 43 | + "FG.GameRules.UnlockInstantAltRecipes"?: BooleanString; |
| 44 | + "FG.GameRules.UnlockAllResourceSinkSchematics"?: BooleanString; |
| 45 | + "FG.GameRules.GiveItems"?: string; |
| 46 | + "FG.PlayerRules.NoBuildCost"?: BooleanString; |
| 47 | + "FG.PlayerRules.GodMode"?: BooleanString; |
| 48 | + "FG.PlayerRules.FlightMode"?: BooleanString; |
| 49 | + [key: string]: string | BooleanString | undefined; |
| 50 | + }; |
| 51 | + /** |
| 52 | + * Custom Options to pass to the newly created session URL. |
| 53 | + * |
| 54 | + * Not used by vanilla Dedicated Servers. |
| 55 | + */ |
| 56 | + customOptionsOnlyForModding: Record<string, string>; |
| 57 | + }; |
| 58 | + } |
| 59 | +>; |
| 60 | + |
| 61 | +export type CreateNewGameResponse = string; |
| 62 | + |
| 63 | +export const buildCreateNewGame = buildApiRequest< |
| 64 | + CreateNewGameRequest, |
| 65 | + CreateNewGameResponse |
| 66 | +>("v1", { |
| 67 | + function: "CreateNewGame", |
| 68 | +}); |
0 commit comments