mooball
    Preparing search index...

    Interface HostTriggeredRoomConfigCallbacks

    interface HostTriggeredRoomConfigCallbacks {
        onAfterAnnouncement?(
            msg: string,
            color: number,
            style: number,
            sound: number,
            customData?: any,
        ): void;
        onAfterAnnouncement2?(
            msg: string,
            cssVar?: string,
            sound?: string,
            targetId?: number,
            customData?: any,
        ): void;
        onAfterClockPausedChange?(value: number, customData?: any): void;
        onAfterControls?(type: number, params: any[], customData?: any): void;
        onAfterDirectionActiveChange?(value: number, customData?: any): void;
        onAfterElapsedTimeChange?(value: number, customData?: any): void;
        onAfterMaxEndTicksChange?(value: number, customData?: any): void;
        onAfterMaxGoalTicksChange?(value: number, customData?: any): void;
        onAfterMaxPauseTicksChange?(value: number, customData?: any): void;
        onAfterPingData?(array: number[], customData?: any): void;
        onAfterPlayCustomSound?(soundName: string, customData?: any): void;
        onAfterPlayerCssVarChange?(
            id: number,
            cssVar: string | null,
            customData?: any,
        ): void;
        onAfterPlayerEnergyChange?(
            id: number,
            data: number[],
            customData?: any,
        ): void;
        onAfterPlayerHeadlessAvatarChange?(
            id: number,
            value: string,
            customData?: any,
        ): void;
        onAfterPlayerSkinChange?(
            id: number,
            skin: Texture | null,
            customData?: any,
        ): void;
        onAfterPlayersOrderChange?(
            idList: number[],
            moveToTop: boolean,
            customData?: any,
        ): void;
        onAfterRoomNameChange?(name: string, customData?: any): void;
        onAfterRoomPropertiesChange?(
            props: UpdatedRoomProps,
            customData?: any,
        ): void;
        onAfterRunDefaultGameLogicChange?(value: boolean, customData?: any): void;
        onAfterSetDiscProperties?(
            id: number,
            type: number,
            data1: number[],
            data2: number[],
            customData?: any,
        ): void;
        onAfterStadiumAddObject?(
            type: number,
            value: object,
            customData?: any,
        ): void;
        onAfterStadiumRemoveObject?(
            type: number,
            id: number,
            customData?: any,
        ): void;
        onAfterStadiumUpdateObject?(
            type: number,
            id: number,
            value: object,
            customData?: any,
        ): void;
        onAfterTeamScoreChange?(
            teamId: number,
            value: number,
            customData?: any,
        ): void;
        onAfterUpdateCssVar?(name: string, value: string, customData?: any): void;
        onBeforeAnnouncement?(
            msg: string,
            color: number,
            style: number,
            sound: number,
        ): any;
        onBeforeAnnouncement2?(
            msg: string,
            cssVar?: string,
            sound?: string,
            targetId?: number,
        ): any;
        onBeforeClockPausedChange?(value: number): any;
        onBeforeControls?(type: number, params: any[]): any;
        onBeforeDirectionActiveChange?(value: number): any;
        onBeforeElapsedTimeChange?(value: number): any;
        onBeforeMaxEndTicksChange?(value: number): any;
        onBeforeMaxGoalTicksChange?(value: number): any;
        onBeforeMaxPauseTicksChange?(value: number): any;
        onBeforePingData?(array: number[]): any;
        onBeforePlayCustomSound?(soundName: string): any;
        onBeforePlayerCssVarChange?(id: number, cssVar: string | null): any;
        onBeforePlayerEnergyChange?(id: number, data: number[]): any;
        onBeforePlayerHeadlessAvatarChange?(id: number, value: string): any;
        onBeforePlayerSkinChange?(id: number, skin: Texture | null): any;
        onBeforePlayersOrderChange?(idList: number[], moveToTop: boolean): any;
        onBeforeRoomNameChange?(name: string): any;
        onBeforeRoomPropertiesChange?(props: UpdatedRoomProps): any;
        onBeforeRunDefaultGameLogicChange?(value: boolean): any;
        onBeforeSetDiscProperties?(
            id: number,
            type: number,
            data1: number[],
            data2: number[],
        ): any;
        onBeforeStadiumAddObject?(type: number, value: object): any;
        onBeforeStadiumRemoveObject?(type: number, id: number): any;
        onBeforeStadiumUpdateObject?(type: number, id: number, value: object): any;
        onBeforeTeamScoreChange?(teamId: number, value: number): any;
        onBeforeUpdateCssVar?(name: string, value: string): any;
    }

    Hierarchy (View Summary)

    Index

    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 void

      void.

    • 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 void

      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 void

      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 void

      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 void

      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 void

      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 void

      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 void

      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 void

      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 void

      void.

    • 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 void

      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 void

      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 void

      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 void

      void.

    • 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 void

      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 void

      void.

    • 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 void

      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 void

      void.

    • 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 void

      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 void

      void.

    • 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 void

      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 void

      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 void

      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 void

      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 void

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

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

      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.

      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).

      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.

      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.

      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.

      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.

      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.

      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.

      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.

      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.

      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.

      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.

      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.

      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.

      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.

      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.

      Returns any

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

    • Called just after the room's properties have been changed, and just before any other callback has been called.

      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.

      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).

      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].

      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.

      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.

      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.

      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.

      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.

      Returns any

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