classicborne
    Preparing search index...

    Class Watchdog

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

    Index

    Constructors

    Properties

    currentRate: number

    The current rate of operations within the last second.

    interval: Timeout
    limit: number

    The maximum allowed rate of operations before disconnecting the player.

    player: BasePlayer

    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 the current rate by. Default is 1

      Returns boolean

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