Static
FixedHow often a FixedUpdate should be called.
The code of the room.
The current start counter for the room.
Every end game intent that should happen in a queue to be or not to be canceled.
The first item of each element being the name of the end game intent and the second being metadata passed with it.
See RoomEndGameIntentEvent to cancel an end game intent, or see registerEndGameIntent to register your own.
See RoomGameEndEvent to listen for a game actually ending.
An instance of the game data in the room. Contains information about players such as their name, colour, hat etc.
It is possible for more than one game data to be spawned, however this property is set and cleared for simplicity.
See objectList if you're looking to find all game data objects that have been spawned.
The state that the game is currently in.
The ID of the host of the room.
An instance of the lobby behaviour in the room. Spawned when the room is currently in the lobby waiting for a game to start.
It is possible for more than one lobby behaviour to be spawned, however this property is set and cleared for simplicity.
See objectList if you're looking to find all lobby behaviour objects that have been spawned.
An instance of the meeting hud in the room. Spawned when a meeting is started.
It is possible for more than one meeting hud to be spawned, however this property is set and cleared for simplicity.
See objectList if you're looking to find all meeting hud objects that have been spawned.
The current message stream to be sent to the server on fixed update.
The networkable components in the room.
A list of all objects in the room.
The players in the room.
The privacy state of the room.
A map of spawn type -> objects used in the protocol. Useful to register custom INO (inner net objects) such as replicating behaviour from a client mod, see registerPrefab.
All roles that can be assigned to players. See registerRole.
The settings of the room.
An instance of the ship status in the room. Spawned when a game is started and represents the current map.
It is possible for more than one ship status to be spawned, however this property is set and cleared for simplicity.
See objectList if you're looking to find all ship status objects that have been spawned.
An instance of the voting ban system in the room. Used as a utility object for handling kick and ban votes.
It is possible for more than one vote ban system to be spawned, however this property is set and cleared for simplicity.
See objectList if you're looking to find all vote ban system objects that have been spawned.
Optional
payloads: BaseRootMessage[]Optional
include: (number | PlayerData<Hostable<any>>)[]Optional
exclude: (number | PlayerData<Hostable<any>>)[]Optional
reliable: booleanWhether or not this client/room is able to manage an object, i.e. perform host actions on it.
Whether or not the object can be managed by this client/room.
The object to manage.
Create a fake player in the room that doesn't need a client to be connected to own it.
To dispose of the player, use player.despawn()
.
The fake player created.
Optional
isNew: booleanWhether or not the player should be seen jumping off of the seat in the lobby.
Despawn a component.
room.despawnComponent(room.meetinghud);
The component being despawned.
Get a player by one of their components' netIds.
The player that was found, or null if they do not exist.
const player = room.getPlayerByNetId(34);
The net ID of the component of the player to search.
Get a player by their player ID.
The player that was found, or null if they do not exist.
const player = room.getPlayerByPlayerId(1);
The player ID of the player.
Handle when the game is ended.
The reason for why the game ended.
Handle when a client joins the game.
Handle when a client leaves the game.
The client that left the game.
Handle a client readying up.
The client that readied.
Register an intent to end the game.
The intention to end the game.
Register a custom INO spawn object by its spawn type. Can also override built-in objects.
The spawn type of the component as an integer.
The components in the object. The first component should be the main object which will inherit the rest of the components.
Resolve a player by some identifier.
The resolved player.
// Resolve a player by their client id.
const player = room.resolvePlayer(11013);
The identifier to resolve to a player.
Resolve a client id by some identifier.
The resolved client ID.
The identifier to resolve to a client ID.
Resolve a player ID by some identifier.
The resolved player ID.
The identifier to resolve to a player ID.
Set the host of the room. If the current client is the host, it will conduct required host changes. e.g. Spawning objects if they are not already spawned.
The new host of the room.
Change the the privacy of the room.
room.setAlterGameTag(AlterGameTag.ChangePrivacy, 1); // 0 for private, 1 for public.
Change the settings of the room. If the host, it will broadcast these changes.
room.syncSettings({
crewmateVision: 0.5,
votingTime: 120
});
The settings to set to (Can be partial).
Spawn a component (Not broadcasted to all clients, see spawnPrefabOfType).
const meetinghud = new MeetingHud(
this,
this.getNextNetId(),
ownerId,
{
dirtyBit: 0,
states: new Map(),
}
);
this.spawnComponent(meetinghud);
The component being spawned.
Spawn a prefab of an object.
The object that was spawned.
room.spawnPrefab(SpawnType.Player, client.myPlayer);
The type of object to spawn.
Optional
flags: numberOptional
componentData: any[]Optional
doBroadcast: booleanOptional
doAwake: booleanOptional
config: HostableOptionsThe host of the room.
Whether or not the current client is the host of the room.
The current client in the room.
Generated using TypeDoc
Represents an object capable of hosting games.
See HostableEvents for events to listen to.