Skip to content

five-on-it / packages/protocol/src/messages / parseDebugCommand

Function: parseDebugCommand() ​

parseDebugCommand(text): { ahead?: number; carClass?: number; climate?: "none" | "temperate" | "meadow" | "forest" | "alpine" | "farmland" | "steppe" | "desert" | "autumn" | "coast"; cmd: "police" | "clock" | "give" | "invincible" | "maxHealth" | "chaos" | "weather" | "wanted" | "budget" | "tech" | "spawnChaser" | "clearChasers" | "teleport" | "pedestrian" | "carHealth" | "rtcDrop" | "fit" | "ignite" | "bust" | "halt" | "cop"; crew?: number; dispatcher?: boolean; event?: "riot" | "bridge" | "blackout" | "petrol"; health?: number; heat?: number; hours?: number; intensity?: number; items?: object[]; kind?: "clear" | "overcast" | "rain" | "storm" | "fog" | "snow"; minutes?: number; mode?: "foot" | "car"; mods?: ("smoke" | "runFlats" | "caltrops" | "oil" | "bullBar" | "plating" | "hardened" | "nitro")[]; night?: boolean; on?: boolean; pace?: number; points?: number; profile?: string; road?: string; stars?: number; tune?: Record<string, number | boolean>; type: "debug"; unit?: "boat" | "apc" | "dart" | "grappler" | "helicopter" | "sniper" | "cannon" | "bike"; } | undefined

Defined in: packages/protocol/src/messages.ts:572

Parses a text frame as a debug command; undefined when it is not one.

Parameters ​

text ​

string

Returns ​

Type Literal ​

{ ahead?: number; carClass?: number; climate?: "none" | "temperate" | "meadow" | "forest" | "alpine" | "farmland" | "steppe" | "desert" | "autumn" | "coast"; cmd: "police" | "clock" | "give" | "invincible" | "maxHealth" | "chaos" | "weather" | "wanted" | "budget" | "tech" | "spawnChaser" | "clearChasers" | "teleport" | "pedestrian" | "carHealth" | "rtcDrop" | "fit" | "ignite" | "bust" | "halt" | "cop"; crew?: number; dispatcher?: boolean; event?: "riot" | "bridge" | "blackout" | "petrol"; health?: number; heat?: number; hours?: number; intensity?: number; items?: object[]; kind?: "clear" | "overcast" | "rain" | "storm" | "fog" | "snow"; minutes?: number; mode?: "foot" | "car"; mods?: ("smoke" | "runFlats" | "caltrops" | "oil" | "bullBar" | "plating" | "hardened" | "nitro")[]; night?: boolean; on?: boolean; pace?: number; points?: number; profile?: string; road?: string; stars?: number; tune?: Record<string, number | boolean>; type: "debug"; unit?: "boat" | "apc" | "dart" | "grappler" | "helicopter" | "sniper" | "cannon" | "bike"; }

ahead? ​

optional ahead?: number

carClass? ​

optional carClass?: number

climate? ​

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

cmd ​

cmd: "police" | "clock" | "give" | "invincible" | "maxHealth" | "chaos" | "weather" | "wanted" | "budget" | "tech" | "spawnChaser" | "clearChasers" | "teleport" | "pedestrian" | "carHealth" | "rtcDrop" | "fit" | "ignite" | "bust" | "halt" | "cop"

crew? ​

optional crew?: number

dispatcher? ​

optional dispatcher?: boolean

cop: the player plays the police as the dispatcher (orders at a point of the map).

event? ​

optional event?: "riot" | "bridge" | "blackout" | "petrol"

chaos: a chaos event set off now where the player stands (@foi/ai's chaos.ts, the simulation's bascules, substations and pumps): a riot round them, the nearest bridge raised, the nearest district blacked out, the nearest pumps lit.

health? ​

optional health?: number

heat? ​

optional heat?: number

hours? ​

optional hours?: number

intensity? ​

optional intensity?: number

items? ​

optional items?: object[]

give: items put in the player's inventory (the room's item ids, how many of each).

kind? ​

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

minutes? ​

optional minutes?: number

mode? ​

optional mode?: "foot" | "car"

mods? ​

optional mods?: ("smoke" | "runFlats" | "caltrops" | "oil" | "bullBar" | "plating" | "hardened" | "nitro")[]

fit: the upgrades fitted to the player's car (the simulation's MOD_SHOP ids).

night? ​

optional night?: boolean

on? ​

optional on?: boolean

pace? ​

optional pace?: number

points? ​

optional points?: number

budget: the room's public safety budget set outright (@foi/ai's BUDGET, points; none runs it dry).

profile? ​

optional profile?: string

road? ​

optional road?: string

stars? ​

optional stars?: number

tune? ​

optional tune?: Record<string, number | boolean>

type ​

type: "debug"

unit? ​

optional unit?: "boat" | "apc" | "dart" | "grappler" | "helicopter" | "sniper" | "cannon" | "bike"

police: a unit of the heavy response sent after the player now (@foi/ai's HEAVY_UNITS), at stars first when given; on, alone (the police send them nothing else).


undefined