moo.sdk.objects.ensure_player_record
- moo.sdk.objects.ensure_player_record(obj)
Ensure a
Playerrow exists for obj withuser=None.Used by NPC initialization so the avatar reports
is_player() == Trueto the parser whileis_connected() == Falsecausestell()to silently drop (no connection). Idempotent: returns the existing Player if one already references this avatar.- Parameters:
obj – the avatar Object
- Returns:
the Player row (created or pre-existing)
- Raises:
UserError – if the current caller is not a wizard