| Crates.io | Horizon-Network-Common |
| lib.rs | Horizon-Network-Common |
| version | 0.2.0 |
| created_at | 2025-12-02 19:24:02.921232+00 |
| updated_at | 2025-12-02 20:24:53.082578+00 |
| description | Shared network types and protocols for Horizon ecosystem (Horizon, Atlas, Maestro) |
| homepage | |
| repository | https://github.com/Far-Beyond-Dev/Horizon-Network-Common |
| max_upload_size | |
| id | 1962463 |
| size | 72,459 |
Shared network types and protocols for the Horizon game server ecosystem.
This crate provides the common data structures and communication protocols used by:
Add to your Cargo.toml:
[dependencies]
horizon_network_common = "0.1"
Or with git:
[dependencies]
horizon_network_common = { git = "https://github.com/Far-Beyond-Dev/Horizon-Network-Common" }
| Module | Description |
|---|---|
spatial |
WorldCoordinate, RegionCoordinate, RegionBounds |
server |
ServerId, ServerInfo, ServerRegistration, ServerHeartbeat |
player |
PlayerId, PlayerInfo, PlayerState, MovementData |
transfer |
TransferToken, TransferRequest, TransferResult |
health |
HealthStatus, HealthCheck, ClusterHealth |
messages |
HorizonMessage, AtlasMessage, MaestroMessage |
┌─────────────────────────────────────────────────────────────────┐
│ Maestro │
│ (Container Orchestration) │
└─────────────────────────┬───────────────────────────────────────┘
│ SpawnServerRequest / SpawnServerResponse
▼
┌─────────────────────────────────────────────────────────────────┐
│ Atlas │
│ (Server Meshing Proxy + Player Routing) │
└────────┬────────────────┬───────────────────┬───────────────────┘
│ │ │
│ Registration │ Heartbeat │ Transfer
▼ ▼ ▼
┌────────────────┐ ┌────────────────┐ ┌────────────────┐
│ Horizon │ │ Horizon │ │ Horizon │
│ Region(0,0,0) │ │ Region(1,0,0) │ │ Region(0,1,0) │
└────────────────┘ └────────────────┘ └────────────────┘
use horizon_network_common::{
WorldCoordinate, RegionCoordinate, RegionBounds,
ServerInfo, ServerRegistration,
PlayerId, PlayerInfo,
};
// Create a region coordinate
let region = RegionCoordinate::new(1, 0, 0);
// Convert to world position
let world_pos = region.to_world_center(1000.0);
// Check if a position is in bounds
let bounds = RegionBounds::from_center(world_pos, 500.0);
assert!(bounds.contains(&world_pos));
WorldCoordinate - 3D position with f64 precisionRegionCoordinate - Discrete 3D grid position (i64)RegionBounds - AABB bounding box for regionsServerId - Unique server identifier (UUID)ServerInfo - Server metadata and capabilitiesServerRegistration - Registration request from Horizon to AtlasServerHeartbeat - Periodic health/load updatesPlayerId - Unique player identifier (UUID)PlayerInfo - Player metadata and statePlayerState - Complete player state for transfersMovementData - Velocity/acceleration for predictionTransferToken - Cryptographically signed transfer authorizationTransferRequest - Request to move player between serversTransferResult - Outcome of a transfer operationHorizonMessage - Messages from Horizon to AtlasAtlasMessage - Messages from Atlas to HorizonMaestroMessage - Messages from Maestro to AtlasEnvelope<T> - Message wrapper with metadataMIT