mooball
    Preparing search index...

    Interface CommonCallbacks

    interface CommonCallbacks {
        onAutoTeams?(
            playerId1: number,
            teamId1: number,
            playerId2: number | null,
            teamId2: number | null,
            byId: number,
            customData?: any,
        ): any;
        onGamePauseChange?(isPaused: boolean, byId: number, customData?: any): any;
        onGameStart?(byId: number, customData?: any): any;
        onGameStop?(byId: number, customData?: any): any;
        onKickRateLimitChange?(
            min: number,
            rate: number,
            burst: number,
            byId: number,
            customData?: any,
        ): any;
        onOvertimeLimitChange?(value: number, customData?: any): any;
        onPlayerAdminChange?(
            id: number,
            isAdmin: boolean,
            byId: number,
            customData?: any,
        ): any;
        onPlayerAvatarChange?(id: number, value: string, customData?: any): any;
        onPlayerChat?(id: number, message: string, customData?: any): any;
        onPlayerChatIndicatorChange?(
            id: number,
            value: boolean,
            customData?: any,
        ): any;
        onPlayerDirectionChange?(id: number, value: number, customData?: any): any;
        onPlayerDiscCreated?(playerObj: Player, customData?: any): any;
        onPlayerDiscDestroyed?(playerObj: Player, 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;
        onPlayerSyncChange?(
            playerId: number,
            value: boolean,
            customData?: any,
        ): any;
        onPlayerTeamChange?(
            id: number,
            teamId: number,
            byId: number,
            customData?: any,
        ): any;
        onScoreLimitChange?(value: number, byId: number, customData?: any): any;
        onStadiumChange?(stadium: IStadium, byId: number, customData?: any): any;
        onTeamColorsChange?(
            teamId: number,
            value: TeamColors,
            byId: number,
            customData?: any,
        ): any;
        onTeamsLockChange?(value: boolean, byId: number, customData?: any): any;
        onTimeLimitChange?(value: number, byId: number, customData?: any): any;
    }

    Hierarchy (View Summary)

    Index

    Methods

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