Skip to content

five-on-it / apps/server/src/game-server / GameServerOptions

Interface: GameServerOptions ​

Defined in: apps/server/src/game-server.ts:436

Tunables of the server core.

Properties ​

aiStatic? ​

optional aiStatic?: AiStatic

Defined in: apps/server/src/game-server.ts:448

The level's navigation built already (nav-cache.ts: in a worker); else the AI builds it, or finds it built.


aoiTiers? ​

optional aoiTiers?: boolean

Defined in: apps/server/src/game-server.ts:446

Far entities sent less often (AOI_TIERS; on by default with delta snapshots).


chasers? ​

optional chasers?: ChaserOptions

Defined in: apps/server/src/game-server.ts:450

Chasers to spawn at start (none by default).


debug? ​

optional debug?: boolean

Defined in: apps/server/src/game-server.ts:452

Honour the clients' debug commands; by default on a test-* level only.


delta? ​

optional delta?: boolean

Defined in: apps/server/src/game-server.ts:444

Delta snapshots (@foi/protocol's snapshot-v2.ts; on by default), or every snapshot whole.


game? ​

optional game?: object

Defined in: apps/server/src/game-server.ts:454

The game whose missions every player plays (none by default: free roam).

blurb? ​

optional blurb?: string

id ​

id: string

level ​

level: string

missions ​

missions: object[]

paths ​

paths: Record<string, { gates: string[]; laps: number; } | { loop: boolean; patrol: string[]; }>

places ​

places: Record<string, { name?: string; role?: "players" | "police" | "traffic" | "guards" | "hospital"; tags?: string[]; x: number; y?: number; yaw?: number; z: number; }>

rules ​

rules: object

rules.clock? ​

optional clock?: object

The room clock (GAME_DESIGN §5.7): the time the room starts at and its pace, game minutes per real second (1 is an hour a minute, a day in 24 minutes; 0 stops it; up to 60 for a day in 24 seconds).

rules.clock.pace ​

pace: number

rules.clock.start ​

start: string

rules.dropMissionItems ​

dropMissionItems: boolean

Whether a character that dies drops the items a mission defined that it carried, where it fell (GAME_DESIGN §7.4).

rules.fallDamage ​

fallDamage: boolean

Whether a long fall hurts (from about 4 m) and a very long one kills (from about 12 m).

rules.garages? ​

optional garages?: object

What every garage of the level charges ($), over the level's own prices (GAME_DESIGN §5.5).

rules.garages.respray? ​

optional respray?: number

rules.garages.store? ​

optional store?: number

rules.ghostSeconds ​

ghostSeconds: number

Seconds a player is a ghost after coming back (passing through cars and people, taking no harm).

rules.loadout? ​

optional loadout?: object[]

What every player starts with (GAME_DESIGN §7.4): stacks of items by id (weapons and their ammunition are items), each in the slot of the strip it names (1 to 16; the number keys select the first nine, and the slot a key selects is the weapon held) or the first free one. Absent: free roam's arsenal, the fists' slot 1 left empty, the pistol, shotgun, rifle, rocket launcher, grenades and tranquilizer on 2 to 7 and the guns' ammunition from 9 on; an empty list: nothing but the phone.

rules.maxPlayers ​

maxPlayers: number

How many players a room of this game takes.

rules.partyRewards ​

partyRewards: "split" | "shared"

How a party's mission reward is paid: each member the whole of it (shared), or the reward divided among them (split).

rules.phone ​

phone: boolean

Whether every character starts with a phone (GAME_DESIGN §7.5); a mission may give one.

rules.playerDamage ​

playerDamage: "on" | "off" | "rivals"

Whether players hurt each other: never, only rivals (players outside one's party), or always.

rules.police ​

police: boolean

Whether the room has police: crimes raise a Wanted level and police cars come (GAME_DESIGN §12).

rules.prices? ​

optional prices?: Record<string, number>

What the shops charge ($), by item id, over the items' own prices (GAME_DESIGN §14).

rules.respawn ​

respawn: "hospital" | "mission"

Where a player who went down comes back: the nearest spawn point (hospital), or where their mission started (mission).

rules.safeZones ​

safeZones: string[]

The game's zones where players cannot hurt each other and no car is carjacked.

rules.traffic ​

traffic: number

Ambient cars driving the level's roads around the players: none unless the game asks (at most 64).

rules.vehicleFire ​

vehicleFire: boolean

Whether a car brought low catches fire, burns and blows up, its blast lighting the cars beside it.

rules.weather? ​

optional weather?: object

The room's weather (GAME_DESIGN §5.7): its climate (the level's by default: a region's biome, temperate for a town; none is always clear), the weather it opens with (start, at an intensity), and whether it changes on its own from there (a front every half an hour, by the climate's odds) or holds. Missions change it (setWeather).

rules.weather.changes ​

changes: boolean

rules.weather.climate? ​

optional climate?: "none" | "temperate" | "meadow" | "forest" | "alpine" | "farmland" | "steppe" | "desert" | "autumn" | "coast"

rules.weather.intensity ​

intensity: number

rules.weather.start? ​

optional start?: "clear" | "overcast" | "rain" | "storm" | "fog" | "snow"

schemaVersion? ​

optional schemaVersion?: number

The document's format (migrate.ts): 1 when absent; a newer one is migrated away before this reads it.

title ​

title: string

zones ​

zones: Record<string, { kind?: "pickup" | "spawn" | "restricted" | "race_gate" | "safe" | "checkpoint" | "dropoff"; place: string; radius: number; raises?: "alert" | "heat"; role?: "players" | "police" | "traffic" | "guards" | "hospital"; }>


gameSource? ​

optional gameSource?: unknown

Defined in: apps/server/src/game-server.ts:477

The game's document as authored (before the schema's defaults): what a run's mission hash is taken over.


log? ​

optional log?: (message) => void

Defined in: apps/server/src/game-server.ts:440

Where to log lifecycle events.

Parameters ​

message ​

string

Returns ​

void


maxInputQueue? ​

optional maxInputQueue?: number

Defined in: apps/server/src/game-server.ts:438

Inputs a client may have waiting; older ones are dropped beyond this.


moderate? ​

optional moderate?: (text) => Promise<boolean>

Defined in: apps/server/src/game-server.ts:463

Checks a player's line before the room reads it: a public room's moderation (none: a private room).

Parameters ​

text ​

string

Returns ​

Promise<boolean>


pedestrians? ​

optional pedestrians?: number

Defined in: apps/server/src/game-server.ts:442

Pedestrians kept around the players (the crowd, on the level's pavements); none by default (see defaultPedestrians).


police? ​

optional police?: boolean

Defined in: apps/server/src/game-server.ts:456

Whether there are police: by default the game's rules.police, on in free roam.


run? ​

optional run?: object

Defined in: apps/server/src/game-server.ts:475

The run the room is opened for: its one mission, for its roster alone (run-host.ts).

game ​

game: string

id ​

id: string

mission ​

mission: string

playtest? ​

optional playtest?: boolean

reportToken ​

reportToken: string

reportUrl ​

reportUrl: string

seats ​

seats: object[]

teams ​

teams: string[]


runHost? ​

optional runHost?: Pick<RunHostOptions, "now" | "report" | "timing">

Defined in: apps/server/src/game-server.ts:479

The run's clocks and its report, for the tests (run-host.ts).


traffic? ​

optional traffic?: number

Defined in: apps/server/src/game-server.ts:461

Ambient cars kept around the players: by default the game's rules.traffic when it runs a game, else MAIN_TRAFFIC on a main-* level and none on a test-* one.


weather? ​

optional weather?: string

Defined in: apps/server/src/game-server.ts:471

The room's weather (GAME_DESIGN §5.7): on, the level's climate changing on its own and the night shortening sight (by default, but on a test-* level: a level that ships, a creator's); off, always clear and the night no darker for anybody's eyes (by default on a test-* one, and the e2e servers'); or a climate by name. A game's rules.weather and its missions script it either way.


weatherSeed? ​

optional weatherSeed?: number

Defined in: apps/server/src/game-server.ts:473

The seed the room's weather is drawn from (a random one by default).