StaticclearClear all avatars (for testing). WARNING: This will not properly clean up objects. Only use for testing or shutdown.
StaticfindFind an avatar by its player ID.
The MongoDB _id of the player
The avatar, or undefined if not found
StaticgetStaticgetGet count of active avatars.
StaticisType-guard: is this Stuff an Avatar?
Identity is read off the template path prefix
(Avatar.TEMPLATE_PATH_PREFIX === '/obj/Avatar/') rather than
instanceof Avatar: a Stuff's template path is its durable
identity, in contrast to its backing class (which can change
across HMR cycles). The guard narrows to Avatar for callers
that go on to use the Avatar-specific surface
(getPlayerId(), getUser(), etc.).
Note: callers who genuinely want TS compile-time typechecking
(e.g., "this method requires an Avatar receiver") may still
reach for instanceof Avatar — the two have distinct purposes
per the inline-comment guidance in the MR review.
StaticloadLoad every Avatar this user owns into the runtime, returning the full set. Reuses any Avatars already registered (multiplexing — a second connection for the same user finds the existing Avatars, doesn't re-clone). Otherwise clones from the user's avatar templates and registers via PostRegistration.
Threads the user reference and playerId into the clone context so
each Avatar's postRegister sees its owning user synchronously.
StaticregisterRegister an avatar by playerId. Called automatically when Avatar is registered with StuffApi.
The Avatar object to register
StaticunregisterUnregister an avatar by playerId. Called automatically when Avatar is destroyed.
The Avatar object to unregister
Static API for Player/Avatar management.