Class RoomStateManager
Hierarchy
- EventBasedManager<RoomStateEvents>
- RoomStateManager (View Summary)
Accessors
allLocations
-
get allLocations(): number[]
Returns a list of all location ids for this slot.
Returns number[]
checkedLocations
-
get checkedLocations(): number[]
Returns a list of location ids that have been checked.
Returns number[]
games
-
get games(): string[]
Returns the list of games present in the current room.
Returns string[]
generatorVersion
-
get generatorVersion(): { build: number; major: number; minor: number }
hintCost
-
get hintCost(): number
Returns the amount of hint points this player needs to request a hint.
Returns number
hintCostPercentage
-
get hintCostPercentage(): number
Returns the percentage of locations that need to be checked to have enough points to hint from the server.
Returns number
hintPoints
-
get hintPoints(): number
Returns the amount of hint points this player currently has.
Returns number
locationCheckPoints
-
get locationCheckPoints(): number
Returns the amount of hint points received per location checked.
Returns number
missingLocations
-
get missingLocations(): number[]
Returns a list of location ids that have not been checked.
Returns number[]
password
-
get password(): boolean
Returns
trueif the room requires a password to join.Returns boolean
permissions
-
Returns the current room's command permission bitflags.
Returns PermissionTable
race
-
get race(): boolean
ExperimentalReturns if this seed was generated with race mode enabled (to be used to obscure unnecessary details to make clients race legal depending on rules).
Returns boolean
seedName
-
get seedName(): string
serverVersion
-
get serverVersion(): { build: number; major: number; minor: number }
tags
-
get tags(): string[]
Returns a list of tags the server is currently capable of.
Returns string[]
Methods
off
-
off<
Event extends
| "passwordUpdated"
| "permissionsUpdated"
| "locationCheckPointsUpdated"
| "hintCostUpdated"
| "hintPointsUpdated"
| "locationsChecked",
>(
event: Event,
listener: (...args: RoomStateEvents[Event]) => void,
): thisRemoves an existing event listener.
Type Parameters
- Event extends
| "passwordUpdated"
| "permissionsUpdated"
| "locationCheckPointsUpdated"
| "hintCostUpdated"
| "hintPointsUpdated"
| "locationsChecked"
Parameters
- event: Event
The event name associated with this listener to remove.
- listener: (...args: RoomStateEvents[Event]) => void
The callback function to remove.
Returns this
This object.
- Event extends
on
-
on<
Event extends
| "passwordUpdated"
| "permissionsUpdated"
| "locationCheckPointsUpdated"
| "hintCostUpdated"
| "hintPointsUpdated"
| "locationsChecked",
>(
event: Event,
listener: (...args: RoomStateEvents[Event]) => void,
): thisAdd an event listener for a specific event.
Type Parameters
- Event extends
| "passwordUpdated"
| "permissionsUpdated"
| "locationCheckPointsUpdated"
| "hintCostUpdated"
| "hintPointsUpdated"
| "locationsChecked"
Parameters
- event: Event
The event name to listen for.
- listener: (...args: RoomStateEvents[Event]) => void
The callback function to fire when this event is received.
Returns this
This object.
- Event extends
wait
-
wait<
Event extends
| "passwordUpdated"
| "permissionsUpdated"
| "locationCheckPointsUpdated"
| "hintCostUpdated"
| "hintPointsUpdated"
| "locationsChecked",
>(
event: Event,
clearPredicate?: (...args: RoomStateEvents[Event]) => boolean,
): Promise<RoomStateEvents[Event]>Returns a promise that waits for a single specified event to be received. Resolves with the list of arguments dispatched with the event.
Type Parameters
- Event extends
| "passwordUpdated"
| "permissionsUpdated"
| "locationCheckPointsUpdated"
| "hintCostUpdated"
| "hintPointsUpdated"
| "locationsChecked"
Parameters
- event: Event
The event name to listen for.
- clearPredicate: (...args: RoomStateEvents[Event]) => boolean = ...
An optional predicate to check on incoming events to validate if the correct event has been received. If omitted, will return immediately on next event type received.
Returns Promise<RoomStateEvents[Event]>
- Event extends
Managers room state information, notifies subscribers of changes, and exposes helper methods for interacting with the room.