five-on-it / apps/server/src/rooms / openRoomFromRequest
Function: openRoomFromRequest()
openRoomFromRequest(
host,request,fetchArtifact?,moderateAt?):Promise<Room>
Defined in: apps/server/src/rooms.ts:377
Opens the room an API request asks for: fetches its artifact, brings an older one up to this release's formats, checks the game against its level and the vehicle classes, opens it; or, for a level that ships (bundled), its own level and bundled game. A run's room plays its run. Throws (with a message for the API) when the artifact cannot be fetched, is not one, was built by a newer release line or of newer formats, its game fails a check, the level is none that ships with a game, or the run names a mission or a team the game lacks.
Parameters
host
request
artifactUrl?
string = ...
bundled?
string = ...
id
string = ...
maxPlayers
number = ...
moderationUrl?
string = ...
run?
{ game: string; id: string; mission: string; playtest?: boolean; reportToken: string; reportUrl: string; seats: object[]; teams: string[]; } = ...
run.game
string = ...
run.id
string = ...
run.mission
string = ...
run.playtest?
boolean = ...
run.reportToken
string = ...
run.reportUrl
string = ...
run.seats
object[] = ...
run.teams
string[] = ...
title
string = ...
fetchArtifact?
(url) => Promise<unknown>
moderateAt?
(url, text) => Promise<boolean>
Returns
Promise<Room>