@rbxts/fletchette
    Preparing search index...

    Class ExactSetPropertyPacket<T>

    ExactSetPropertyPacket synchronizes a set using diff-based updates, where update checks are based on membership of set values.

    Type Parameters

    • T

    Hierarchy (View Summary)

    Index

    Constructors

    • Type Parameters

      • T

      Parameters

      • id: string
      • OptionalinitialValues: ReadonlySet<T>
      • OptionalisUnreliable: boolean
      • Optionalmeta: Many<
            [
                "tuple",
                [
                    payload: [
                        "object_raw",
                        (
                            | ["full", ["boolean"]]
                            | [
                                "changes",
                                [
                                    "array",
                                    ((...) extends (...) ? (...) : (...)) extends true
                                        ? [(...), (...), (...), (...)]
                                        : [(...), (...)],
                                ],
                            ]
                        )[],
                    ],
                ],
                undefined,
            ],
        >

      Returns ExactSetPropertyPacket<T>

    Properties

    className: "ExactSetPropertyPacket"

    Class name of the packet, used for debugging purposes.

    signalPacket: SignalPacket<(payload: DiffPayload<T>) => void>

    Methods

    • Clears the value of the property for players that pass the predicate. Should only be used on the server.

      Parameters

      • predicate: (player: Player) => boolean

        The predicate to filter players

      Returns void

    • Returns the current value of the property.

      Parameters

      • Optionalplayer: Player

        The player to get the value for. Does nothing on the client.

      Returns Set<T>

      The current value of the property

    • Returns the value of the property for a specific player. Should only be used on the server.

      Parameters

      • player: Player

        The player to get the value for

      Returns Set<T>

      The value of the property for the player

      Use get instead.

    • Observes the property for changes. Unlike changed, this will fire the handler immediately if the value is already set. Else, it will wait for the value to be set and then fire the handler.

      Parameters

      • handler: (snapshot: Set<T>, diff: DiffPayload<T>) => void

        The handler to call when the property changes

      Returns Connection

      A connection that can be disconnected to stop observing the property

    • Sets the value of the property for players that pass the predicate. Should only be used on the server.

      Parameters

      • predicate: (player: Player) => boolean

        The predicate to filter players

      • value: Set

        The new value of the property

      Returns void

    • Sets the value of the property for a list of players. Should only be used on the server.

      Parameters

      • players: Player[]

        The list of players to set the value for

      • value: Set

        The new value of the property

      Returns void