classicborne
    Preparing search index...

    Class Watchdog

    I keep track of client activity. My rateOperation method is used to increment my current rate. If current rate goes beyond my limit, I will disconnect my player. I set my current rate to zero on a one second interval.

    Index

    Constructors

    Properties

    currentRate: number

    The current rate of operations within the last second.

    interval: Timeout

    The one second interval for zeroing currentRate.

    Cleared by Watchdog.destroy.

    limit: number

    The maximum allowed rate of operations before disconnecting the player.

    player: BasePlayer

    The player being monitored.

    Methods

    • Increments the current rate of operations by the specified amount. If the current rate exceeds the limit, the player is disconnected.

      Parameters

      • Optionalamount: number = 1

        The amount to increment currentRate by. Default is 1

      Returns boolean

      Returns true if the player was disconnected due to exceeding the limit, otherwise false.