Horizon_Network_Common/
lib.rs

1//! # Horizon Network Common
2//!
3//! Shared types and protocols for the Horizon ecosystem:
4//! - **Horizon** - Game server instances (regions)
5//! - **Horizon-Atlas** - Server meshing proxy and load balancer
6//! - **Horizon-Maestro** - Container orchestration and deployment
7//!
8//! This crate provides the common data structures and communication protocols
9//! that enable these three systems to work together for infinite world scaling.
10//!
11//! ## Architecture
12//!
13//! ```text
14//! ┌─────────────────────────────────────────────────────────────────┐
15//! │                         Maestro                                  │
16//! │              (Container Orchestration)                           │
17//! └─────────────────────────┬───────────────────────────────────────┘
18//!                           │ SpawnServerRequest / SpawnServerResponse
19//!                           ▼
20//! ┌─────────────────────────────────────────────────────────────────┐
21//! │                          Atlas                                   │
22//! │        (Server Meshing Proxy + Player Routing)                   │
23//! └────────┬────────────────┬───────────────────┬───────────────────┘
24//!          │                │                   │
25//!          │ Registration   │ Heartbeat         │ Transfer
26//!          ▼                ▼                   ▼
27//! ┌────────────────┐ ┌────────────────┐ ┌────────────────┐
28//! │   Horizon      │ │   Horizon      │ │   Horizon      │
29//! │  Region(0,0,0) │ │  Region(1,0,0) │ │  Region(0,1,0) │
30//! └────────────────┘ └────────────────┘ └────────────────┘
31//! ```
32
33pub mod spatial;
34pub mod server;
35pub mod player;
36pub mod transfer;
37pub mod health;
38pub mod messages;
39
40// Re-export commonly used types
41pub use spatial::{WorldCoordinate, RegionCoordinate, RegionBounds};
42pub use server::{ServerId, ServerInfo, ServerStatus, ServerRegistration, ServerHeartbeat, RegistrationResponse, SpawnServerRequest, SpawnServerResponse};
43pub use player::{PlayerId, PlayerInfo, PlayerState, AuthenticationStatus, ConnectionState, MovementData, DisconnectReason};
44pub use transfer::{TransferToken, TransferRequest, TransferResult, TransferReason, TransferError, TransferNotification};
45pub use health::{HealthStatus, HealthCheck, HealthCheckRequest, ComponentHealth, ClusterHealth};
46pub use messages::{HorizonMessage, AtlasMessage, AtlasToMaestroMessage, MaestroMessage, Envelope, Ack};