Class PlayerUpdatesPerspectiveFilter

A perspective filter used to prevent information about players from being synced . Information includes cosmetics like names, colours, flags, pets, etc. but also invisible "state" things such as tasks, whether or not the player is dead, disconnected, an impostor, etc.

This filter is especially useful for gamemodes with custom roles, where the roles can be identified with cosmetics that other players shouldn't be able to see.

It's built around "allowing" or "disallowing" certain flags for each player. For example, you might use this filter to block cosmetics from being synced, but allow state such as the player being dead or disconnected to sync.

Hierarchy

Methods

  • Get the bitfield that covers rules for updates for a specific player's player id.

    Parameters

    • playerId: number

      The ID of the player to get rules for.

    Returns number

  • Create a rule to allow all updates for players to be synced/passed through.

    Note that on its own, this is equivalent to having no player update perspective filter at all, so more often than not it will be used as a disable/enable toggle or in conjunction with unsetAllowed.

    Example

    playerUpdatesFilter.setAllAllowed();

    playerUpdatesFilter.unsetAllowed(PlayerUpdatesFilterFlag.Name);

    Returns void

  • Create a global rule for all players to allow some player update flag to sync/pass through.

    Example

    playerUpdatesFilter.setAllowed(PlayerUpdatesFilterFlag.Flags | PlayerUpdatesFilterFlag.Color);
    

    Parameters

    Returns void

  • Remove a global rule for all players to prevent some player update flag from being synced/passed through.

    Note that this does not override player rules created with setPlayerInfoAllowed.

    Example

    playerUpdatesFilter.setAllAllowed();

    playerUpdatesFilter.unsetAllowed(PlayerUpdatesFilterFlag.Name);

    Parameters

    Returns void

Constructors

Generated using TypeDoc