Skip to main content
Version: v3.0.0 (current)

PlayerSnapshot

Since 3.0.0. A copy of the fields of a player at one moment: the oldPlayer of the PlayerStateUpdate manager event. It has no methods, and its queue and node are the player's own, not copies: read the queue from the player after the change (newPlayer). For a filter change, filters is a copy of the filters' fields; otherwise it is the player's own filters.

export type PlayerSnapshot = Omit<FieldsOf<Player>, "filters"> & {
readonly filters: FieldsOf<Filters>;
};

In 2.x, oldPlayer was typed Player, so oldPlayer.getData() compiled and threw a TypeError: the copy never had the methods.