StartServerOptions beta
Interface of @v12-engine/engine/server
export interface StartServerOptions extends Omit<GameServerOptions, 'mode' | 'port'>What a game server is started with: the game, where its worlds come from, and the server's own options
Members
computer
computer?: GameMode['ai'] | BrainDef | null;How a computer player in a seat plays (ai says which seats, and those nobody took are its too): its options by seat (GameMode.ai), or the brain that plays every seat of the computer (defineBrain), against everyone else's base; the first brain the game lists, against everyone else's base when left out; null for a game the computer does not play. mode for a brain by seat (GameMode.brain)
game
game?: Game<unknown>;The game (createGame): its rules, its start (Game.onStart) where onStart is left out, and its first map where map, makeWorld and mode are. A server never fetches a game's view. Or rules in its place
makeWorld
makeWorld?: (settings: Record<string, string>, context?: {
log?: Logger;
}) => World | Promise<World>;A world made in code for each game, with the lobby's settings: in the place of a map. Says its seats too
map
map?: GameMap;A map of the game: each game is played on a world made from it, with a seat for each of its players with a start
mode
mode?: GameMode;A mode put together elsewhere, in the place of all of the above but the game
name
name?: string;What the mode is called. The map's name, or the game's
onStart
onStart?: (world: World, context: {
map?: GameMap;
settings: Record<string, string>;
}) => void | Promise<void>;What the game does once a world is made, before anyone plays: a mission given, the first wave sent
port
port?: number;The port to listen on: 8787 when left out, 0 for any free one
rules
rules?: Rules;The module of the game (Rules), in the place of game: the full API underneath, its start and map said here
seats
seats?: ModeSeat[];The seats a player may take. Those of the map when left out