ReadonlyisReadonlycurrentCurrent player's id.
ReadonlycurrentThe current Player object.
ReadonlystateThe object that holds the whole room state.
ReadonlystateThe object that holds the whole extrapolated room state. Returns null if no extrapolated data is available yet.
ReadonlygameThe object that holds the game state information. Returns null if game is not active.
ReadonlygameThe object that holds the extrapolated game state information. Returns null if game is not active or no extrapolated data is available yet.
ReadonlysdpSession description value of the room's WebRTC connection. (only for client rooms)
ReadonlyconfigThe current roomConfig object.
ReadonlyrendererThe current renderer object.
ReadonlypluginsArray of all available plugins. This is used internally to restore the order of plugins while a plugin is being activated/deactivated.
ReadonlypluginsAll available plugins mapped as pluginsMap[plugin.name] = plugin, for meaningful communication between addons inside our custom addon codes.
ReadonlylibrariesArray of all available libraries.
ReadonlylibrariesAll available libraries mapped as librariesMap[library.name] = library, for meaningful communication between addons inside our custom addon codes.
ReadonlynameThe name of the room. read-only.
ReadonlyguiGui-related values of the room. read-only.
ReadonlylinkThe url of the room. read-only.
ReadonlytimeThe game's current time limit. read-only.
ReadonlyscoreThe game's current score limit. read-only.
ReadonlystadiumThe stadium object of the room. read-only.
ReadonlyplayersThe list of players in the room. read-only.
ReadonlyredRed team's current score. null if game is not active. read-only.
ReadonlyblueBlue team's current score. null if game is not active. read-only.
ReadonlytimeElapsed time in current game. null if game is not active. read-only.
ReadonlycurrentThe current frame number of the room. read-only.
ReadonlybanThe current list of banned players. read-only. host-only.
ReadonlypasswordThe current password of the room. read-only. host-only.
ReadonlygeoThe current geolocation of the room. read-only. host-only.
ReadonlymaxThe current maximum number of players of the room. read-only. host-only.
ReadonlyfakeThe current fake password value of the room. read-only. host-only.
ReadonlyfixedThe current fixed player count value of the room. read-only. host-only.
ReadonlyshowWhether the room is currently being shown in the room list of the backend server or not. read-only. host-only.
ReadonlyunlimitedWhether the room's player count checking is disabled or not. read-only. host-only.
ReadonlyhideWhether to hide the owner of this room or not. read-only. host-only.
The current recaptcha token of the room. If changed, it will also refresh the room link. host-only.
The current join-recaptcha status of the room. host-only.
For a host room, can be true. For a client room, can be a callback function with parameters hostRoomState and clientRoomState. (Look at https://github.com/wxyz-abcd/mooball/tree/main/examples/other/compareStates.js for the default implementation of desync checking.) This callback is called whenever a desync occurs if the host room's debugDesync value is also true. Defaults to null.
Leaves the current room. Also releases the resources used by this object.
void.
Sets the room's properties. Only room host can use this function.
An object that might have the following keys: (You might omit any key if you don't want to change its value.)
name: string | null: The desired name of the current room.password: string | null: The desired password of the current room, or null to clear the password.geo: GeoLocation | null: The desired geolocation of the current room.playerCount: int | null: An integer value to fix the player count of the current room to that number, or null to return to normal behaviour. Original Mooball backend has the current restriction about this value: 0 <= playerCount <= 30. If the room does not satisfy this, it is not shown in the room list.maxPlayerCount: int | null: The maximum player count value of the current room. Original Mooball backend has the current restriction about this value: 0 <= maxPlayerCount <= 30. If the room does not satisfy this, it is not shown in the room list.fakePassword: boolean | null: If set to true or false, the room will set its password-protected status to your value. Passing null disables this behaviour.unlimitedPlayerCount: boolean: If set to true, bypasses the player count checks, resulting in unlimited maximum player count. However, the default backend will not show the room in the room list if the player count > 30.showInRoomList: boolean: Whether to show this room in the room list or not.tintColor: uint32: Background tint color(to show in room list) of this room.thumbnail: string: Thumbnail(to show in room list) of this room.hideIdentity: booolean: Whether to hide the owner of this room or not.void.
Sets the kick rate limit of the current room. admins-only.
The desired min value of kick rate limit. 0 <= min <= 255.
The desired rate value of kick rate limit. 0 <= rate <= 255.
The desired burst value of kick rate limit. 0 <= burst <= 100.
void.
Sets the current player's handicap value.
The desired handicap value in msecs. 0 <= handicap <= 300.
void.
Bans a player from joining the room. host-only.
Id of the player to ban.
Id of the new ban entry if successful, otherwise null.
Bans all given auth(s) from joining the room. host-only.
The auth(s) to ban.
An array that contains; for each auth parameter in the given order, the id of the new ban entry if successful, otherwise null.
Removes the ban entry with the given id. host-only.
Id of the ban entry to remove.
True if the ban entry was removed, otherwise false.
Clears all bans. host-only.
void.
Clears the ban of a player. host-only.
Id of the player whose ban will be cleared.
void.
Executes any event inside this room. host-only.
The event to be executed.
Id of the player of whom this event will be executed by.
void.
Sends any event to the target player. If targetId is null; works the same as executeEvent.
CAUTION: It will probably cause "intentional" desync for most events. host-only.
The event to be sent.
Id of the player to whom this event will be sent to.
void.
Clears the event queue. Can be useful when the game engine is stuck.
void.
Sets the current player's client avatar value.
The desired avatar value. avatar.length must be <= 2.
void.
Sets the avatar to value for the player whose id is id. host-only.
Id of the player whose avatar is being changed.
The desired avatar value. avatar.length must be <= 2.
If true, sets the headless avatar. Otherwise, sets the client avatar.
void.
Sets the current player's chat indicator status.
true activates the chat indicator, false deactivates it.
void.
Sets the team colors for the team whose id is teamId. admins-only.
Id of the team whose colors are desired to be changed. Can either be 1(red) or 2(blue).
The desired angle of stripes. Should be between -180 and 180.
Minimum 2, maximum 4 numeric (0 <= integer <= 16777215) color parameters. First parameter is the text color, and the others are stripe colors.
void.
When a player joins the room, the engine is first checking whether the current player count>=room's maximum player count value. This function enables or disables this check. host-only.
Whether the unlimited player count feature is desired to be active or not.
void.
Fakes Mooball's backend by directly modifying the password-protectedness of the room. host-only.
If fakePwd is true or false, the room will set its password-protected status to the passed fakePwd value regardless of the room's actual password value. Passing null returns to default behaviour. host-only.
void.
Sends a chat message.
The message that is desired to be sent. msg.length must be <= 140.
If null, the message is sent to everyone; otherwise, only the player whose id is targetId will receive this chat message. host-only.
void.
Sends an announcement message. host-only.
The announcement message that is desired to be sent. msg.length must be <= 1000.
OptionaltargetId: numberIf null, the message is sent to everyone; otherwise, only the player whose id is targetId will receive this announcement. Default value = null.
Optionalcolor: numberThe desired color of the announcement. Range: -1 <= color < 16777216. Default value = -1.
Utils.numberToColor function.-1 means transparent.Optionalstyle: stringThe desired font style of the announcement. Default value = "normal". Must be one of the following:
normal: use document's default font style.bold: fontWeight = "bold".italic: fontStyle = "italic".small: fontSize = "12px".small-bold: fontWeight = "bold", fontSize = "12px".small-italic: fontWeight = "italic", fontSize = "12px".Optionalsound: numberThe desired sound of the announcement. Default value = 1. Must be one of the following:
0: no sound.1: chat sound.2: highlight sound.void.
Sets the properties of a disc. host-only.
Id of the disc whose properties are desired to be set.
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: Desired x component of the speed of the disc.yspeed: number | null: Desired y component of the speed of the disc.xgravity: number | null: Desired x component of the gravity of the disc.ygravity: number | null: 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.void.
Sets the desired disc properties of any player. host-only.
Id of the player whose disc properties are desired to be changed.
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: Desired x component of the speed of the disc.yspeed: number | null: Desired y component of the speed of the disc.xgravity: number | null: Desired x component of the gravity of the disc.ygravity: number | null: 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.void.
Removes all of the players whose ids exist in the array playerIdList, and adds them back in the given order to the top or bottom of the player list depending on the moveToTop value. host-only.
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.
void.
Creates a CustomEvent event message with given type and data properties and sends it. The values type and data completely depend on your custom event's order and logic.
The type of the custom event.
Any custom data for this specific event. This is converted to a string via JSON.stringify while being serialized.
OptionaltargetId: numberIf given, sends this event only to the player with this id if the player is using this modified client.
void.
Creates a BinaryCustomEvent event message with given type and data properties and sends it. The values type and data completely depend on your custom event's order and logic.
The type of the binary custom event.
Any custom binary data for this specific event.
OptionaltargetId: numberIf given, sends this event only to the player with this id if the player is using this modified client.
void.
Creates an IdentityEvent event message with given player id and data properties and sends it. This event sets playerObject.identity value to the given data object for all clients.
Id of the player whose identity data is being changed.
The new identity data.
Signature of the identity data.
OptionaltargetId: numberIf given, sends this event only to the player with this id if the player is using this modified client.
void.
Returns the current player's key state value.
An integer between 0 and 31 inclusive.
Sets the current player's key state value.
The desired key state value. 0 <= state <= 31.
Optionalinstant: booleanIf true, sends the event immediately. This is introduced later to reduce input lag. Default value = true.
void.
Starts the game. admin-only.
void.
Stops the game. admin-only.
void.
Pauses or resumes the game. admin-only.
void.
Returns true if game is paused.
void.
Removes the last two players from spectators and adds them to consecutive teams. The first is always added to red, the second is always blue. If there is only one player, it is added to a random team. admin-only.
void.
Locks or unlocks the ability for non-admin players to change teams while the game is not active. admin-only.
void.
Moves every player to the spectators team. admin-only.
void.
Removes the last two players from the spectators team and adds them to consecutive teams. The first is added to a random team, the second is added to the rival of the first team, etc. If there is only one player, it is added to a random team. admin-only.
void.
Moves every player in a team to the spectators team. admin-only.
Id of the team whose whose players will be moved to the spectators team.
void.
Sets the synchronization status of the current player.
The desired synchronization status.
void.
Sets the current stadium to stadium. The game must be stopped first. admin-only.
The desired stadium to be set as the room's current stadium.
void.
Sets the time limit of the room. The game must be stopped first. admin-only.
The desired time limit. 0 <= value <= 99. 0 means unlimited.
void.
Sets the score limit of the room. The game must be stopped first. admin-only.
The desired score limit. 0 <= value <= 99. 0 means unlimited.
void.
Moves the current player to the team whose id is teamId. This operation is blocked by default if the current player is not admin and (the game is active or teams are locked).
Id of the team that is desired to join.
void.
Moves a player to a different team. admin-only.
Id of the player to be moved to a different team.
Id of the team to move the player to.
void.
Give/take away admin rights to/from a player. admin-only.
Id of the player who will have his/her admin rights changed.
Whether the player is desired to have admin rights or not.
void.
Kicks or bans a player.
Id of the player who is being kicked/banned.
The kick/ban reason. If null, it is interpreted as he/she leaving by himself/herself, and the ban value is ignored in that case.
If true, the player is being banned; otherwise, the player is being kicked.
void.
Returns the Player object for the player whose id is id.
Id of the player.
A Player object.
Returns the ball disc.
Optionalextrapolated: booleanDefaults to false.
true: return the latest extrapolated version if available, otherwise the original version.false: return the original version.A Disc object.
Returns the disc array of the current room.
Optionalextrapolated: booleanDefaults to false.
true: return the latest extrapolated version if available, otherwise the original version.false: return the original version.An array that consists of Disc objects.
Returns the disc whose id is discId.
Id of the disc to be returned.
Optionalextrapolated: booleanDefaults to false.
true: return the latest extrapolated version if available, otherwise the original version.false: return the original version.A Disc object.
Returns the disc that belongs to the player whose id is playerId.
Id of the player whose disc is to be returned.
Optionalextrapolated: booleanDefaults to false.
true: return the latest extrapolated version if available, otherwise the original version.false: return the original version.A Disc object.
Returns the disc that belongs to the player whose id is playerId. Faster than getPlayerDisc, but experimental. Use at your own risk.
Id of the player whose disc is to be returned.
A Disc object.
Activate or deactivate the plugin whose name is name.
Name of the plugin that is desired to be activated/deactivated.
Whether to activate(active = true) the plugin or to deactivate(active = false) it.
void.
Start recording replay. Recording should be stopped before calling this.
true if succeeded, false otherwise.
Stop recording replay. Recording should be started before calling this.
The recorded replay data if succeeded, null otherwise.
Start streaming the game. Streaming and recording should be stopped before calling this. (Currently, recording and streaming cannot be run simultaneously)
Optionalparams: StartStreamingParamsThe parameters required for the streaming to work.
A StartStreamingReturnValue structure if succeeded, or null otherwise.
Stop streaming the game. Streaming should be started before calling this.
void.
Returns whether the replay recorder is active or not.
true if replay recording is active; false otherwise.
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. Defaults to 0.
Whether to allow multiple calls in the same game tick. Should be true only while using it inside a renderer's render function. Defaults to false.
The extrapolated room state.
Sets the RoomConfig object that contains all the main callbacks of this room.
The new RoomConfig instance to be replaced with the room's current one.
void.
Adds all callbacks in roomConfig into the room's current RoomConfig object. If there is a callback with the same name, a new callback is created that calls both of them. (The current callback is called first.)
The RoomConfig object to be mixed with the current room's RoomConfig object.
void.
Adds the pluginObj at the end of the plugins list, initializes and activates it if necessary.
The Plugin object to be added.
void.
Moves the Plugin at the specified pluginIndex to the index newIndex.
The index of the plugin that will be moved to a new index.
The new index that the plugin is desired to be at.
void.
Replaces the Plugin at the specified pluginIndex with the newPluginObj plugin. The old plugin is deactivated and finalized and the new plugin is initialized. If the old plugin was active before, the new plugin is also activated. The names of the plugins must be the same.
The index of the plugin that is about to be replaced with the new Plugin object.
The new Plugin object that will replace the old one.
void.
Removes the pluginObj from the plugins list, deactivates and finalizes it if necessary.
The Plugin object to be removed.
void.
Sets the Renderer object that will render the game. If exists, the old renderer is finalized and the new renderer is initialized.
The new Renderer object that will replace the old one.
void.
Adds the libraryObj at the end of the libraries list and initializes it.
The Library object to be added.
void.
Moves the Library at the specified libraryIndex to the index newIndex.
The index of the library that will be moved to a new index.
The new index that the library is desired to be at.
void.
Replaces the Library at the specified libraryIndex with the newLibraryObj library. The old library is finalized and the new library is initialized. The names of the libraries must be the same.
The index of the library that is about to be replaced with the new Library object.
The new Library object that will replace the old one.
void.
Removes the libraryObj from the libraries list and finalizes it.
The Library object to be removed.
void.
Returns a snapshot of the current room state. You can load this object directly into sandbox using its useSnapshot(roomState) function. Note that the values stored here are the currently active values, not the static and stored ones.
The snapshot copy of the current room's state.
Sends a custom connection error string to a client. Shortly after this operation, the connection to the client will be lost, and the error will appear on the client's screen. This function must be called just after the client has joined the room, otherwise it will most likely fail.
Id of the player that is expected to leave the room.
The error message that the client will see on screen.
The snapshot copy of the current room's state.
OptionalonThe room link was received from moo-hoo.com. Called some time after a room is created successfully. Also called when your room stops sending signal to moo-hoo.com, and starts it again after some time. This can happen if your connection gets interrupted or the room somehow becomes unstable due to bugs.
The room link that was just received.
void or a custom data to pass to the next callback.
OptionalonThe room link was received from moo-hoo.com. Called some time after a room is created successfully. Also called when your room stops sending signal to moo-hoo.com, and starts it again after some time. This can happen if your connection gets interrupted or the room somehow becomes unstable due to bugs.
The room link that was just received.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonCalled just after all bans have been cleared using room.clearBans().
void or a custom data to pass to the next callback.
OptionalonCalled just after all bans have been cleared using room.clearBans().
OptionalcustomData: anyvoid.
OptionalonCalled just after the ban of a player has been cleared using room.clearBan(id).
Id of the player whose ban has just been cleared.
void or a custom data to pass to the next callback.
OptionalonCalled just after the ban of a player has been cleared using room.clearBan(id).
Id of the player whose ban has just been cleared.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonCalled just after the room's recaptcha mode was changed using room.requireRecaptcha = value.
The new value; whether to request recaptcha or not while joining the room.
void or a custom data to pass to the next callback.
OptionalonCalled just after the room's recaptcha mode was changed using room.requireRecaptcha = value.
The new value; whether to request recaptcha or not while joining the room.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonCalled just a little after the room's token was changed using room.token = value.
The new token of the room.
void or a custom data to pass to the next callback.
OptionalonCalled just a little after the room's token was changed using room.token = value.
The new token of the room.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonCalled just after an announcement was made by the room host.
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:
void or a custom data to pass to the next callback.
OptionalonCalled just after an announcement was made by the room host.
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:
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonCalled just after a player has changed his/her headless avatar.
Id of the player who triggered this event.
The new headless avatar value.
void or a custom data to pass to the next callback.
OptionalonCalled just after a player has changed his/her headless avatar.
Id of the player who triggered this event.
The new headless avatar value.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonCalled just after the order of players have been changed.
The ids of players that were removed from the room's players list, reordered to match the order in idList and added back to the room's players list.
The ids of players that were 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.
void or a custom data to pass to the next callback.
OptionalonCalled just after the order of players have been changed.
The ids of players that were removed from the room's players list, reordered to match the order in idList and added back to the room's players list.
The ids of players that were 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.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonCalled just after a disc's properties have been modified.
The id of player or disc whose disc properties have changed.
The type of object. Must be one of the following:
Must consist of the following properties of the disc in the same order: [x, y, xspeed, yspeed, xgravity, ygravity, radius, bCoeff, invMass, damping].
Must consist of the following properties of the disc in the same order: [color, cMask, cGroup].
void or a custom data to pass to the next callback.
OptionalonCalled just after a disc's properties have been modified.
The id of player or disc whose disc properties have changed.
The type of object. Must be one of the following:
Must consist of the following properties of the disc in the same order: [x, y, xspeed, yspeed, xgravity, ygravity, radius, bCoeff, invMass, damping].
Must consist of the following properties of the disc in the same order: [color, cMask, cGroup].
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonCalled just after the ping values for all players have been updated.
The updated list of ping values for each player in the same order as the player list in the current room's RoomState object.
void or a custom data to pass to the next callback.
OptionalonCalled just after the ping values for all players have been updated.
The updated list of ping values for each player in the same order as the player list in the current room's RoomState object.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonCalled just after the room's properties have been changed, and just before any other callback has been called.
The properties that were changed. The current structure of this object is as follows:
props = {
name: string | null,
password: string | null,
fakePassword: boolean | null,
geo: GeoLocation | null,
playerCount: int | null,
maxPlayerCount: int | null
}
Note that only the changed keys will show up in props.
void or a custom data to pass to the next callback.
OptionalonCalled just after the room's properties have been changed.
The properties that were changed. The current structure of this object is as follows:
props = {
name: string | null,
password: string | null,
fakePassword: boolean | null,
geo: GeoLocation | null,
playerCount: int | null,
maxPlayerCount: int | null
}
Note that only the changed keys will show up in props.
*
OptionalcustomData: anythe custom data that was returned from the previous callback. * *
void.
OptionalonCalled just after room.runDefaultGameLogic has changed.
Whether the default game logic is active(1) or passive(0).
void or a custom data to pass to the next callback.
OptionalonCalled just after room.runDefaultGameLogic has changed.
Whether the default game logic is active(1) or passive(0).
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after an announcement has been sent using the improved announcement api.
The announcement message. ( max length = 1000 )
OptionalcssVar: stringThe cssVar of the announcement message.
Optionalsound: stringThe sound of the announcement message.
OptionaltargetId: numberId of the player who will receive this announcement. If this value is null, the announcement is sent to everyone.
void or a custom data to pass to the next callback.
OptionalonCalled just after an announcement has been sent using the improved announcement api.
The announcement message. ( max length = 1000 )
OptionalcssVar: stringThe cssVar of the announcement message.
Optionalsound: stringThe sound of the announcement message.
OptionaltargetId: numberId of the player who will receive this announcement. If this value is null, the announcement is sent to everyone.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the current skin(textureId) of a player has been updated.
Id of the player whose skin will be modified.
New skin value of the player.
void or a custom data to pass to the next callback.
OptionalonCalled just after the current skin(textureId) of a player has been updated.
Id of the player whose skin will be modified.
New skin value of the player.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the cssVar attribute of a player has been changed.
Id of the player whose cssVar will be modified.
New cssVar value of the player.
void or a custom data to pass to the next callback.
OptionalonCalled just after the cssVar attribute of a player has been changed.
Id of the player whose cssVar will be modified.
New cssVar value of the player.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after a new stadium object has been added.
Type of the object to be added.
An object that is supposed to contain all parameters required to add that type of object.
void or a custom data to pass to the next callback.
OptionalonCalled just after a new stadium object has been added.
Type of the object to be added.
An object that is supposed to contain all parameters required to add that type of object.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after an existing stadium object has been updated.
Type of the object to be updated.
Id of the object to be updated.
An object that is supposed to contain all parameters required to update that type of object.
void or a custom data to pass to the next callback.
OptionalonCalled just after an existing stadium object has been updated.
Type of the object to be updated.
Id of the object to be updated.
An object that is supposed to contain all parameters required to update that type of object.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after an existing stadium object has been removed.
Type of the object to be removed.
Id of the object to be removed.
void or a custom data to pass to the next callback.
OptionalonCalled just after an existing stadium object has been removed.
Type of the object to be removed.
Id of the object to be removed.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the game clock has been paused/resumed.
Whether the game will be paused(1) or resumed(0).
void or a custom data to pass to the next callback.
OptionalonCalled just after the game clock has been paused/resumed.
Whether the game will be paused(1) or resumed(0).
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after room.directionActive has been changed.
New directionActive value.
void or a custom data to pass to the next callback.
OptionalonCalled just after room.directionActive has been changed.
New directionActive value.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the energy of an individual player has been altered manually.
Id of the player whose energy values will be modified.
New values. Order of values is supposed to be: [energy, kEnergyGain, kEnergyDrain]. null means no change for each value.
void or a custom data to pass to the next callback.
OptionalonCalled just after the energy of an individual player has been altered manually.
Id of the player whose energy values will be modified.
New values. Order of values is supposed to be: [energy, kEnergyGain, kEnergyDrain]. null means no change for each value.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after game input controls have been modified.
Type of the operation. (0: add, 1: remove)
Parameters for the specific operation.
void or a custom data to pass to the next callback.
OptionalonCalled just after game input controls have been modified.
Type of the operation. (0: add, 1: remove)
Parameters for the specific operation.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the current contents of a css variable has been altered.
Name of the css variable..
New value of the css variable.
void or a custom data to pass to the next callback.
OptionalonCalled just after the current contents of a css variable has been altered.
Name of the css variable..
New value of the css variable.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after a custom sound has been played.
Name of the sound to be played.
void or a custom data to pass to the next callback.
OptionalonCalled just after a custom sound has been played.
Name of the sound to be played.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the name of the room has been changed.
The new room name.
void or a custom data to pass to the next callback.
OptionalonCalled just after the name of the room has been changed.
The new room name.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the current elapsed time has been changed.
New elapsed time value.
void or a custom data to pass to the next callback.
OptionalonCalled just after the current elapsed time has been changed.
New elapsed time value.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the current max goal ticks has been changed.
New max goal ticks value.
void or a custom data to pass to the next callback.
OptionalonCalled just after the current max goal ticks has been changed.
New max goal ticks value.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the current max pause ticks has been changed.
New max pause ticks value.
void or a custom data to pass to the next callback.
OptionalonCalled just after the current max pause ticks has been changed.
New max pause ticks value.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the current max end ticks has been changed.
New max end ticks value.
void or a custom data to pass to the next callback.
OptionalonCalled just after the current max end ticks has been changed.
New max end ticks value.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the current team scores has been changed.
Id of the team whose score is desired to be changed.
New score for the team.
void or a custom data to pass to the next callback.
OptionalonCalled just after the current team scores has been changed.
Id of the team whose score is desired to be changed.
New score for the team.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the ping value of the current player has been calculated.
the instant ping value at that moment
the calculated average ping value in a period of time
the calculated maximum ping value in a period of time
void or a custom data to pass to the next callback.
OptionalonCalled just after the ping value of the current player has been calculated.
the instant ping value at that moment
the calculated average ping value in a period of time
the calculated maximum ping value in a period of time
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonCalled just after the ball has been kicked.
Id of the player who kicked the ball.
void or a custom data to pass to the next callback.
OptionalonCalled just after the ball has been kicked.
Id of the player who kicked the ball.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonOptionalonCalled just after a goal has been scored.
Id of the team that scored the goal.
Id of the goal object that the ball went in.
The goal object that the ball went in.
Id of the ball disc that caused the goal.
The ball disc that caused the goal.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonCalled just after the game has ended.
Id of the team that has won the game.
void or a custom data to pass to the next callback.
OptionalonCalled just after the game has ended.
Id of the team that has won the game.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonCalled just after a game tick has occurred. This will run a lot of times per second. Be careful not to make too many calculations here, otherwise the game might slow down.
void or a custom data to pass to the next callback.
OptionalonCalled just after a game tick has occurred. This will run a lot of times per second. Be careful not to make too many calculations here, otherwise the game might slow down.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonCalled just after a kick-off event has occurred.
void or a custom data to pass to the next callback.
OptionalonCalled just after a kick-off event has occurred.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonCalled just after the game has ended by timeout.
void or a custom data to pass to the next callback.
OptionalonCalled just after the game has ended by timeout.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonCalled just after the player positions have been reset. This event happens just after a new game has been started or a goal has been scored. The player positions are reset to their corresponding spawn points defined in the current room's Stadium object.
void or a custom data to pass to the next callback.
OptionalonCalled just after the player positions have been reset. This event happens just after a new game has been started or a goal has been scored. The player positions are reset to their corresponding spawn points defined in the current room's Stadium object.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonCalled just after a collision has happened between two discs.
Id of the first collided disc.
The player's id that the first disc belongs to. If the disc is not a player's disc, this value will be null.
Id of the second collided disc.
The player's id that the second disc belongs to. If the disc is not a player's disc, this value will be null.
void or a custom data to pass to the next callback.
OptionalonCalled just after a collision has happened between two discs.
Id of the first collided disc.
The player's id that the first disc belongs to. If the disc is not a player's disc, this value will be null.
Id of the second collided disc.
The player's id that the second disc belongs to. If the disc is not a player's disc, this value will be null.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonCalled just after a collision has happened between a disc and a segment.
Id of the collided disc.
The player's id that the disc belongs to. If the disc is not a player's disc, this value will be null.
Id of the collided segment.
void or a custom data to pass to the next callback.
OptionalonCalled just after a collision has happened between a disc and a segment.
Id of the collided disc.
The player's id that the disc belongs to. If the disc is not a player's disc, this value will be null.
Id of the collided segment.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonCalled just after a collision has happened between a disc and a plane.
Id of the collided disc.
The player's id that the disc belongs to. If the disc is not a player's disc, this value will be null.
Id of the collided plane.
void or a custom data to pass to the next callback.
OptionalonCalled just after a collision has happened between a disc and a plane.
Id of the collided disc.
The player's id that the disc belongs to. If the disc is not a player's disc, this value will be null.
Id of the collided plane.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonCalled just after the local ping handicap value has been changed.
The new ping handicap value in milliseconds. Range: 0 <= value <= 300.
void or a custom data to pass to the next callback.
OptionalonCalled just after the local ping handicap value has been changed.
The new ping handicap value in milliseconds. Range: 0 <= value <= 300.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonCalled just after room recording has been started or stopped.
If true, recording has just been started,
value as an ArrayBuffer. You might want to write the contents to a version-3 replay file.void or a custom data to pass to the next callback.
OptionalonCalled just after room recording has been started or stopped.
If true, recording has just been started,
value as an ArrayBuffer. You might want to write the contents to a version-3 replay file.OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonCalled just after a plugin has been activated or deactivated.
The plugin which was activated or deactivated. This property stores the current activation status of the plugin: plugin.active.
void or a custom data to pass to the next callback.
OptionalonCalled just after a plugin has been activated or deactivated.
The plugin which was activated or deactivated. This property stores the current activation status of the plugin: plugin.active.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonCalled just after the room's config object has been replaced by a new one.
The old RoomConfig object.
The new RoomConfig object.
void or a custom data to pass to the next callback.
OptionalonCalled just after the room's config object has been replaced by a new one.
The old RoomConfig object.
The new RoomConfig object.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonOptionalonOptionalonCalled just after a plugin object has been added.
The Plugin object.
void or a custom data to pass to the next callback.
OptionalonCalled just after a plugin object has been added.
The Plugin object.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonOptionalonOptionalonCalled just after a plugin object has been removed.
The Plugin object.
void or a custom data to pass to the next callback.
OptionalonCalled just after a plugin object has been removed.
The Plugin object.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonCalled just after a library object has been added.
The Library object.
void or a custom data to pass to the next callback.
OptionalonCalled just after a library object has been added.
The Library object.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonCalled just after a library object has been moved.
The Library object.
void or a custom data to pass to the next callback.
OptionalonCalled just after a library object has been moved.
The Library object.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonOptionalonOptionalonCalled just after a library object has been removed.
The Library object.
void or a custom data to pass to the next callback.
OptionalonCalled just after a library object has been removed.
The Library object.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonCalled just after the API's language has been changed.
The new language's abbreviation value.
void or a custom data to pass to the next callback.
OptionalonCalled just after the API's language has been changed.
The new language's abbreviation value.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonCalled just after the value of a variable has been changed.
The Addon object that the variable belongs to.
The name of the variable whose value has been changeed.
The old value of the variable.
The new value of the variable.
void or a custom data to pass to the next callback.
OptionalonCalled just after the value of a variable has been changed.
The Addon object that the variable belongs to.
The name of the variable whose value has been changeed.
The old value of the variable.
The new value of the variable.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonCalled just after a player's synchronization status has changed.
Id of the player whose synchronization status has changed.
The new synchronization status.
void or a custom data to pass to the next callback.
OptionalonCalled just after a player's synchronization status has changed.
Id of the player whose synchronization status has changed.
The new synchronization status.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonCalled just after an "auto" event has been triggered to automatically move at least one, at most two players from spectators to teams.
Id of the first player affected by this event.
Id of the team which the first player was moved into.
Id of the second player affected by this event, or null if there was only one spectator when this event was triggered.
Id of the team which the second player was moved into, or null if there was only one spectator when this event was triggered.
Id of the player who has triggered the event.
void or a custom data to pass to the next callback.
OptionalonCalled just after an "auto" event has been triggered to automatically move at least one, at most two players from spectators to teams.
Id of the first player affected by this event.
Id of the team which the first player was moved into.
Id of the second player affected by this event, or null if there was only one spectator when this event was triggered.
Id of the team which the second player was moved into, or null if there was only one spectator when this event was triggered.
Id of the player who has triggered the event.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonCalled just after the score limit has been changed.
The new score limit value.
Id of the player who has triggered this event.
void or a custom data to pass to the next callback.
OptionalonCalled just after the score limit has been changed.
The new score limit value.
Id of the player who has triggered this event.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonCalled just after the time limit has been changed.
The new time limit value.
Id of the player who has triggered this event.
void or a custom data to pass to the next callback.
OptionalonCalled just after the time limit has been changed.
The new time limit value.
Id of the player who has triggered this event.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonCalled just after room's overtime limit has been changed.
The desired overtime limit of the game.
void or a custom data to pass to the next callback.
OptionalonCalled just after room's overtime limit has been changed.
The desired overtime limit of the game.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonCalled just after the direction of an individual player was changed. room.state.directionActive must be true for this to work.
Id of the player whose energy values will be modified.
New direction value of the player.
void or a custom data to pass to the next callback.
OptionalonCalled just after the direction of an individual player was changed. room.state.directionActive must be true for this to work.
Id of the player whose energy values will be modified.
New direction value of the player.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonCalled just after a player's admin rights have been given/taken.
Id of the player whose admin rights have been given/taken.
The new admin rights status of the player whose id is id.
Id of the player who has triggered this event.
void or a custom data to pass to the next callback.
OptionalonCalled just after a player's admin rights have been given/taken.
Id of the player whose admin rights have been given/taken.
The new admin rights status of the player whose id is id.
Id of the player who has triggered this event.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonCalled just after a player has changed his/her avatar.
Id of the player who has changed his/her avatar.
The new avatar value.
void or a custom data to pass to the next callback.
OptionalonCalled just after a player has changed his/her avatar.
Id of the player who has changed his/her avatar.
The new avatar value.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonCalled just after a player has been moved to a different team.
Id of the player who has been moved to a different team.
Id of the player's new team.
Id of the player who has triggered this event.
void or a custom data to pass to the next callback.
OptionalonCalled just after a player has been moved to a different team.
Id of the player who has been moved to a different team.
Id of the player's new team.
Id of the player who has triggered this event.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonCalled just after the room's current stadium has been changed.
The room's new Stadium object.
Id of the player who has triggered this event.
void or a custom data to pass to the next callback.
OptionalonCalled just after the room's current stadium has been changed.
The room's new Stadium object.
Id of the player who has triggered this event.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonCalled just after the room's teams have been locked/unlocked.
The room's new teams lock value.
Id of the player who has triggered this event.
void or a custom data to pass to the next callback.
OptionalonCalled just after the room's teams have been locked/unlocked.
The room's new teams lock value.
Id of the player who has triggered this event.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonCalled just after a player object has been created. This callback can be used to define custom properties inside all player objects.
The new Player object that has just been created.
void or a custom data to pass to the next callback.
OptionalonCalled just after a player object has been created. This callback can be used to define custom properties inside all player objects.
The new Player object that has just been created.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonCalled just after a disc object has been assigned to a player object.
The new Player object that has just been assigned a disc object.
void or a custom data to pass to the next callback.
OptionalonCalled just after a disc object has been assigned to a player object.
The new Player object that has just been assigned a disc object.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonCalled just after a disc object has been removed from a player object.
The Player object whose disc object has just been removed.
void or a custom data to pass to the next callback.
OptionalonCalled just after a disc object has been removed from a player object.
The Player object whose disc object has just been removed.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonCalled just after a player has joined the room.
The data representation of the player that has just joined the room.
void or a custom data to pass to the next callback.
OptionalonCalled just after a player has joined the room.
The data representation of the player that has just joined the room.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonCalled just after the game has been paused or resumed.
Whether the game has been paused or not.
Id of the player who has triggered this event.
void or a custom data to pass to the next callback.
OptionalonCalled just after the game has been paused or resumed.
Whether the game has been paused or not.
Id of the player who has triggered this event.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonCalled just after a chat message has been received.
Id of the player who has sent the chat message.
The chat message.
void or a custom data to pass to the next callback.
OptionalonCalled just after a chat message has been received.
Id of the player who has sent the chat message.
The chat message.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonCalled just after a player's input has been changed.
Id of the player whose input has been changed.
The new input value of the player.
void or a custom data to pass to the next callback.
OptionalonCalled just after a player's input has been changed.
Id of the player whose input has been changed.
The new input value of the player.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonCalled just after a player has activated or deactivated his/her chat indicator. This happens when a player focuses/loses focus on the chat input component in the website.
Id of the player whose chat indicator has been activated/deactivated.
Whether the chat indicator has been activated or not.
void or a custom data to pass to the next callback.
OptionalonCalled just after a player has activated or deactivated his/her chat indicator. This happens when a player focuses/loses focus on the chat input component in the website.
Id of the player whose chat indicator has been activated/deactivated.
Whether the chat indicator has been activated or not.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonCalled just after a player has left the room.
The player who has left the room.
The reason of leaving the room. If null, the player has left by himself/herself.
Whether the player has been banned or not. If reason is null, this value is ignored.
Id of the player who has kicked/banned the player. If reason is null, this value is ignored.
void or a custom data to pass to the next callback.
OptionalonCalled just after a player has left the room.
The player who has left the room.
The reason of leaving the room. If null, the player has left by himself/herself.
Whether the player has been banned or not. If reason is null, this value is ignored.
Id of the player who has kicked/banned the player. If reason is null, this value is ignored.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonCalled just after a team's colors have been changed.
The team whose colors have been changed.
The new team colors value.
Id of the player who has changed the team colors.
void or a custom data to pass to the next callback.
OptionalonCalled just after a team's colors have been changed.
The team whose colors have been changed.
The new team colors value.
Id of the player who has changed the team colors.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonCalled just after the room's kick rate limit has been changed.
The new min part of kick rate limit.
The new rate part of kick rate limit.
The new burst part of kick rate limit.
Id of the player who has changed the kick rate limit.
void or a custom data to pass to the next callback.
OptionalonCalled just after the room's kick rate limit has been changed.
The new min part of kick rate limit.
The new rate part of kick rate limit.
The new burst part of kick rate limit.
Id of the player who has changed the kick rate limit.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonCalled just after the game has been started.
Id of the player who has started the game.
void or a custom data to pass to the next callback.
OptionalonCalled just after the game has been started.
Id of the player who has started the game.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalonCalled just after the game has been stopped.
Id of the player who has stopped the game.
void or a custom data to pass to the next callback.
OptionalonCalled just after the game has been stopped.
Id of the player who has stopped the game.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void.
OptionalmodifyCalled just before the player has joined the room. Using this callback, you may block all players or modify all players' name, flag and avatar properties just before they join the room.
Id of the new player who is about to join the room.
Name of the new player who is about to join the room.
Country code of the new player who is about to join the room.
Avatar of the new player who is about to join the room.
Connection string of the new player who is about to join the room.
Auth string of the new player who is about to join the room.
null: Blocks the player from joining the room.
[[modifiedName: string, modifiedFlag: string, modifiedAvatar: string], customData: any]: Modifies the name, flag and avatar values.Promise<[[modifiedName: string, modifiedFlag: string, modifiedAvatar: string], customData: any]>: Modifies the name, flag and avatar values after the promise might be resolved.OptionalmodifyCalled just before the player has joined the room. Using this callback, you may block all players or modify all players' name, flag and avatar properties just before they join the room.
Id of the new player who is about to join the room.
Name of the new player who is about to join the room.
Country code of the new player who is about to join the room.
Avatar of the new player who is about to join the room.
Connection string of the new player who is about to join the room.
Auth string of the new player who is about to join the room.
OptionalcustomData: anyAny custom data that might be returned from the previous addon's calback.
null: Blocks the player from joining the room.
[modifiedName: string, modifiedFlag: string, modifiedAvatar: string]: Modifies the name, flag and avatar values.Promise<[modifiedName: string, modifiedFlag: string, modifiedAvatar: string]>: Modifies the name, flag and avatar values after the promise might be resolved.OptionalmodifyIf defined, runs for all players except host in a host room. Modifies the ping value of the player whose id is playerId.
Host player's ping will not change using this callback. In order to change host player's ping, you need to modify room.hostPing value directly.
Id of the current player.
Current ping value of the current player.
The new ping value of the current player.
OptionalmodifyIf defined, runs for all players except host in a host room. Modifies the ping value of the player whose id is playerId.
Host player's ping will not change using this callback. In order to change host player's ping, you need to modify room.hostPing value directly.
Id of the current player.
Current ping value of the current player.
OptionalcustomData: anyAny custom data that might be returned from the previous addon's calback.
The new ping value of the current player.
OptionalmodifyIf defined, runs only for the current player in a client room and modifies its ping value.
Current ping value of the current player.
The new ping value of the current player.
OptionalmodifyIf defined, runs only for the current player in a client room and modifies its ping value.
Current ping value of the current player.
OptionalcustomData: anyAny custom data that might be returned from the previous addon's calback.
The new ping value of the current player.
OptionalonIf defined, runs for each message received from all clients in a host room, before they are processed and sent to all clients. This is the most important callback inside a host room; all permission logic should reside here. You are also allowed to freely modify the contents of all messages here.
Type of the received message. We have to look it up in the global OperationType object to understand what type of message it actually is.
The original message object. We can directly modify all contents of this object here as we wish.
The global frame no that host's physics engine is at, at the time that the message is received.
The frame no that this client's physics engine is at, at the time that the message is received.
true: accept event.
false: block message from being processed.throw exception: break the connection of the sender of this message.OptionalonIf defined, runs for each message received from all clients in a host room, before they are processed and sent to all clients. This is the most important callback inside a host room; all permission logic should reside here. You are also allowed to freely modify the contents of all messages here.
Type of the received message. We have to look it up in the global OperationType object to understand what type of message it actually is.
The original message object. We can directly modify all contents of this object here as we wish.
The global frame no that host's physics engine is at, at the time that the message is received.
The frame no that this client's physics engine is at, at the time that the message is received.
OptionalcustomData: anyAny custom data that might be returned from the previous addon's calback.
true: accept event.
false: block message from being processed.throw exception: break the connection of the sender of this message.OptionalonCalled just after a custom event has been triggered.
Any integer value to hold the type of the custom event.
Any JSON object to store the properties of the custom event. This object is converted to a string and sent/received by Mooball's original event mechanism.
Id of the player who has triggered this custom event.
void or a custom data to pass to the next callback.
OptionalonCalled just after a custom event has been triggered.
Any integer value to hold the type of the custom event.
Any JSON object to store the properties of the custom event. This object is converted to a string and sent/received by Mooball's original event mechanism.
Id of the player who has triggered this custom event.
OptionalcustomData: anyAny custom data that might be returned from the previous addon's calback.
void.
OptionalonCalled just after a binary custom event has been triggered.
Any integer value to hold the type of the custom event.
Any Uint8Array to store the properties of the custom event. This object is directly sent/received by Mooball's original event mechanism.
Id of the player who has triggered this custom event.
void or a custom data to pass to the next callback.
OptionalonCalled just after a binary custom event has been triggered.
Any integer value to hold the type of the custom event.
Any Uint8Array to store the properties of the custom event. This object is directly sent/received by Mooball's original event mechanism.
Id of the player who has triggered this custom event.
OptionalcustomData: anyAny custom data that might be returned from the previous addon's calback.
void.
OptionalonCalled just after an identity event has been triggered.
Id of the player whose identity data is desired to be changed.
The identity data that should be received from the backend. It can be any JSON object.
Id of the player who has triggered this custom event.
void or a custom data to pass to the next callback.
OptionalonCalled just after an identity event has been triggered.
Id of the player whose identity data is desired to be changed.
The identity data that should be received from the backend. It can be any JSON object.
Id of the player who has triggered this custom event.
OptionalcustomData: anyAny custom data that might be returned from the previous addon's calback.
void.
OptionalonThe room link was received from moo-hoo.com. Called some time after a room is created successfully. Also called when your room stops sending signal to moo-hoo.com, and starts it again after some time. This can happen if your connection gets interrupted or the room somehow becomes unstable due to bugs.
The room link that was just received.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after all bans have been cleared using room.clearBans().
OptionalcustomData: anyvoid or a custom data to pass to the next callback.
OptionalonCalled just after the ban of a player has been cleared using room.clearBan(id).
Id of the player whose ban has just been cleared.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the room's recaptcha mode was changed using room.requireRecaptcha = on.
The new value; whether to request recaptcha or not while joining the room.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just a little after the room's token was changed using room.token = value.
The new token of the room.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after an announcement was made by the room host.
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:
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after a player has changed his/her headless avatar.
Id of the player who triggered this event.
The new headless avatar value.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the order of players have been changed.
The ids of players that were removed from the room's players list, reordered to match the order in idList and added back to the room's players list.
The ids of players that were 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.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after a disc's properties have been modified.
The id of player or disc whose disc properties have changed.
The type of object. Must be one of the following:
Must consist of the following properties of the disc in the same order: [x, y, xspeed, yspeed, xgravity, ygravity, radius, bCoeff, invMass, damping].
Must consist of the following properties of the disc in the same order: [color, cMask, cGroup].
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the ping values for all players have been updated.
The updated list of ping values for each player in the same order as the player list in the current room's RoomState object.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the room's properties have been changed.
The properties that were changed. The current structure of this object is as follows:
props = {
name: string | null,
password: string | null,
fakePassword: boolean | null,
geo: GeoLocation | null,
playerCount: int | null,
maxPlayerCount: int | null
}
Note that only the changed keys will show up in props.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after room.runDefaultGameLogic has changed.
Whether the default game logic is active(1) or passive(0).
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after an announcement has been sent using the improved announcement api.
The announcement message. ( max length = 1000 )
OptionalcssVar: stringThe cssVar of the announcement message.
Optionalsound: stringThe sound of the announcement message.
OptionaltargetId: numberId of the player who will receive this announcement. If this value is null, the announcement is sent to everyone.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the current skin(textureId) of a player has been updated.
Id of the player whose skin will be modified.
New skin value of the player.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the cssVar attribute of a player has been changed.
Id of the player whose cssVar will be modified.
New cssVar value of the player.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after a new stadium object has been added.
Type of the object to be added.
An object that is supposed to contain all parameters required to add that type of object.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after an existing stadium object has been updated.
Type of the object to be updated.
Id of the object to be updated.
An object that is supposed to contain all parameters required to update that type of object.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after an existing stadium object has been removed.
Type of the object to be removed.
Id of the object to be removed.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the game clock has been paused/resumed.
Whether the game will be paused(1) or resumed(0).
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after room.directionActive has been changed.
New directionActive value.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the energy of an individual player has been altered manually.
Id of the player whose energy values will be modified.
New values. Order of values is supposed to be: [energy, kEnergyGain, kEnergyDrain]. null means no change for each value.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after game input controls have been modified.
Type of the operation. (0: add, 1: remove)
Parameters for the specific operation.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the current contents of a css variable has been altered.
Name of the css variable..
New value of the css variable.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after a custom sound has been played.
Name of the sound to be played.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the name of the room has been changed.
The new room name.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the current elapsed time has been changed.
New elapsed time value.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the current max goal ticks has been changed.
New max goal ticks value.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the current max pause ticks has been changed.
New max pause ticks value.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the current max end ticks has been changed.
New max end ticks value.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the current team scores has been changed.
Id of the team whose score is desired to be changed.
New score for the team.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the ping value of the current player has been calculated.
the instant ping value at that moment
the calculated average ping value in a period of time
the calculated maximum ping value in a period of time
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the ball has been kicked.
Id of the player who kicked the ball.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after a goal has been scored.
Id of the team that scored the goal.
Id of the goal object that the ball went in.
The goal object that the ball went in.
Id of the ball disc that caused the goal.
The ball disc that caused the goal.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the game has ended.
Id of the team that won the game.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after a game tick has occurred. This will run a lot of times per second. Be careful not to make too many calculations here, otherwise the game might slow down.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after a kick-off event has occurred.
OptionalcustomData: anyvoid or a custom data to pass to the next callback.
OptionalonCalled just after the game has ended by timeout.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the player positions have been reset. This event happens just after a new game has been started or a goal has been scored. The player positions are reset to their corresponding spawn points defined in the current room's Stadium object.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after a collision has happened between two discs.
Id of the first collided disc.
The player's id that the first disc belongs to. If the disc is not a player's disc, this value will be null.
Id of the second collided disc.
The player's id that the second disc belongs to. If the disc is not a player's disc, this value will be null.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after a collision has happened between a disc and a segment.
Id of the collided disc.
The player's id that the disc belongs to. If the disc is not a player's disc, this value will be null.
Id of the collided segment.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after a collision has happened between a disc and a plane.
Id of the collided disc.
The player's id that the disc belongs to. If the disc is not a player's disc, this value will be null.
Id of the collided plane.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the local ping handicap value has been changed.
The new ping handicap value in milliseconds. Range: 0 <= value <= 300.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after room recording has been started or stopped.
If true, recording has just been started,
value as an ArrayBuffer. You might want to write the contents to a version-3 replay file.OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after a plugin has been activated or deactivated.
The plugin which was activated or deactivated. This property stores the current activation status of the plugin: plugin.active.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the room's config object has been replaced by a new one.
The old RoomConfig object.
The new RoomConfig object.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the room's renderer object has been replaced by a new one.
void or a custom data to pass to the next callback.
OptionalonCalled just after a plugin object has been added.
The Plugin object.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after a plugin object has been moved.
The Plugin object.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after an old plugin object has been replaced by a new one.
void or a custom data to pass to the next callback.
OptionalonCalled just after a plugin object has been removed.
The Plugin object.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after a library object has been added.
The Library object.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after a library object has been moved.
The Library object.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after an old library object has been replaced by a new one.
void or a custom data to pass to the next callback.
OptionalonCalled just after a library object has been removed.
The Library object.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the API's language has been changed.
The new language's abbreviation value.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the value of a variable has been changed.
The Addon object that the variable belongs to.
The name of the variable whose value has been changeed.
The old value of the variable.
The new value of the variable.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after a player's synchronization status has changed.
Id of the player whose synchronization status has changed.
The new synchronization status.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after an "auto" event has been triggered to automatically move at least one, at most two players from spectators to teams.
Id of the first player affected by this event.
Id of the team which the first player was moved into.
Id of the second player affected by this event, or null if there was only one spectator when this event was triggered.
Id of the team which the second player was moved into, or null if there was only one spectator when this event was triggered.
Id of the player who has triggered the event.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the score limit has been changed.
The new score limit value.
Id of the player who has triggered this event.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the time limit has been changed.
The new time limit value.
Id of the player who has triggered this event.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after room's overtime limit has been changed.
The desired overtime limit of the game.
OptionalcustomData: anyvoid or a custom data to pass to the next callback.
OptionalonCalled just after the direction of an individual player was changed. room.state.directionActive must be true for this to work.
Id of the player whose energy values will be modified.
New direction value of the player.
OptionalcustomData: anyvoid or a custom data to pass to the next callback.
OptionalonCalled just after a player's admin rights have been given/taken.
Id of the player whose admin rights have been given/taken.
The new admin rights status of the player whose id is id.
Id of the player who has triggered this event.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after a player has changed his/her avatar.
Id of the player who has changed his/her avatar.
The new avatar value.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after a player has been moved to a different team.
Id of the player who has been moved to a different team.
Id of the player's new team.
Id of the player who has triggered this event.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the room's current stadium has been changed.
The room's new Stadium object.
Id of the player who has triggered this event.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the room's teams have been locked/unlocked.
The room's new teams lock value.
Id of the player who has triggered this event.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after a player object has been created. This callback can be used to define custom properties inside all player objects.
The new Player object that has just been created.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after a disc object has been assigned to a player object.
The new Player object that has just been assigned a disc object.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after a disc object has been removed from a player object.
The Player object whose disc object has just been removed.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after a player has joined the room.
The data representation of the player that has just joined the room.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the game has been paused or resumed.
Whether the game has been paused or not.
Id of the player who has triggered this event.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after a chat message has been received.
Id of the player who has sent the chat message.
The chat message.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after a player's input has been changed.
Id of the player whose input has been changed.
The new input value of the player.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after a player has activated or deactivated his/her chat indicator. This happens when a player focuses/loses focus on the chat input component in the website.
Id of the player whose chat indicator has been activated/deactivated.
Whether the chat indicator has been activated or not.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after a player has left the room.
The player who has left the room.
The reason of leaving the room. If null, the player has left by himself/herself.
Whether the player has been banned or not. If reason is null, this value is ignored.
Id of the player who has kicked/banned the player. If reason is null, this value is ignored.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after a team's colors have been changed.
The team that colors have been changed.
The new team colors value.
Id of the player who has changed the team colors.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the room's kick rate limit has been changed.
The new min part of kick rate limit.
The new rate part of kick rate limit.
The new burst part of kick rate limit.
Id of the player who has changed the kick rate limit.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the game has been started.
Id of the player who has started the game.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the game has been stopped.
Id of the player who has stopped the game.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalmodifyCalled just before the player has joined the room. Using this callback, you may block all players or modify all players' name, flag and avatar properties just before they join the room.
Id of the new player who is about to join the room.
Name of the new player who is about to join the room.
Country code of the new player who is about to join the room.
Avatar of the new player who is about to join the room.
Connection string of the new player who is about to join the room.
Auth string of the new player who is about to join the room.
OptionalcustomData: anynull: Blocks the player from joining the room.
[modifiedName: string, modifiedFlag: string, modifiedAvatar: string]: Modifies the name, flag and avatar values.Promise<[modifiedName: string, modifiedFlag: string, modifiedAvatar: string]>: Modifies the name, flag and avatar values after the promise might be resolved.(sync)
this.modifyPlayerData = function(playerId, name, flag, avatar, conn, auth){
if (name=="abc")
return null; // block anyone trying to join the room with name "abc", before he can join the room.
return [
"[" + playerId + "] " + name, // prefix everyone's name with [playerId]
"tr", // set everyone's flag to tr
avatar // do not change avatars
];
};
(async)
this.modifyPlayerData = async function(playerId, name, flag, avatar, conn, auth){
// connect to whatever database you want
var dbPlayerSpecs = await db.getPlayerSpecs(conn, auth);
if (!dbPlayerSpecs)
return null; // blocked.
return [
"[" + playerId + "] {" + dbPlayerSpecs.name + "}" + name, // prefix everyone's name with [playerId] and then player's name in the database.
dbPlayerSpecs.flag, // always use player's flag in the database.
dbPlayerSpecs.avatar // always use player's avatar in the database.
];
};
OptionalmodifyIf defined, runs for all players except host in a host room. Modifies the ping value of the player whose id is playerId.
Host player's ping will not change using this callback. In order to change host player's ping, you need to modify room.hostPing value directly.
Id of the current player.
Current ping value of the current player.
OptionalcustomData: anyThe new ping value of the current player.
OptionalmodifyIf defined, runs only for the current player in a client room and modifies its ping value.
Current ping value of the current player.
OptionalcustomData: anyThe new ping value of the current player.
OptionalonIf defined, runs for each message received from all clients in a host room, before they are processed and sent to all clients. This is the most important callback inside a host room; all permission logic should reside here. You are also allowed to freely modify the contents of all messages here.
Type of the received message. We have to look it up in the global OperationType object to understand what type of message it actually is.
The original message object. We can directly modify all contents of this object here as we wish.
The global frame no that host's physics engine is at, at the time that the message is received.
The frame no that this client's physics engine is at, at the time that the message is received.
OptionalcustomData: anytrue: accept event.
false: block message from being processed.throw exception: break the connection of the sender of this message.this.onOperationReceived = function(type, msg, globalFrameNo, clientFrameNo, customData){
switch (type){
case OperationType.KickBanPlayer: { // if someone is leaving or being kicked/banned by someone else
var reason = msg.reason; // get the reason. this is null if the player is leaving by himself/herself.
if (reason!=null && playerId!=0) // if any player sends a kick/ban event message other than room host
return false; // block the event message
break;
}
}
return true;
};
OptionalonCalled just after a custom event has been triggered.
Any integer value to hold the type of the custom event.
Any JSON object to store the properties of the custom event. This object is converted to a string and sent/received by Mooball's original event mechanism.
Id of the player who has triggered this custom event.
OptionalcustomData: anyAny custom data that might be returned from the previous addon's calback.
void or a custom data to pass to the next callback.
OptionalonCalled just after a binary custom event has been triggered.
Any integer value to hold the type of the custom event.
Any Uint8Array to store the properties of the custom event. This object is directly sent/received by Mooball's original event mechanism.
Id of the player who has triggered this custom event.
OptionalcustomData: anyAny custom data that might be returned from the previous addon's calback.
void or a custom data to pass to the next callback.
OptionalonCalled just after an identity event has been triggered.
Id of the player whose identity data is desired to be changed.
The identity data that should be received from the backend. It can be any JSON object.
Id of the player who has triggered this custom event.
OptionalcustomData: anyAny custom data that might be returned from the previous addon's calback.
void or a custom data to pass to the next callback.
Returns all current game objects in hbs/json format. Note that the values written here are the currently active values, not the static and stored ones.
A json object that represents all objects in the current stadium.
Creates a vertex object in memory and returns it.
An object with the following structure:
x: number: The x component of the position of the new vertex.y: number: The y component of the position of the new vertex.bCoef: number | null: The bouncing coefficient of the new vertex.cMask: string[] | null: The collision mask of the new vertex.cGroup: string[] | null: The collision group of the new vertex.A Vertex object.
Creates a segment object in memory using vertex indices and returns it. The vertices must exist at the given indices in the vertices array of the current room.
An object with the following structure:
v0: int: Index of the first vertex of the new segment.v1: int: Index of the second vertex of the new segment.color: "transparent" | string | [r: int, g: int, b: int] | null: Color of the new segment.bias: number | null: Bias of the new segment.curve: number | null: Curve of the new segment. (unit: angles)curveF: number | null: Curve of the new segment. (unit: radians) While modifying this, the engine does not update some values. Only use this if you know what you are doing.vis: boolean | null: Visibility of the new segment.bCoef: number | null: Bouncing coefficient of the new segment.cMask: string[] | null: Collision mask of the new segment.cGroup: string[] | null: Collision group of the new segment.A Segment object.
Creates a segment object in memory using vertex objects and returns it.
An object with the following structure:
v0: Vertex: First vertex of the new segment.v1: Vertex: Second vertex of the new segment.color: "transparent" | string | [r: int, g: int, b: int] | null: Color of the new segment.bias: number | null: Bias of the new segment.curve: number | null: Curve of the new segment. (unit: angles)curveF: number | null: Curve of the new segment. (unit: radians) While modifying this, the engine does not update some values. Only use this if you know what you are doing.vis: boolean | null: Visibility of the new segment.bCoef: number | null: Bouncing coefficient of the new segment.cMask: string[] | null: Collision mask of the new segment.cGroup: string[] | null: Collision group of the new segment.A Segment object.
Creates a goal object in memory and returns it.
An object with the following structure:
p0: [x: number, y: number]: The starting point of the new goal object.p1: [x: number, y: number]: The ending point of the new goal object.team: "red" | "blue": The team of the new goal object.A Goal object.
Creates a plane object in memory and returns it.
An object with the following structure:
normal: [x: number, y: number]: The normal of the new plane. This value is normalized automatically.dist: number: The distance of the new plane to the origin(0,0).bCoef: number | null: The bouncing coefficient of the new plane.cMask: string[] | null: The collision mask of the new plane.cGroup: string[] | null: The collision group of the new plane.A Plane object.
Creates a disc object in memory and returns it.
An object with the following structure:
pos: [x: number, y: number]: The position of the new disc.speed: [x: number, y: number] | null: The speed of the new disc.gravity: [x: number, y: number] | null: The gravity (acceleration) of the new disc.radius: number: The radius of the new disc.invMass: number | null: The inverse mass of the new disc.damping: number | null: The damping of the new disc.color: "transparent" | string | [r: int, g: int, b: int] | null: The color of the new disc.bCoef: number | null: The bouncing coefficient of the new disc.cMask: string[] | null: The collision mask of the new disc.cGroup: string[] | null: The collision group of the new disc.A Disc object.
Creates a joint object in memory using disc indices and returns it.
An object with the following structure:
d0: int: The first disc index of the new joint.d1: int: The second disc index of the new joint.color: "transparent" | string | [r: int, g: int, b: int] | null: The color of the new joint.strength: "rigid" | number | null: The strengh of the new joint.length: number | [min: number, max: number] | null: The length of the new joint.A Joint object.
Creates a joint object in memory using disc objects and returns it.
An object with the following structure:
d0: Disc: The first disc of the new joint.d1: Disc: The second disc of the new joint.color: "transparent" | string | [r: int, g: int, b: int] | null: The color of the new joint.strength: "rigid" | number | null: The strength of the new joint.length: number | [min: number, max: number] | null: The length of the new joint.A Joint object.
Creates a vertex object and adds it to the current stadium.
An object with the following structure:
x: number: The x component of the position of the new vertex.y: number: The y component of the position of the new vertex.bCoef: number | null: The bouncing coefficient of the new vertex.cMask: string[] | null: The collision mask of the new vertex.cGroup: string[] | null: The collision group of the new vertex.void.
Creates a segment object using vertex indices and adds it to the current stadium. The vertices must exist at the given indices in the vertices array of the current room.
An object with the following structure:
v0: int: Index of the first vertex of the new segment.v1: int: Index of the second vertex of the new segment.color: "transparent" | string | [r: int, g: int, b: int] | null: Color of the new segment.bias: number | null: Bias of the new segment.curve: number | null: Curve of the new segment. (unit: angles)curveF: number | null: Curve of the new segment. (unit: radians) While modifying this, the engine does not update some values. Only use this if you know what you are doing.vis: boolean | null: Visibility of the new segment.bCoef: number | null: Bouncing coefficient of the new segment.cMask: string[] | null: Collision mask of the new segment.cGroup: string[] | null: Collision group of the new segment.void.
Creates a goal object and adds it to the current stadium.
An object with the following structure:
p0: [x: number, y: number]: The starting point of the new goal object.p1: [x: number, y: number]: The ending point of the new goal object.team: "red" | "blue": The team of the new goal object.void.
Creates a plane object and adds it to the current stadium.
An object with the following structure:
normal: [x: number, y: number]: The normal of the new plane. This value is normalized automatically.dist: number: The distance of the new plane to the origin(0,0).bCoef: number | null: The bouncing coefficient of the new plane.cMask: string[] | null: The collision mask of the new plane.cGroup: string[] | null: The collision group of the new plane.void.
Creates a disc object and adds it to the current stadium.
An object with the following structure:
pos: [x: number, y: number]: The position of the new disc.speed: [x: number, y: number] | null: The speed of the new disc.gravity: [x: number, y: number] | null: The gravity (acceleration) of the new disc.radius: number: The radius of the new disc.invMass: number | null: The inverse mass of the new disc.damping: number | null: The damping of the new disc.color: "transparent" | string | [r: int, g: int, b: int] | null: The color of the new disc.bCoef: number | null: The bouncing coefficient of the new disc.cMask: string[] | null: The collision mask of the new disc.cGroup: string[] | null: The collision group of the new disc.void.
Creates a joint object and adds it to the current stadium.
An object with the following structure:
d0: int: The first disc index of the new joint.d1: int: The second disc index of the new joint.color: "transparent" | string | [r: int, g: int, b: int] | null: The color of the new joint.strength: "rigid" | number | null: The strengh of the new joint.length: number | [min: number, max: number] | null: The length of the new joint.void.
Adds a spawn point with given coordinate to the given team in the current stadium.
An object with the following structure:
x: number: The x coordinate of the new spawn point.y: number: The y coordinate of the new spawn point.team: "red" | "blue": The team of the new spawn point.void.
Adds a player with given properties to the current stadium.
An object with the following structure:
id: int: The id the new player. Already existing ids should not be used. 0 < id < 65535.name: string: The name of the new player.avatar: string: The avatar of the new player.flag: string: The country code of the new player.team: "spec" | "red" | "blue": The team of the new player. If this is "spec", the keys after this are ignored. Otherwise, player is moved to the specified team, a player disc is automatically generated and the below values are applied to the new disc.pos: [x: number, y: number] | null: The position of the new player. Team must not be "spec".speed: [x: number, y: number] | null: The speed of the new player. Team must not be "spec".gravity: [x: number, y: number] | null: The gravity (acceleration) of the new player. Team must not be "spec".radius: number | null: The radius of the new player. Team must not be "spec".invMass: number | null: The inverse mass of the new player. Team must not be "spec".damping: number | null: The damping of the new player. Team must not be "spec".bCoef: number | null: The bouncing coefficient of the new player. Team must not be "spec".cMask: string[] | null: The collision mask of the new player. Team must not be "spec".cGroup: string[] | null: The collision group of the new player. Team must not be "spec".void.
Returns the indices of vertices that form a segment.
The segment that contain the vertices whose indices we are trying to find.
An array in this format: [index1: int, index2: int]. index1 and index2 are the indices of the 1st and 2nd vertices of the queried segment.
Returns the indices of vertices that form a segment.
The index of the segment that contain the vertices whose indices we are trying to find.
An array in this format: [index1: int, index2: int]. index1 and index2 are the indices of the 1st and 2nd vertices of the queried segment. Returns null if the segment does not exist.
Updates the idxth vertex's only the given values.
Index of the vertex that is desired to be updated.
An object with the following structure:
x: number | null: The new x coordinate of the vertex.y: number | null: The new y coordinate of the vertex.bCoef: number | null: The new bouncing coefficient of the vertex.cMask: string[] | null: The new collision mask of the vertex.cGroup: string[] | null: The new collision group of the vertex.void.
Updates the idxth segment's only the given values.
Index of the segment that is desired to be updated.
An object with the following structure:
v0: int | null: The new first vertex index of the segment.v1: int | null: The new second vertex index of the segment.color: "transparent" | string | [r: int, g: int, b: int] | null: The new color of the segment.bias: number | null: The new bias of the segment.curve: number | null: The new curve of the segment. (unit: degrees)curveF: number | null: The new curve of the segment. (unit: radians) While modifying this, the engine does not update some values. Only use this if you know what you are doing.vis: boolean | null: The new visibility of the segment.bCoef: number | null: The new bouncing coefficient of the segment.cMask: string[] | null: The new collision mask of the segment.cGroup: string[] | null: The new collision group of the segment.void.
Updates the idxth goal's only the given values.
Index of the goal that is desired to be updated.
An object with the following structure:
p0: [x: number, y: number] | null: The new first point of the goal.p1: [x: number, y: number] | null: The new second point of the goal.team: "red" | "blue" | null: The new team of the goal.void.
Updates the idxth plane's only the given values.
Index of the plane that is desired to be updated.
An object with the following structure:
normal: [x: number, y: number] | null: The new normal of the plane. This value is normalized automatically.dist: number | null: The new distance of the plane to the origin. (0, 0)bCoef: number | null: The new bouncing coefficient of the plane.cMask: string[] | null: The new collision mask of the plane.cGroup: string[] | null: The new collision group of the plane.void.
Updates the idxth disc's only the given values.
Index of the disc that is desired to be updated.
An object with the following structure:
pos: [x: number, y: number] | null: The new position of the disc.speed: [x: number, y: number] | null: The new speed of the disc.gravity: [x: number, y: number] | null: The new gravity (acceleration) of the disc.radius: number | null: The new radius of the disc.invMass: number | null: The new inverse mass of the disc.damping: number | null: The new damping of the disc.color: "transparent" | string | [r: int, g: int, b: int] | null: The new color of the disc.bCoef: number | null: The new bouncing coefficient of the disc.cMask: string[] | null: The new collision mask of the disc.cGroup: string[] | null: The new collision group of the disc.void.
Updates the given disc object(discObj)'s only the given values.
The disc that is desired to be updated.
An object with the following structure:
pos: [x: number, y: number] | null: The new position of the disc.speed: [x: number, y: number] | null: The new speed of the disc.gravity: [x: number, y: number] | null: The new gravity (acceleration) of the disc.radius: number | null: The new radius of the disc.invMass: number | null: The new inverse mass of the disc.damping: number | null: The new damping of the disc.color: "transparent" | string | [r: int, g: int, b: int] | null: The new color of the disc.bCoef: number | null: The new bouncing coefficient of the disc.cMask: string[] | null: The new collision mask of the disc.cGroup: string[] | null: The new collision group of the disc.void.
Updates the idxth joint's only the given values.
Index of the joint that is desired to be updated.
An object with the following structure:
d0: int | null: The new first disc index of the joint.d1: int | null: The new second disc index of the joint.color: "transparent" | string | [r: int, g: int, b: int] | null: The new color of the joint.strength: "rigid" | number | null: The new strength of the joint.length: number | [min: number, max: number] | null: The new length of the joint.void.
Updates the idxth spawn point in team(team) using only the given values.
Index of the spawn point that is desired to be updated.
Current team of the spawn point that is desired to be updated.
An object with the following structure:
x: number | null: The new x coordinate of the spawn point.y: number | null: The new y coordinate of the spawn point.team: "red" | "blue" | null: The new team of the spawn point.void.
Updates the player(playerId)'s only the given values.
Id of the player that is desired to be updated.
An object with the following structure:
name: string | null: The new name of the player.avatar: string | null: The new avatar of the player.flag: string | null: The new flag of the player.team: "spec" | "red" | "blue" | null: The new team of the player.pos: [x: number, y: number] | null: The new position of the player.speed: [x: number, y: number] | null: The new speed of the player.gravity: [x: number, y: number] | null: The new gravity (acceleration) of the player.radius: number | null: The new radius of the player.invMass: number | null: The new inverse mass of the player.damping: number | null: The new damping of the player.bCoef: number | null: The new bouncing coefficient of the player.cMask: string[] | null: The new collision mask of the player.cGroup: string[] | null: The new collision group of the player.void.
Removes a vertex from the current room.
Index of the vertex to remove.
void.
Removes a segment from the current room.
Index of the segment to remove.
void.
Removes a goal from the current room.
Index of the goal to remove.
void.
Removes a plane from the current room.
Index of the plane to remove.
void.
Removes a disc from the current room.
Index of the disc to remove.
void.
Removes a joint from the current room.
Index of the joint to remove.
void.
Removes a spawn point from the current room.
Index of the spawn point to remove.
The team that the spawn point belongs to.
void.
Removes a player from the current room.
Id of the player to remove.
void.
Updates the current stadium's only the given player physics values.
An object with the following structure:
radius: number | null: The new radius value of the player physics of the current stadium.gravity: [x: number, y: number] | null: The new gravity (acceleration) value of the player physics of the current stadium.invMass: number | null: The new inverse mass value of the player physics of the current stadium.bCoef: number | null: The new bouncing coefficient value of the player physics of the current stadium.cGroup: string[] | null: The new collision group value of the player physics of the current stadium.damping: number | null: The new damping value of the player physics of the current stadium.kickingDamping: number | null: The new kicking damping value of the player physics of the current stadium.acceleration: number | null: The new acceleration value of the player physics of the current stadium.kickingAcceleration: number | null: The new kickingAcceleration value of the player physics of the current stadium.kickStrength: number | null: The new kick strength value of the player physics of the current stadium.kickback: number | null: The new kick back value of the player physics of the current stadium.void.
Updates the current stadium's only the given background values.
An object with the following structure:
type: 0 | 1 | 2 | null: The new background type of the current stadium. (0: "none", 1: "grass", 2: "hockey")width: number | null: The new background width of the current stadium.height: number | null: The new background height of the current stadium.kickOffRadius: number | null: The new kick-off radius of the current stadium.cornerRadius: number | null: The new background corner radius of the current stadium.color: "transparent" | string | [r: number, g: number, b: number] | null: The new background color of the current stadium.goalLine: number | null: The new goal line distance of the current stadium.void.
Updates the current stadium's only the given general values.
An object with the following structure:
name: string | null: The new name of the current stadium.width: number | null: The new width of the current stadium.height: number | null: The new height of the current stadium.maxViewWidth: number | null: The new max view width of the current stadium.cameraFollow: 0 | 1 | null: The new camera follow value of the current stadium. (0: "", 1: "player")spawnDistance: number | null: The new spawn distance value of the current stadium.kickOffReset: boolean | null: The new kick-off reset value of the current stadium. true: "full", false: "partial"canBeStored: boolean | null: The new can-be-stored value of the current stadium.void.
Sets the player's current direction. room.state.directionActive must be true for this to work.
New direction value of the current player.
void.
Sets whether to use default game logic or not.
Whether the default game logic is active(1) or passive(0).
void.
Sends an announcement using the improved announcement api.
The announcement message. ( max length = 1000 )
OptionalcssVar: stringThe cssVar of the announcement message.
Optionalsound: stringThe sound of the announcement message.
OptionaltargetId: numberId of the player who will receive this announcement. If this value is null, the announcement is sent to everyone.
void.
Updates the current skin(textureId) of a player.
Id of the player whose skin will be modified.
New skin value of the player.
void.
Sets the cssVar attribute of a player to change its appearance in the room gui.
Id of the player whose cssVar will be modified.
New cssVar value of the player.
void.
Adds a new stadium object.
Type of the object to be added.
An object that is supposed to contain all parameters required to add that type of object.
void.
Updates an existing stadium object.
Type of the object to be updated.
Id of the object to be updated.
An object that is supposed to contain all parameters required to update that type of object.
void.
Removes an existing stadium object.
Type of the object to be removed.
Id of the object to be removed.
An instance of StadiumRemoveObjectEvent.
Sets the overtime limit.
The desired overtime limit of the game.
void.
Manually changes the energy of an individual player.
Id of the player whose energy values will be modified.
New values. Order of values is supposed to be: [energy, kEnergyGain, kEnergyDrain]. null means no change for each value.
void.
Manually change the direction of an individual player. room.state.directionActive must be true for this to work.
Id of the player whose energy values will be modified.
New direction value of the player.
void.
Introduces a new game input control and assigns it to the next bit of player.input value.
Unique name of the input control.
Keycodes for the default keys of this input control.
void.
Remove an existing game input control. This function might break the game input logic completely.
Unique name of the input control to be removed.
void.
Updates the current contents of a css variable.
Name of the css variable..
New value of the css variable.
void.
Plays a custom sound.
Name of the sound to be played.
void.
Changes the name of the room.
The new room name.
void.
Manually sets the current elapsed time.
New elapsed time value.
void.
Manually sets the current max goal ticks.
New max goal ticks value.
void.
Manually set the current max pause ticks.
New max pause ticks value.
void.
Manually set the current max end ticks.
New max end ticks value.
void.
Manually pause/resume the game clock.
Whether the game will be paused(1) or resumed(0).
void.
Manually set whether direction is active or not.
New directionActive value.
void.
Manually set the current team scores.
Id of the team whose score is desired to be changed.
New score for the team.
void.
Sets the player's current direction. room.state.directionActive must be true for this to work.
New direction value of the current player.
void
Triggers a fake join room event; which in turn creates a new in-memory player object. If there was a player before with this id, old resources are automatically reassigned to this new player object, and that player will wake up.
Id of the player. 0 <= id <= 65535
Name of the player.
Country code of the player.
Avatar of the player.
Connection string of the player.
Auth string of the player.
void.
Triggers a fake leave room event. The player, although seemingly leaving the room, still watches the room, waiting for a new fake player join event. All parameters except id may be different in the new fakePlayerJoin call, which allows player's name, flag, avatar, conn and auth to change without the player entirely leaving the room.
fakePlayerJoin at a later time to re-insert that player.Id of the player leaving. id=0 will cause desync on clients. (Because there's a special check for this case in original clients.)
An object that has the following strucure: { id: uint16, name: string, flag: string, avatar: string, conn: string, auth: string }.
Triggers a fake input(keys) event that apparently originated from the player whose id is byId.
New input value of the player. 0<=input<=31.
Id of the player who will look like he/she sent this event.
void.
Triggers a fake chat event that apparently originated from the player whose id is byId.
The chat message.
Id of the player who will look like he/she sent this event.
void.
Triggers a fake chat indicator change event that apparently originated from the player whose id is byId.
The new chat indicator status of the player.
Id of the player who will look like he/she sent this event.
void.
Triggers a fake avatar change event that apparently originated from the player whose id is byId.
The new avatar of the player.
Id of the player who will look like he/she sent this event.
void.
Triggers a fake admin status change event for the player whose id is playerId that apparently originated from the player whose id is byId.
Id of the player who will have his/her admin rights changed.
Whether the player is desired to have admin rights or not.
Id of the player who will look like he/she sent this event.
void.
Triggers a fake player sync status change event that apparently originated from the player whose id is byId.
The new synchronization status of the player.
Id of the player who will look like he/she sent this event.
void.
Triggers a fake stadium change event that apparently originated from the player whose id is byId. The game must be stopped first.
The new stadium of the current room.
Id of the player who will look like he/she sent this event.
Triggers a fake game start event that apparently originated from the player whose id is byId.
Id of the player who will look like he/she sent this event.
void.
Triggers a fake game stop event that apparently originated from the player whose id is byId. The game must be started first.
Id of the player who will look like he/she sent this event.
void.
Triggers a fake game pause/resume event that apparently originated from the player whose id is byId. The game must be started first.
value=true: pause, false: resume.
Id of the player who will look like he/she sent this event.
void.
Triggers a fake score limit change event that apparently originated from the player whose id is byId.
The new score limit of the current room. The game must be stopped first. 0 means unlimited. 0<=value<=99.
Id of the player who will look like he/she sent this event.
void.
Triggers a fake time limit change event that apparently originated from the player whose id is byId.
The new time limit of the current room. The game must be stopped first. 0 means unlimited. 0<=value<=99.
Id of the player who will look like he/she sent this event.
void.
Triggers a fake teams lock change event that apparently originated from the player whose id is byId.
The new teams lock value of the current room.
Id of the player who will look like he/she sent this event.
void.
Triggers a fake auto teams event that apparently originated from the player whose id is byId.
Id of the player who will look like he/she sent this event.
void.
Triggers a fake player team change event for the player whose id is playerId that apparently originated from the player whose id is byId.
Id of the player whose team is being changed.
Id of the desired team of the player. 0: specetator, 1: red, 2: blue.
Id of the player who will look like he/she sent this event.
void.
Triggers a fake kick rate limit change event that apparently originated from player(byId).
The new min part of kick rate limit. min>=0.
The new rate part of kick rate limit. rate>=0.
The new burst part of kick rate limit. burst>=0.
Id of the player who will look like he/she sent this event.
void.
Triggers a team color change event for the team whose id is teamId that apparently originated from the player whose id is byId.
Id of the team whose colors are desired to change.
The angle of stripes for the inner colors. Should be between 0 and 180.
This array can contain minimum 2, maximum 4 numeric (0 <= integer <= 16777215) values. The first element is the text color and the rest are inner stripe colors.
Id of the player who will look like he/she sent this event.
void.
Triggers a fake leave/kick/ban event for the player whose id is playerId that apparently originated from the player whose id is byId.
Id of the player who will leave the room. (Or get kicked/banned from the room.)
The reason of kick/ban. If null, it is interpreted as he/she leaving by himself/herself, and the ban value is ignored in that case.
Whether the player is being banned or not.
Id of the player who will look like he/she sent this event.
void.
truefor a host room,falsefor a client room.