Skip to content

five-on-it / apps/server/src/run-host / RunHost

Class: RunHost ​

Defined in: apps/server/src/run-host.ts:223

The run of a run's room: its phase, its seats, its result.

Constructors ​

Constructor ​

new RunHost(options): RunHost

Defined in: apps/server/src/run-host.ts:267

Parameters ​

options ​

RunHostOptions

Returns ​

RunHost

Properties ​

debugged ​

debugged: boolean = false

Defined in: apps/server/src/run-host.ts:249

A debug command was honoured in the room before it ended: the run pays nothing (its result's and its frame's debug).


phase ​

phase: "gathering" | "countdown" | "live" | "ended" = 'gathering'

Defined in: apps/server/src/run-host.ts:239

Its phase.


reported ​

reported: boolean = false

Defined in: apps/server/src/run-host.ts:263

Whether the platform took the result.


result ​

result: { debug?: boolean; forfeit?: boolean; missionHash: string; outcome: "complete" | "failed" | "abandoned" | "won" | "draw"; runId: string; seats: object[]; seconds: number; winner?: string; } | undefined

Defined in: apps/server/src/run-host.ts:247

The result, once it ended.


spec ​

readonly spec: object

Defined in: apps/server/src/run-host.ts:225

The run, its roster grown by the seats added under way.

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[]

Accessors ​

holds ​

Get Signature ​

get holds(): boolean

Defined in: apps/server/src/run-host.ts:348

Whether the cars are held: the run has not gone live yet.

Returns ​

boolean


live ​

Get Signature ​

get live(): boolean

Defined in: apps/server/src/run-host.ts:353

Whether the mission runs.

Returns ​

boolean

Methods ​

addSeat() ​

addSeat(seat): string | number

Defined in: apps/server/src/run-host.ts:317

A seat added to the run under way for a player the platform placed (joinInProgress): at the end of the roster, on its team, its player given RUN_TIMING.graceS to come. Returns its index, or why not: the run not live, the team with no seat open, the account on the roster already (a player who left their seat does not come back on another).

Parameters ​

seat ​
account ​

string = ...

name ​

string = ...

party? ​

string = ...

team ​

string = ...

tier? ​

number = ...

Returns ​

string | number


arrive() ​

arrive(seat, client): number | undefined

Defined in: apps/server/src/run-host.ts:415

A seat's player came in as client: present now. Returns the client that sat in it before when it had dropped (the missions take the seat over to the new one), else undefined.

Parameters ​

seat ​

number

client ​

number

Returns ​

number | undefined


clientIn() ​

clientIn(seat): number | undefined

Defined in: apps/server/src/run-host.ts:406

The client sitting in a seat now, if one is.

Parameters ​

seat ​

number

Returns ​

number | undefined


close() ​

close(): void

Defined in: apps/server/src/run-host.ts:590

The room closes under a run that has not ended: abandoned.

Returns ​

void


closing() ​

closing(): boolean

Defined in: apps/server/src/run-host.ts:574

Whether the room's time came: RUN_TIMING.closeAfterS after the result once the platform took it (or the reporting gave up, or .reportForS passed), or .noShowS after it was ready when nobody came.

Returns ​

boolean


debugUsed() ​

debugUsed(): boolean

Defined in: apps/server/src/run-host.ts:256

Marks the run as one where a debug command was honoured (for good: it pays nothing); whether this marked it now. Nothing once it ended: its result is made and maybe paid, and a command on its results screen changes neither its result nor its frame.

Returns ​

boolean


drop() ​

drop(client): void

Defined in: apps/server/src/run-host.ts:430

A seat's client left: the seat is dropped, its minute to come back running.

Parameters ​

client ​

number

Returns ​

void


ended() ​

ended(outcome): void

Defined in: apps/server/src/run-host.ts:585

The missions said the run ended (complete, or failed with its retries used up; won or a draw in versus): its result goes out.

Parameters ​

outcome ​

"complete" | "failed" | "won" | "draw"

Returns ​

void


excuse() ​

excuse(client): void

Defined in: apps/server/src/run-host.ts:469

A seat with nothing it may do (out of the run, watching a teammate) is not idling: it counts as active now, its idle clock started over.

Parameters ​

client ​

number

Returns ​

void


freeSeat() ​

freeSeat(team?): number | undefined

Defined in: apps/server/src/run-host.ts:376

The first seat nobody sits in (waiting for its player, or dropped), of a team when one is named: where a debug run puts a connection (debug-runs.ts); undefined when none is free or the run is over.

Parameters ​

team? ​

string

Returns ​

number | undefined


goneAccounts() ​

goneAccounts(): string[]

Defined in: apps/server/src/run-host.ts:390

The accounts whose seats are gone for good (their minute to come back out, or not come before the run went live): the room's status lists them, so the platform frees them for another run while this one plays on.

Returns ​

string[]


hit() ​

hit(byClient, targetClient, damage, killed, health?): void

Defined in: apps/server/src/run-host.ts:484

A hit between players: the damage a seat did to its teammate (of the teammate's health when full, 100 by default), and a teammate killed.

Parameters ​

byClient ​

number

targetClient ​

number

damage ​

number

killed ​

boolean

health? ​

number = 100

Returns ​

void


input() ​

input(client, input, at): void

Defined in: apps/server/src/run-host.ts:444

A seat's input of this tick and where its player stands (at): a change of its inputs keeps it from idling, and so does a key held that moves it once it has gone AFK_PROGRESS_M from where it was last active.

Parameters ​

client ​

number

input ​

VehicleInput

at ​

Spot

Returns ​

void


isLate() ​

isLate(seat): boolean

Defined in: apps/server/src/run-host.ts:338

Whether a seat was added while the run was under way (a late joiner's: it comes in where the run stands).

Parameters ​

seat ​

number

Returns ​

boolean


kicked() ​

kicked(account, outsideVoters, outsideInRoom): void

Defined in: apps/server/src/run-host.ts:500

The room voted an account out (room-social.ts): its seat's result says so, with the yes voters from outside its party (their accounts) and how many players outside it were in the room (what the platform's conduct counts).

Parameters ​

account ​

string

outsideVoters ​

readonly string[]

outsideInRoom ​

number

Returns ​

void


lateAccounts() ​

lateAccounts(): string[]

Defined in: apps/server/src/run-host.ts:333

The accounts of the seats added under way that are not gone: the room's status lists them (RoomStatus.late).

Returns ​

string[]


message() ​

message(client): object

Defined in: apps/server/src/run-host.ts:595

The run as one of its players reads it (client's own seat named).

Parameters ​

client ​

number | undefined

Returns ​

object

debug? ​

optional debug?: boolean

game ​

game: string

id ​

id: string

lives? ​

optional lives?: object

lives.count ​

count: number

lives.left? ​

optional left?: number

lives.per ​

per: "player" | "team"

mission ​

mission: string

mode? ​

optional mode?: "solo" | "coop" | "versus"

phase ​

phase: "gathering" | "countdown" | "live" | "ended"

playtest? ​

optional playtest?: boolean

result? ​

optional result?: object

result.forfeit? ​

optional forfeit?: boolean

result.outcome ​

outcome: "complete" | "failed" | "abandoned" | "won" | "draw"

result.seats ​

seats: object[]

result.seconds ​

seconds: number

result.winner? ​

optional winner?: string

retries ​

retries: object

retries.left ​

left: number

retries.total ​

total: number

seat? ​

optional seat?: number

seats ​

seats: object[]

startsIn? ​

optional startsIn?: number

teams? ​

optional teams?: object[]

title ​

title: string

type ​

type: "run"


openSeats() ​

openSeats(): OpenTeam[]

Defined in: apps/server/src/run-host.ts:300

The seats the run may fill now, team by team (none but while it is live, under its mission's joinInProgress): what its room's status advertises. A late seat whose player has not come yet holds its place.

Returns ​

OpenTeam[]


partyOf() ​

partyOf(account): string | undefined

Defined in: apps/server/src/run-host.ts:508

A seat's party (the platform's id), as the run's roster names it.

Parameters ​

account ​

string

Returns ​

string | undefined


poll() ​

poll(): RunPoll

Defined in: apps/server/src/run-host.ts:518

Moves the run on by the clock: the gathering to the countdown (every seat came, or its wait ran out), the countdown to live, a dropped seat's minute out (it is gone), and the run abandoned once nobody is present and nobody may come back. Says which clients to let go and whether the run just went live.

Returns ​

RunPoll


ready() ​

ready(): void

Defined in: apps/server/src/run-host.ts:343

The room is ready to admit its players (its world warmed up): the wait for a no-show starts now.

Returns ​

void


seatFor() ​

seatFor(account, seat?): number | undefined

Defined in: apps/server/src/run-host.ts:361

The seat an account may take: its own on the roster (the token's seat when it names one), unless it is gone for good or the run is over; undefined refuses it (4403).

Parameters ​

account ​

string

seat? ​

number

Returns ​

number | undefined


seatOf() ​

seatOf(client): number | undefined

Defined in: apps/server/src/run-host.ts:395

The seat a client sits in, if any.

Parameters ​

client ​

number

Returns ​

number | undefined


teamOf() ​

teamOf(seat): string | undefined

Defined in: apps/server/src/run-host.ts:401

A seat's team.

Parameters ​

seat ​

number

Returns ​

string | undefined