PlayerEventOptions: {
    replayPresent?: boolean;
    requireProfile?: boolean;
}

Type declaration

  • Optional replayPresent?: boolean

    Whether to replay the callback for players who already satisfy the threshold at the moment of subscription. Defaults to true.

    true matches the historical behaviour: before the tracker was shared per engine, each definePlayerHelper call built a cold tracker whose first tick announced everyone already present. Keeping that as the default means a handler wired after an await — loading persisted state, for instance — still sees whoever arrived in the meantime.

    The replay is unconditional: subscribing from inside another handler still replays every player present at that moment, including the ones being announced on that very tick. The per-tick subscriber snapshot is what keeps this exactly-once — a subscription created mid-delivery receives nothing from the remainder of the pass.

    Set false if you only want players who arrive from now on.

  • Optional requireProfile?: boolean

    Whether to wait for the avatar profile before firing.

    true (default) preserves the historical behaviour: the callback runs once identity and an AvatarBase component are both present, so avatar is set. Note this gates on the component existing, not on the name being usable — name can still be '' or an address echo, so render displayName and check nameResolved.

    false fires as soon as the player's identity exists — earlier, and also for peers whose profile replicates late or never. name may be '' and avatar undefined; render displayName instead, and use onPlayerNameChanged to react when the profile shows up. This is the threshold an authoritative server wants, since it is the point at which the address becomes usable as a key.