Manages DeathLink mechanics for clients that choose to opt in to the mechanic.

Hierarchy (view full)

Accessors

Methods

  • If DeathLink is enabled, sends a DeathLink to all DeathLink enabled players, otherwise this method does nothing.

    Parameters

    • source: string

      The name of the player who died. Can be a slot name, but could also be a name from within a multiplayer game.

    • Optionalcause: string

      Optional text explaining the cause of death. When provided, this should include the player's name. (e.g., Phar drowned in a vat of kittens.)

    Returns void

    UnauthenticatedError If attempting to send a death link before authenticating to the server.

    DeathLinks sent from this client will not fire a DeathEvents.deathReceived event to avoid an infinite feedback loop of deaths.

  • Returns a promise that waits for a single specified event to be received. Resolves with the list of arguments dispatched with the event.

    Type Parameters

    • Event extends "deathReceived"

    Parameters

    • event: Event

      The event name to listen for.

    • clearPredicate: ((...args: DeathEvents[Event]) => boolean) = ...

      An optional predicate to check on incoming events to validate if the correct event has been received. If omitted, will return immediately on next event type received.

    Returns Promise<DeathEvents[Event]>