moo.sdk.objects.ensure_player_record

moo.sdk.objects.ensure_player_record(obj)

Ensure a Player row exists for obj with user=None.

Used by NPC initialization so the avatar reports is_player() == True to the parser while is_connected() == False causes tell() 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