mud_server.core.world_registry

World registry and loader for multi-world support.

The registry is responsible for: - Listing available worlds from the database catalog - Filtering worlds by user permissions - Loading world packages from disk on demand - Caching World instances for reuse

Classes

WorldRegistry

World registry with lazy-loading and permission filtering.

Module Contents

class mud_server.core.world_registry.WorldRegistry(*, worlds_root=None)[source]

World registry with lazy-loading and permission filtering.

This class centralizes access to worlds and avoids repeated disk loads by caching World instances in memory.

list_worlds(*, include_inactive=False)[source]

Return all worlds in the catalog.

list_worlds_for_user(user_id, *, role=None, include_inactive=False)[source]

Return worlds accessible to the given user.

get_world(world_id)[source]

Load and return the World for the given world_id.

Raises:

ValueError – If the world does not exist or is inactive.

clear_cache()[source]

Clear cached world instances (used for tests or hot reloads).