mooball
    Preparing search index...

    Interface AllRendererCallbacks

    These events can only be received by a host room.

    interface AllRendererCallbacks {
        onAnnouncement?(
            msg: string,
            color: number,
            style: number,
            sound: number,
            customData?: any,
        ): any;
        onAnnouncement2?(
            msg: string,
            cssVar?: string,
            sound?: string,
            targetId?: number,
            customData?: any,
        ): any;
        onAutoTeams?(
            playerId1: number,
            teamId1: number,
            playerId2: number | null,
            teamId2: number | null,
            byId: number,
            customData?: any,
        ): any;
        onBanClear?(id: number, customData?: any): any;
        onBansClear?(customData?: any): any;
        onBinaryCustomEvent?(
            type: number,
            data: Uint8Array,
            byId: number,
            customData?: any,
        ): any;
        onClockPausedChange?(value: number, customData?: any): any;
        onCollisionDiscVsDisc?(
            discId1: number,
            discPlayerId1: number,
            discId2: number,
            discPlayerId2: number,
            customData?: any,
        ): any;
        onCollisionDiscVsPlane?(
            discId: number,
            discPlayerId: number,
            planeId: number,
            customData?: any,
        ): any;
        onCollisionDiscVsSegment?(
            discId: number,
            discPlayerId: number,
            segmentId: number,
            customData?: any,
        ): any;
        onConfigUpdate?(
            oldRoomConfigObj: RoomConfig,
            newRoomConfigObj: RoomConfig,
            customData?: any,
        ): any;
        onControls?(type: number, params: any[], customData?: any): any;
        onCustomEvent?(
            type: number,
            data: object,
            byId: number,
            customData?: any,
        ): any;
        onDirectionActiveChange?(value: number, customData?: any): any;
        onElapsedTimeChange?(value: number, customData?: any): any;
        onGameEnd?(winningTeamId: number, customData?: any): any;
        onGamePauseChange?(isPaused: boolean, byId: number, customData?: any): any;
        onGameStart?(byId: number, customData?: any): any;
        onGameStop?(byId: number, customData?: any): any;
        onGameTick?(customData?: any): any;
        onHandicapChange?(value: number, customData?: any): any;
        onIdentityEvent?(
            id: number,
            data: object,
            byId: number,
            customData?: any,
        ): any;
        onKickOff?(customData?: any): any;
        onKickRateLimitChange?(
            min: number,
            rate: number,
            burst: number,
            byId: number,
            customData?: any,
        ): any;
        onLanguageChange?(abbr: string, customData?: any): any;
        onLibraryAdd?(libraryObj: Library, customData?: any): any;
        onLibraryMove?(libraryObj: Library, customData?: any): any;
        onLibraryRemove?(libraryObj: Library, customData?: any): any;
        onLibraryUpdate?(
            oldLibraryObj: Library,
            newLibraryObj: Library,
            customData?: any,
        ): any;
        onMaxEndTicksChange?(value: number, customData?: any): any;
        onMaxGoalTicksChange?(value: number, customData?: any): any;
        onMaxPauseTicksChange?(value: number, customData?: any): any;
        onOvertimeLimitChange?(value: number, customData?: any): any;
        onPingChange?(
            instantPing: number,
            averagePing: number,
            maxPing: number,
            customData?: any,
        ): any;
        onPingData?(array: number[], customData?: any): any;
        onPlayCustomSound?(soundName: string, customData?: any): any;
        onPlayerAdminChange?(
            id: number,
            isAdmin: boolean,
            byId: number,
            customData?: any,
        ): any;
        onPlayerAvatarChange?(id: number, value: string, customData?: any): any;
        onPlayerBallKick?(playerId: number, customData?: any): any;
        onPlayerChat?(id: number, message: string, customData?: any): any;
        onPlayerChatIndicatorChange?(
            id: number,
            value: boolean,
            customData?: any,
        ): any;
        onPlayerCssVarChange?(
            id: number,
            cssVar: string | null,
            customData?: any,
        ): any;
        onPlayerDirectionChange?(id: number, value: number, customData?: any): any;
        onPlayerDiscCreated?(playerObj: Player, customData?: any): any;
        onPlayerDiscDestroyed?(playerObj: Player, customData?: any): any;
        onPlayerEnergyChange?(id: number, data: number[], customData?: any): any;
        onPlayerHeadlessAvatarChange?(
            id: number,
            value: string,
            customData?: any,
        ): any;
        onPlayerInputChange?(id: number, value: number, customData?: any): any;
        onPlayerJoin?(playerObj: Player, customData?: any): any;
        onPlayerLeave?(
            playerObj: Player,
            reason: string | null,
            isBanned: boolean,
            byId: number,
            customData?: any,
        ): any;
        onPlayerObjectCreated?(playerObj: Player, customData?: any): any;
        onPlayerSkinChange?(
            id: number,
            skin: Texture | null,
            customData?: any,
        ): any;
        onPlayersOrderChange?(
            idList: number[],
            moveToTop: boolean,
            customData?: any,
        ): any;
        onPlayerSyncChange?(
            playerId: number,
            value: boolean,
            customData?: any,
        ): any;
        onPlayerTeamChange?(
            id: number,
            teamId: number,
            byId: number,
            customData?: any,
        ): any;
        onPluginActiveChange?(plugin: Plugin, customData?: any): any;
        onPluginAdd?(pluginObj: Plugin, customData?: any): any;
        onPluginMove?(pluginObj: Plugin, customData?: any): any;
        onPluginRemove?(pluginObj: Plugin, customData?: any): any;
        onPluginUpdate?(
            oldPluginObj: Plugin,
            newPluginObj: Plugin,
            customData?: any,
        ): any;
        onPositionsReset?(customData?: any): any;
        onRendererUpdate?(
            oldRendererObj: Renderer,
            newRendererObj: Renderer,
            customData?: any,
        ): any;
        onRoomLink?(link: string, customData?: any): any;
        onRoomNameChange?(name: string, customData?: any): any;
        onRoomPropertiesChange?(props: UpdatedRoomProps, customData?: any): any;
        onRoomRecaptchaModeChange?(on: boolean, customData?: any): any;
        onRoomRecordingChange?(value: true | ArrayBuffer, customData?: any): any;
        onRoomTokenChange?(token: string, customData?: any): any;
        onRunDefaultGameLogicChange?(value: boolean, customData?: any): any;
        onScoreLimitChange?(value: number, byId: number, customData?: any): any;
        onSetDiscProperties?(
            id: number,
            type: number,
            data1: number[],
            data2: number[],
            customData?: any,
        ): any;
        onStadiumAddObject?(type: number, value: object, customData?: any): any;
        onStadiumChange?(stadium: IStadium, byId: number, customData?: any): any;
        onStadiumRemoveObject?(type: number, id: number, customData?: any): any;
        onStadiumUpdateObject?(
            type: number,
            id: number,
            value: object,
            customData?: any,
        ): any;
        onTeamColorsChange?(
            teamId: number,
            value: TeamColors,
            byId: number,
            customData?: any,
        ): any;
        onTeamGoal?(
            teamId: number,
            goalId: number,
            goal: Goal,
            ballDiscId: number,
            ballDisc: Disc,
            customData?: any,
        ): any;
        onTeamScoreChange?(teamId: number, value: number, customData?: any): any;
        onTeamsLockChange?(value: boolean, byId: number, customData?: any): any;
        onTimeIsUp?(customData?: any): any;
        onTimeLimitChange?(value: number, byId: number, customData?: any): any;
        onUpdateCssVar?(name: string, value: string, customData?: any): any;
        onVariableValueChange?(
            addonObject: Addon,
            variableName: string,
            oldValue: any,
            newValue: any,
            customData?: any,
        ): any;
        render?(): void;
    }

    Hierarchy (View Summary)

    Index

    Methods

    onAnnouncement? onAnnouncement2? onAutoTeams? onBanClear? onBansClear? onBinaryCustomEvent? onClockPausedChange? onCollisionDiscVsDisc? onCollisionDiscVsPlane? onCollisionDiscVsSegment? onConfigUpdate? onControls? onCustomEvent? onDirectionActiveChange? onElapsedTimeChange? onGameEnd? onGamePauseChange? onGameStart? onGameStop? onGameTick? onHandicapChange? onIdentityEvent? onKickOff? onKickRateLimitChange? onLanguageChange? onLibraryAdd? onLibraryMove? onLibraryRemove? onLibraryUpdate? onMaxEndTicksChange? onMaxGoalTicksChange? onMaxPauseTicksChange? onOvertimeLimitChange? onPingChange? onPingData? onPlayCustomSound? onPlayerAdminChange? onPlayerAvatarChange? onPlayerBallKick? onPlayerChat? onPlayerChatIndicatorChange? onPlayerCssVarChange? onPlayerDirectionChange? onPlayerDiscCreated? onPlayerDiscDestroyed? onPlayerEnergyChange? onPlayerHeadlessAvatarChange? onPlayerInputChange? onPlayerJoin? onPlayerLeave? onPlayerObjectCreated? onPlayerSkinChange? onPlayersOrderChange? onPlayerSyncChange? onPlayerTeamChange? onPluginActiveChange? onPluginAdd? onPluginMove? onPluginRemove? onPluginUpdate? onPositionsReset? onRendererUpdate? onRoomLink? onRoomNameChange? onRoomPropertiesChange? onRoomRecaptchaModeChange? onRoomRecordingChange? onRoomTokenChange? onRunDefaultGameLogicChange? onScoreLimitChange? onSetDiscProperties? onStadiumAddObject? onStadiumChange? onStadiumRemoveObject? onStadiumUpdateObject? onTeamColorsChange? onTeamGoal? onTeamScoreChange? onTeamsLockChange? onTimeIsUp? onTimeLimitChange? onUpdateCssVar? onVariableValueChange? render?

    Methods

    • Called just after an announcement was made by the room host.

      Parameters

      • msg: string

        The announcement message.

      • color: number

        The color of the announcement message. Range: -1 <= color < 16777216.

        • The color value can be converted into a rgba string via API's Utils.numberToColor function.
        • The special value -1 means transparent color.
      • style: number

        The style of the announcement message. Must be one of the following:

        • 0: use document's default font style.
        • 1: fontWeight = "bold".
        • 2: fontStyle = "italic".
        • 3: fontSize = "12px".
        • 4: fontWeight = "bold", fontSize = "12px".
        • 5: fontWeight = "italic", fontSize = "12px".
      • sound: number

        The sound of the announcement message. Must be one of the following:

        • 0: no sound.
        • 1: chat sound.
        • 2: highlight sound.
      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after an announcement has been sent using the improved announcement api.

      Parameters

      • msg: string

        The announcement message. ( max length = 1000 )

      • OptionalcssVar: string

        The cssVar of the announcement message.

      • Optionalsound: string

        The sound of the announcement message.

      • OptionaltargetId: number

        Id of the player who will receive this announcement. If this value is null, the announcement is sent to everyone.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after an "auto" event has been triggered to automatically move at least one, at most two players from spectators to teams.

      Parameters

      • playerId1: number

        Id of the first player affected by this event.

      • teamId1: number

        Id of the team which the first player was moved into.

      • playerId2: number | null

        Id of the second player affected by this event, or null if there was only one spectator when this event was triggered.

      • teamId2: number | null

        Id of the team which the second player was moved into, or null if there was only one spectator when this event was triggered.

      • byId: number

        Id of the player who has triggered the event.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after the ban of a player has been cleared using room.clearBan(id).

      Parameters

      • id: number

        Id of the player whose ban has just been cleared.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after all bans have been cleared using room.clearBans().

      Parameters

      • OptionalcustomData: any

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after a binary custom event has been triggered.

      Parameters

      • type: number

        Any integer value to hold the type of the custom event.

      • data: Uint8Array

        Any Uint8Array to store the properties of the custom event. This object is directly sent/received by Mooball's original event mechanism.

      • byId: number

        Id of the player who has triggered this custom event.

      • OptionalcustomData: any

        Any custom data that might be returned from the previous addon's calback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after the game clock has been paused/resumed.

      Parameters

      • value: number

        Whether the game will be paused(1) or resumed(0).

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after a collision has happened between two discs.

      Parameters

      • discId1: number

        Id of the first collided disc.

      • discPlayerId1: number

        The player's id that the first disc belongs to. If the disc is not a player's disc, this value will be null.

      • discId2: number

        Id of the second collided disc.

      • discPlayerId2: number

        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: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after a collision has happened between a disc and a plane.

      Parameters

      • discId: number

        Id of the collided disc.

      • discPlayerId: number

        The player's id that the disc belongs to. If the disc is not a player's disc, this value will be null.

      • planeId: number

        Id of the collided plane.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after a collision has happened between a disc and a segment.

      Parameters

      • discId: number

        Id of the collided disc.

      • discPlayerId: number

        The player's id that the disc belongs to. If the disc is not a player's disc, this value will be null.

      • segmentId: number

        Id of the collided segment.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after the room's config object has been replaced by a new one.

      Parameters

      • oldRoomConfigObj: RoomConfig

        The old RoomConfig object.

      • newRoomConfigObj: RoomConfig

        The new RoomConfig object.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after game input controls have been modified.

      Parameters

      • type: number

        Type of the operation. (0: add, 1: remove)

      • params: any[]

        Parameters for the specific operation.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after a custom event has been triggered.

      Parameters

      • type: number

        Any integer value to hold the type of the custom event.

      • data: object

        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.

      • byId: number

        Id of the player who has triggered this custom event.

      • OptionalcustomData: any

        Any custom data that might be returned from the previous addon's calback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after room.directionActive has been changed.

      Parameters

      • value: number

        New directionActive value.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after the current elapsed time has been changed.

      Parameters

      • value: number

        New elapsed time value.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after the game has ended.

      Parameters

      • winningTeamId: number

        Id of the team that won the game.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after the game has been paused or resumed.

      Parameters

      • isPaused: boolean

        Whether the game has been paused or not.

      • byId: number

        Id of the player who has triggered this event.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after the game has been started.

      Parameters

      • byId: number

        Id of the player who has started the game.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after the game has been stopped.

      Parameters

      • byId: number

        Id of the player who has stopped the game.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called 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.

      Parameters

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after the local ping handicap value has been changed.

      Parameters

      • value: number

        The new ping handicap value in milliseconds. Range: 0 <= value <= 300.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after an identity event has been triggered.

      Parameters

      • id: number

        Id of the player whose identity data is desired to be changed.

      • data: object

        The identity data that should be received from the backend. It can be any JSON object.

      • byId: number

        Id of the player who has triggered this custom event.

      • OptionalcustomData: any

        Any custom data that might be returned from the previous addon's calback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after a kick-off event has occurred.

      Parameters

      • OptionalcustomData: any

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after the room's kick rate limit has been changed.

      Parameters

      • min: number

        The new min part of kick rate limit.

      • rate: number

        The new rate part of kick rate limit.

      • burst: number

        The new burst part of kick rate limit.

      • byId: number

        Id of the player who has changed the kick rate limit.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after the API's language has been changed.

      Parameters

      • abbr: string

        The new language's abbreviation value.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after a library object has been added.

      Parameters

      • libraryObj: Library

        The Library object.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after a library object has been moved.

      Parameters

      • libraryObj: Library

        The Library object.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after a library object has been removed.

      Parameters

      • libraryObj: Library

        The Library object.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after an old library object has been replaced by a new one.

      Parameters

      • oldLibraryObj: Library

        The old Library object.

      • newLibraryObj: Library

        The new Library object.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after the current max end ticks has been changed.

      Parameters

      • value: number

        New max end ticks value.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after the current max goal ticks has been changed.

      Parameters

      • value: number

        New max goal ticks value.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after the current max pause ticks has been changed.

      Parameters

      • value: number

        New max pause ticks value.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after room's overtime limit has been changed.

      Parameters

      • value: number

        The desired overtime limit of the game.

      • OptionalcustomData: any

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after the ping value of the current player has been calculated.

      Parameters

      • instantPing: number

        the instant ping value at that moment

      • averagePing: number

        the calculated average ping value in a period of time

      • maxPing: number

        the calculated maximum ping value in a period of time

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after the ping values for all players have been updated.

      Parameters

      • array: number[]

        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: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after a custom sound has been played.

      Parameters

      • soundName: string

        Name of the sound to be played.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after a player's admin rights have been given/taken.

      Parameters

      • id: number

        Id of the player whose admin rights have been given/taken.

      • isAdmin: boolean

        The new admin rights status of the player whose id is id.

      • byId: number

        Id of the player who has triggered this event.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after a player has changed his/her avatar.

      Parameters

      • id: number

        Id of the player who has changed his/her avatar.

      • value: string

        The new avatar value.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after the ball has been kicked.

      Parameters

      • playerId: number

        Id of the player who kicked the ball.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after a chat message has been received.

      Parameters

      • id: number

        Id of the player who has sent the chat message.

      • message: string

        The chat message.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called 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.

      Parameters

      • id: number

        Id of the player whose chat indicator has been activated/deactivated.

      • value: boolean

        Whether the chat indicator has been activated or not.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after the cssVar attribute of a player has been changed.

      Parameters

      • id: number

        Id of the player whose cssVar will be modified.

      • cssVar: string | null

        New cssVar value of the player.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after the direction of an individual player was changed. room.state.directionActive must be true for this to work.

      Parameters

      • id: number

        Id of the player whose energy values will be modified.

      • value: number

        New direction value of the player.

      • OptionalcustomData: any

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after a disc object has been assigned to a player object.

      Parameters

      • playerObj: Player

        The new Player object that has just been assigned a disc object.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after a disc object has been removed from a player object.

      Parameters

      • playerObj: Player

        The Player object whose disc object has just been removed.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after the energy of an individual player has been altered manually.

      Parameters

      • id: number

        Id of the player whose energy values will be modified.

      • data: number[]

        New values. Order of values is supposed to be: [energy, kEnergyGain, kEnergyDrain]. null means no change for each value.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after a player has changed his/her headless avatar.

      Parameters

      • id: number

        Id of the player who triggered this event.

      • value: string

        The new headless avatar value.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after a player's input has been changed.

      Parameters

      • id: number

        Id of the player whose input has been changed.

      • value: number

        The new input value of the player.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after a player has joined the room.

      Parameters

      • playerObj: Player

        The data representation of the player that has just joined the room.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after a player has left the room.

      Parameters

      • playerObj: Player

        The player who has left the room.

      • reason: string | null

        The reason of leaving the room. If null, the player has left by himself/herself.

      • isBanned: boolean

        Whether the player has been banned or not. If reason is null, this value is ignored.

      • byId: number

        Id of the player who has kicked/banned the player. If reason is null, this value is ignored.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after a player object has been created. This callback can be used to define custom properties inside all player objects.

      Parameters

      • playerObj: Player

        The new Player object that has just been created.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after the current skin(textureId) of a player has been updated.

      Parameters

      • id: number

        Id of the player whose skin will be modified.

      • skin: Texture | null

        New skin value of the player.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called 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.

      Parameters

      • idList: number[]

        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.

      • moveToTop: boolean

        Whether to add the players to the top or bottom of the room's players list.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after a player's synchronization status has changed.

      Parameters

      • playerId: number

        Id of the player whose synchronization status has changed.

      • value: boolean

        The new synchronization status.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after a player has been moved to a different team.

      Parameters

      • id: number

        Id of the player who has been moved to a different team.

      • teamId: number

        Id of the player's new team.

      • byId: number

        Id of the player who has triggered this event.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after a plugin has been activated or deactivated.

      Parameters

      • plugin: Plugin

        The plugin which was activated or deactivated. This property stores the current activation status of the plugin: plugin.active.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after a plugin object has been added.

      Parameters

      • pluginObj: Plugin

        The Plugin object.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after a plugin object has been moved.

      Parameters

      • pluginObj: Plugin

        The Plugin object.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after a plugin object has been removed.

      Parameters

      • pluginObj: Plugin

        The Plugin object.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after an old plugin object has been replaced by a new one.

      Parameters

      • oldPluginObj: Plugin

        The old Plugin object.

      • newPluginObj: Plugin

        The new Plugin object.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called 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.

      Parameters

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after the room's renderer object has been replaced by a new one.

      Parameters

      • oldRendererObj: Renderer

        The old Renderer object.

      • newRendererObj: Renderer

        The new Renderer object.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • The 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.

      Parameters

      • link: string

        The room link that was just received.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after the name of the room has been changed.

      Parameters

      • name: string

        The new room name.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after the room's properties have been changed.

      Parameters

      • props: UpdatedRoomProps

        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: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after the room's recaptcha mode was changed using room.requireRecaptcha = on.

      Parameters

      • on: boolean

        The new value; whether to request recaptcha or not while joining the room.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after room recording has been started or stopped.

      Parameters

      • value: true | ArrayBuffer

        If true, recording has just been started,

        • Else, the recording has just stopped and the recorded data is returned in value as an ArrayBuffer. You might want to write the contents to a version-3 replay file.
      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just a little after the room's token was changed using room.token = value.

      Parameters

      • token: string

        The new token of the room.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after room.runDefaultGameLogic has changed.

      Parameters

      • value: boolean

        Whether the default game logic is active(1) or passive(0).

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after the score limit has been changed.

      Parameters

      • value: number

        The new score limit value.

      • byId: number

        Id of the player who has triggered this event.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after a disc's properties have been modified.

      Parameters

      • id: number

        The id of player or disc whose disc properties have changed.

      • type: number

        The type of object. Must be one of the following:

        • 0: disc.
        • 1: player.
      • data1: number[]

        Must consist of the following properties of the disc in the same order: [x, y, xspeed, yspeed, xgravity, ygravity, radius, bCoeff, invMass, damping].

      • data2: number[]

        Must consist of the following properties of the disc in the same order: [color, cMask, cGroup].

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after a new stadium object has been added.

      Parameters

      • type: number

        Type of the object to be added.

      • value: object

        An object that is supposed to contain all parameters required to add that type of object.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after the room's current stadium has been changed.

      Parameters

      • stadium: IStadium

        The room's new Stadium object.

      • byId: number

        Id of the player who has triggered this event.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after an existing stadium object has been removed.

      Parameters

      • type: number

        Type of the object to be removed.

      • id: number

        Id of the object to be removed.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after an existing stadium object has been updated.

      Parameters

      • type: number

        Type of the object to be updated.

      • id: number

        Id of the object to be updated.

      • value: object

        An object that is supposed to contain all parameters required to update that type of object.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after a team's colors have been changed.

      Parameters

      • teamId: number

        The team that colors have been changed.

      • value: TeamColors

        The new team colors value.

      • byId: number

        Id of the player who has changed the team colors.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after a goal has been scored.

      Parameters

      • teamId: number

        Id of the team that scored the goal.

      • goalId: number

        Id of the goal object that the ball went in.

      • goal: Goal

        The goal object that the ball went in.

      • ballDiscId: number

        Id of the ball disc that caused the goal.

      • ballDisc: Disc

        The ball disc that caused the goal.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after the current team scores has been changed.

      Parameters

      • teamId: number

        Id of the team whose score is desired to be changed.

      • value: number

        New score for the team.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after the room's teams have been locked/unlocked.

      Parameters

      • value: boolean

        The room's new teams lock value.

      • byId: number

        Id of the player who has triggered this event.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after the game has ended by timeout.

      Parameters

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after the time limit has been changed.

      Parameters

      • value: number

        The new time limit value.

      • byId: number

        Id of the player who has triggered this event.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after the current contents of a css variable has been altered.

      Parameters

      • name: string

        Name of the css variable..

      • value: string

        New value of the css variable.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • Called just after the value of a variable has been changed.

      Parameters

      • addonObject: Addon

        The Addon object that the variable belongs to.

      • variableName: string

        The name of the variable whose value has been changeed.

      • oldValue: any

        The old value of the variable.

      • newValue: any

        The new value of the variable.

      • OptionalcustomData: any

        the custom data that was returned from the previous callback.

      Returns any

      void or a custom data to pass to the next callback.

    • This callback should always be defined, since this function holds the main purpose of the Renderer class. All rendering logic is supposed to reside inside this function. You should use room.extrapolate function inside this callback with ignoreMultipleCalls=true for smooth movement of objects. This callback is used internally by the game engine inside window.requestAnimationFrame callback.

      Returns void

      void.