ReadonlycurrentReadonlygameThe original object that holds the game state information. Returns null if game is not active.
ReadonlyspeedThe current speed of the simulation.
ReadonlystateAn object containing all information about the current room state.
Removes the last 2 players from spectators and adds them to opposite teams in order using a fake identity.
Id of the player who changed the teams of these players.
void.
Frees the resources that are used by this object.
void.
Applies an event to the current room state. For example; the event object may come from a ReplayData structure,
or from a onOperationReceived(type, msg, globalFrameNo, clientFrameNo, customData) callback.
The event message to apply.
void.
Extrapolates the current room state and sets the ext variables inside
original objects to their newly calculated extrapolated states. Normally
designed to be used in renderers.
The time to extrapolate the state for in milliseconds.
The extrapolated room state.
Initializes the sandbox. (Should only be called if delayedInit is true.)
void.
Returns whether the replay recorder is active or not.
true if replay recording is active; false otherwise.
Kicks/bans a player using a fake identity.
Id of the desired player to be kicked/banned.
Reason of kicking/banning.
null, this event is interpreted as the player leaving by himself/herself.Whether this is a banning event or not.
Id of the player who kicked/banned the player.
void.
Sends a chat message as a player.
The chat message to be sent.
Id of the player who sent this message.
void.
Sets the current key state of a player.
The desired key state of the player.
Id of the player whose key state is being set.
void.
Adds a new player to the room.
Id of the new player.
Name of the new player.
Flag of the new player.
Avatar of the new player.
Connection string of the new player.
Auth of the new player.
void.
Removes a player from the room.
Id of the player to be removed.
void.
Creates and applies a fake event by player(byId) to remove all of the players whose ids exist in the array playerIdList, and add them back in the given order to the top or bottom of the player list depending on the moveToTop value.
The ids of players that are desired to be removed from the room's players list, reordered to match the order in idList and added back to the room's players list.
Whether to add the players to the top or bottom of the room's players list.
This value must always be 0.
void.
Runs the simulation count steps. Simulation should be stopped for this function to work as expected.
Number of steps to run the simulation.
void.
Sends an announcement message to a player.
The contents of the announcement message.
The color of the announcement message. Range: -1 <= color < 16777216.
Utils.numberToColor function.-1 means transparent color.The style of the announcement message. Must be one of the following:
The sound of the announcement message. Must be one of the following:
Id of the player who will receive this announcement. If this value is null, the announcement is sent to everyone.
This value must always be 0.
void.
Triggers a fake binary custom event using a fake identity.
The type of the custom event.
Any custom binary data for this specific event.
Id of the player who triggered this custom binary event.
void.
Triggers a fake custom event using a fake identity.
The type of the custom event.
The data of the custom event. (Any JSON object)
Id of the player who triggered this custom event.
void.
Sets the ping values of all players.
The desired ping values for all players.
This value must always be 0.
void.
Sets the current stadium using a fake identity.
The desired stadium value.
The fake id of the player who changed this stadium.
void.
Sets the properties of a disc.
Id of the disc whose properties are desired to be set.
The type of this operation.
0: discId is actually the id of a disc.1: discId is actually the id of a player.The desired properties to set. This will not change the omitted keys of the disc. properties has the following structure:
x: number | null: The desired x coordinate of the disc.y: number | null: The desired y coordinate of the disc.xspeed: number | null: The desired x component of the speed of the disc.yspeed: number | null: The desired y component of the speed of the disc.xgravity: number | null: The desired x component of the gravity of the disc.ygravity: number | null: The desired y component of the gravity of the disc.radius: number | null: The desired radius of the disc.bCoeff: number | null: The desired bouncing coefficient of the disc.invMass: number | null: The desired inverse mass of the disc.damping: number | null: The desired damping of the disc.color: int | null: The desired color of the disc.cMask: int | null: The desired collision mask of the disc.cGroup: int | null: The desired collision group of the disc.This value must always be 0.
void.
Pauses/resumes the game using a fake identity.
The desired pausedness value of the game.
true: Pauses the game, if it is not already paused.false: Resumes the game, if it is not already resumed.Id of the player who paused/resumed the game.
void.
Sets the current player's key state. (added for compatibility with normal rooms.)
The desired key state.
void.
Sets the room's kick rate limit using a fake identity.
The desired min value of kick rate limit.
The desired rate value of kick rate limit.
The desired burst value of kick rate limit.
Id of the player who set the kick rate limit of the room.
void.
Gives/takes away the admin status of a player using a fake identity.
Id of the player whose admin status is being set.
The desired admin status of the player.
true: Give admin rights to the player.false: Take away admin rights from the player.Id of the player who set the admin status of the player.
void.
Sets the avatar of a player.
The desired avatar value.
Id of the player whose avatar is being set.
void.
Sets the chat indicator status of a player.
The desired chat indicator status.
Id of the player whose chat indicator status is being set.
void.
Triggers a fake identity event using a fake identity.
Id of the player whose identity data is being changed.
The new identity data.
Signature of the identity data.
Id of the player who triggered this identity event.
void.
Set the synchronization status of a player.
The desired synchronization status.
Id of the player whose synchronization status is being set.
void.
Moves a player to a team using a fake identity.
Id of the player whose team is desired to be changed.
Id of the desired team.
Id of the player who changed the team of this player.
void.
Sets the game's score limit using a fake identity.
The desired score limit of the game.
Id of the player who set the game's score limit.
void.
Changes the speed of the simulation.
The desired speed coefficient. Must be a real number >=0. Meaning of possible value ranges is as follows:
void.
Sets the colors of a team using a fake identity.
Id of the team whose colors are desired to be changed.
1: red.2: blue.The angle of stripes. (in degrees)
Minimum 2, maximum 4 numeric (0 <= integer <= 16777215) color strings.
Id of the player who set the colors of the team.
void.
Locks/unlocks the teams using a fake identity.
The desired teams lock value of the game.
Id of the player who set the game's teams lock value.
void.
Sets the game's time limit using a fake identity.
The desired time limit of the game.
Id of the player who set the game's time limit.
void.
Starts the game using a fake identity.
Id of the player who started the game.
void.
Start recording replay. Recording should be stopped before calling this.
true if succeeded, false otherwise.
Stops the game using a fake identity.
Id of the player who stopped the game.
void.
Stop recording replay. Recording should be started before calling this.
The recorded replay data if succeeded, null otherwise.
Returns a complete snapshot of the current room state.
The snapshot copy of the current RoomState object.
Generates a copy of the given RoomState and sets the current room state reference to the generated RoomState.
The RoomState to use. Should be created by takeSnapshot() first.
void.
This is a read-only property that always returns 0. It is only added for compatibility with renderers. (And it is only used in the initialization code of renderers.)