Platform

aether-registry

World discovery, search, matchmaking, and portal registration

The aether-registry crate provides world discovery, search, matchmaking, and session management for the Aether platform. It maintains a catalog of published worlds and handles player-to-server assignment.

Overview

The registry is the central directory that players query to find and join worlds. It supports:

  • World manifests with metadata, categories, status, and validation.
  • Discovery and search with filtering and sorting by relevance, popularity, or recency.
  • Matchmaking that assigns players to appropriate server instances based on region and criteria.
  • Portal routing that resolves portal URLs to specific world instances.
  • Session management that tracks server instance availability and player assignment.

Key Types

WorldManifest

The metadata record for a published world in the registry.

use aether_registry::{WorldManifest, WorldCategory, WorldStatus};

let manifest = WorldManifest {
    id: "plaza-central".into(),
    name: "Central Plaza".into(),
    category: WorldCategory::Social,
    status: WorldStatus::Published,
    max_players: 64,
    description: "The main social hub".into(),
};

DiscoveryFilter

Specifies criteria for searching the world catalog.

use aether_registry::{DiscoveryFilter, DiscoverySort, DiscoveryResult};

let filter = DiscoveryFilter {
    category: Some(WorldCategory::Social),
    min_players: Some(5),
    max_players: Some(50),
    search_text: Some("plaza".into()),
};
let results: Vec<DiscoveryResult> = registry.search(&filter, DiscoverySort::Popularity)?;

SessionManager

Manages player-to-server assignment and tracks active instances.

use aether_registry::{SessionManager, SessionManagerPolicy, SessionState, RegionPolicy};

let policy = SessionManagerPolicy {
    region: RegionPolicy::NearestAvailable,
    max_players_per_instance: 64,
};
let mut sessions = SessionManager::new(policy);

PortalResolver

Resolves portal URLs to concrete server instances.

use aether_registry::{PortalResolver, PortalRoute, PortalScheme};

let resolver = PortalResolver::new();
let route = resolver.resolve("aether://plaza-central")?;

MatchCriteria

Defines matchmaking preferences for player assignment.

use aether_registry::{MatchCriteria, MatchOutcome, ServerInstance};

let criteria = MatchCriteria {
    world_id: "arena-pvp".into(),
    preferred_region: "us-east".into(),
    party_size: 4,
};
let outcome: MatchOutcome = sessions.match_player(player_id, &criteria)?;

Usage Examples

World Registration

use aether_registry::{
    WorldManifest, WorldCategory, WorldStatus, validate_manifest,
};

let manifest = WorldManifest {
    id: "my-world".into(),
    name: "My Custom World".into(),
    category: WorldCategory::Game,
    status: WorldStatus::Draft,
    max_players: 32,
    description: "A custom adventure world".into(),
};
validate_manifest(&manifest)?;

Player Matchmaking

use aether_registry::{
    SessionManager, SessionManagerPolicy, MatchCriteria,
    MatchOutcome, RegionPolicy,
};

let policy = SessionManagerPolicy {
    region: RegionPolicy::NearestAvailable,
    max_players_per_instance: 64,
};
let mut sessions = SessionManager::new(policy);

let outcome = sessions.match_player(player_id, &MatchCriteria {
    world_id: "plaza-central".into(),
    preferred_region: "eu-west".into(),
    party_size: 1,
})?;