pub struct Server {Show 27 fields
pub config: Arc<RuntimeConfig>,
pub permission_groups: PermissionGroupManager,
pub cancel_token: CancellationToken,
pub key_store: KeyStore,
pub registry_cache: RegistryCache,
pub worlds: WorldMap,
online_players: PlayerMap,
player_admissions: SyncMutex<FxHashMap<Uuid, PlayerAdmissionState>>,
pub tick_rate_manager: SyncRwLock<TickRateManager>,
pub scoreboards: DomainScoreboards,
pub(crate) command_storage: DomainCommandStorage,
command_dispatcher: SyncRwLock<CommandDispatcher<CommandSource, SteelCommandRuntime>>,
command_permission_keys: Vec<String>,
command_requests: CommandRequestQueue,
packet_processor: PacketProcessor,
chunk_encoding_pool: Arc<ThreadPool>,
pub jobs: ServerJobQueue,
pub player_data_storage: PlayerDataStorage,
player_permission_states: SyncRwLock<PermissionSubjectIndex>,
player_permission_updates: AsyncMutex<()>,
known_players: SyncMutex<KnownPlayerCacheState>,
known_player_save_idle: Notify,
profile_lookup_client: Client,
pending_player_joins: PlayerJoinQueue,
pending_player_disconnects: PlayerDisconnectQueue,
pub pending_world_changes: SyncMutex<Vec<(SharedEntity, WorldChangeRequest)>>,
pending_domain_switches: SyncMutex<Vec<DomainSwitchRequest>>,
}Expand description
The main server struct.
Fields§
§config: Arc<RuntimeConfig>Runtime configuration (view distance, compression, etc.).
permission_groups: PermissionGroupManagerRuntime permission groups and their persistence boundary.
cancel_token: CancellationTokenThe cancellation token for graceful shutdown.
key_store: KeyStoreThe key store for the server.
registry_cache: RegistryCacheThe registry cache for the server.
worlds: WorldMapA list of all the worlds on the server.
online_players: PlayerMapPlayers currently connected to the server, independent of world membership.
player_admissions: SyncMutex<FxHashMap<Uuid, PlayerAdmissionState>>UUIDs reserved by a join or disconnect/save lifecycle transition.
tick_rate_manager: SyncRwLock<TickRateManager>The tick rate manager for the server.
scoreboards: DomainScoreboardsCommand scoreboards isolated by Steel domain.
command_storage: DomainCommandStorageCommand NBT storage isolated by Steel domain.
command_dispatcher: SyncRwLock<CommandDispatcher<CommandSource, SteelCommandRuntime>>Saves and dispatches commands to appropriate handlers.
command_permission_keys: Vec<String>Steel-owned permission keys exposed for command autocomplete.
command_requests: CommandRequestQueueCommand work submitted from connection and console tasks.
packet_processor: PacketProcessorDecoded serverbound play packets handled during the inter-tick phase.
chunk_encoding_pool: Arc<ThreadPool>Dedicated worker pool for CPU-heavy chunk persistence and packet encoding.
jobs: ServerJobQueueJobs resumed from a known point in the server game tick.
player_data_storage: PlayerDataStoragePlayer data storage for saving/loading player state.
player_permission_states: SyncRwLock<PermissionSubjectIndex>Persisted permission state indexed by player UUID.
player_permission_updates: AsyncMutex<()>Serializes persistence and cache publication for player permission edits.
known_players: SyncMutex<KnownPlayerCacheState>Player identities and coalesced persistence state.
known_player_save_idle: NotifyWakes shutdown when the single known-player save worker becomes idle.
profile_lookup_client: ClientHTTP client used by online-mode name-to-profile lookups.
pending_player_joins: PlayerJoinQueuePlayer joins prepared by async I/O and finalized at the game tick safe point.
pending_player_disconnects: PlayerDisconnectQueueDisconnected players waiting to be detached at the next game tick safe point.
pending_world_changes: SyncMutex<Vec<(SharedEntity, WorldChangeRequest)>>Queued world changes to process after the tick.
pending_domain_switches: SyncMutex<Vec<DomainSwitchRequest>>Queued domain switches to process after world ticks.
Implementations§
Source§impl Server
impl Server
Sourcefn broadcast_system_chat(
&self,
message: &TextComponent,
excluded_player: Option<Uuid>,
)
fn broadcast_system_chat( &self, message: &TextComponent, excluded_player: Option<Uuid>, )
Logs and broadcasts a system chat message to online players.
Sourcepub(super) fn tab_list_components(
tick_stats: TabListTickStats,
) -> (TextComponent, TextComponent)
pub(super) fn tab_list_components( tick_stats: TabListTickStats, ) -> (TextComponent, TextComponent)
Builds the tab list header/footer with recent and five-second tick statistics.
Sourcepub(super) fn broadcast_tab_list(&self, tick_stats: TabListTickStats)
pub(super) fn broadcast_tab_list(&self, tick_stats: TabListTickStats)
Broadcasts the tab list header/footer with current TPS and MSPT statistics.
Sourcepub(crate) fn broadcast_sprint_report(&self, report: &SprintReport)
pub(crate) fn broadcast_sprint_report(&self, report: &SprintReport)
Broadcasts a sprint completion report to all players.
pub(super) fn broadcast_player_join_message( &self, player: &Player, previous_name: Option<&str>, )
pub(super) fn broadcast_player_leave_message(&self, player: &Player)
Sourcepub fn broadcast_ticking_state(&self)
pub fn broadcast_ticking_state(&self)
Broadcasts the current tick rate and frozen state to all clients. This should be called whenever the tick rate or frozen state changes.
Sourcepub fn broadcast_ticking_step(&self)
pub fn broadcast_ticking_step(&self)
Broadcasts the current step tick count to all clients. This should be called whenever the step tick count changes.
Sourcepub fn send_ticking_state_to_player(&self, player: &Player)
pub fn send_ticking_state_to_player(&self, player: &Player)
Sends the current ticking state and step packets to a joining player. This should be called when a player joins the server.
Sourcepub fn resend_player_context(self: &Arc<Self>, player: &Arc<Player>)
pub fn resend_player_context(self: &Arc<Self>, player: &Arc<Player>)
Resends client state that is not fully covered by CRespawn.
Sourcepub fn resend_player_permission_context(self: &Arc<Self>, player: &Arc<Player>)
pub fn resend_player_permission_context(self: &Arc<Self>, player: &Arc<Player>)
Resends the command tree and vanilla client permission-level projection.
Source§impl Server
impl Server
Sourcepub async fn prepare_spawn_area(&self) -> bool
pub async fn prepare_spawn_area(&self) -> bool
Generates the startup spawn area for the server default world.
Set PREGEN_SIZE to an odd chunk side length, or 0 to skip custom pregen.
Set PREGEN_WINDOW_SIZE to override the default 32-chunk window side length.
The configured size must fit the active-window unload-backpressure budget.
Source§impl Server
impl Server
Sourcepub async fn run(self: Arc<Self>, cancel_token: CancellationToken)
pub async fn run(self: Arc<Self>, cancel_token: CancellationToken)
Runs gameplay packets, game ticks, and chunk sending. Game-tick boundaries fork background chunk-scheduling epochs through each world’s task tracker.
Sourceasync fn run_game_tick(self: Arc<Self>, cancel_token: CancellationToken)
async fn run_game_tick(self: Arc<Self>, cancel_token: CancellationToken)
The main game tick loop (20 TPS, governed by tick rate manager).
fn record_tick_and_capture_tab_stats( &self, tick_count: u64, tick_duration_nanos: u64, ) -> Option<TabListTickStats>
async fn autosave_command_data(&self)
fn tick_command_data_autosave( self: &Arc<Self>, next_autosave: &mut Instant, saves: &mut JoinSet<()>, )
fn tick_pending_command_executions( &self, pending: &mut PendingCommandExecutionQueue<CommandSource>, )
fn tick_command_requests( self: &Arc<Self>, pending: &mut PendingCommandExecutionQueue<CommandSource>, )
fn execute_command_request( self: &Arc<Self>, pending: &mut PendingCommandExecutionQueue<CommandSource>, owner: CommandExecutionOwner, command: &str, )
fn send_command_suggestions( self: &Arc<Self>, player: &Arc<Player>, transaction_id: i32, input: &str, )
pub(super) fn build_command_suggestions( self: &Arc<Self>, sender: CommandSender, input: &str, ) -> Result<Suggestions, SuggestionError>
Sourceasync fn run_chunk_sending_tick(
self: Arc<Self>,
cancel_token: CancellationToken,
)
async fn run_chunk_sending_tick( self: Arc<Self>, cancel_token: CancellationToken, )
Chunk sending tick loop — encodes and sends chunks to players independently.
Sourcefn tick_chunk_sending(&self)
fn tick_chunk_sending(&self)
Executes one chunk sending tick across all worlds and players.
A per-world per-tick encode cache is used so overlapping view areas don’t re-encode the same chunk within a single tick.
Sourcefn send_chunks_for_player(
player: &Arc<Player>,
world: &Arc<World>,
encode_cache: &mut FxHashMap<ChunkPos, EncodedChunk>,
encoding_pool: &ThreadPool,
)
fn send_chunks_for_player( player: &Arc<Player>, world: &Arc<World>, encode_cache: &mut FxHashMap<ChunkPos, EncodedChunk>, encoding_pool: &ThreadPool, )
Three-phase chunk send for a single player: prepare (lock briefly), encode (no lock), commit (lock briefly + generation check).
Sourcefn advance_chunk_scheduling(&self)
fn advance_chunk_scheduling(&self)
Commits ready chunk lifecycle epochs and forks the next background work.
async fn tick_worlds_game( &self, workers: &WorldTickWorkers, tick_count: u64, runs_normally: bool, ) -> Result<(), WorldTickWorkerError>
pub(super) fn tick_jobs(self: &Arc<Self>, tick_count: u64, runs_normally: bool)
Source§impl Server
impl Server
Sourcepub fn known_players(&self) -> KnownPlayers
pub fn known_players(&self) -> KnownPlayers
Returns a snapshot of player identities known to this server.
Sourcepub fn record_known_player(
self: &Arc<Self>,
profile: &GameProfile,
) -> Option<String>
pub fn record_known_player( self: &Arc<Self>, profile: &GameProfile, ) -> Option<String>
Records a connected player identity in the persistent profile cache. Returns the previous cached name for this UUID, if any.
Sourcepub fn record_known_profile(
self: &Arc<Self>,
uuid: Uuid,
last_known_name: impl Into<String>,
)
pub fn record_known_profile( self: &Arc<Self>, uuid: Uuid, last_known_name: impl Into<String>, )
Records a UUID and last-known name in the persistent profile cache.
Sourcepub async fn resolve_player_profile(
self: &Arc<Self>,
name: &str,
) -> Result<KnownPlayer, ProfileLookupError>
pub async fn resolve_player_profile( self: &Arc<Self>, name: &str, ) -> Result<KnownPlayer, ProfileLookupError>
Resolves a vanilla game-profile command target by name or UUID.
Online players and cached profiles are checked first. Uncached UUIDs remain direct UUID targets in either server mode. Offline-mode names use vanilla’s deterministic UUID, while online mode queries the configured profile service.
§Errors
Returns an error when the profile is unknown or the profile service fails.
fn cached_player_profile(self: &Arc<Self>, name: &str) -> Option<KnownPlayer>
fn start_known_player_save_worker(self: &Arc<Self>)
async fn run_known_player_save_worker(self: &Arc<Self>)
Sourcepub async fn flush_known_players(&self) -> Result<()>
pub async fn flush_known_players(&self) -> Result<()>
Waits for the coalesced identity-cache writer and persists the final snapshot.
Later identity observations are ignored because the server is shutting down.
§Errors
Returns an error when the final rebuildable cache snapshot cannot be persisted.
Source§impl Server
impl Server
pub(super) fn apply_cached_or_default_permission_state( &self, player: &Player, ) -> u64
fn apply_player_permission_state( &self, player: &Player, state: PermissionSubjectState, ) -> u64
Sourcepub fn player_permission_state(
&self,
uuid: Uuid,
) -> Option<PermissionSubjectState>
pub fn player_permission_state( &self, uuid: Uuid, ) -> Option<PermissionSubjectState>
Returns one player’s cached persisted permission state.
Sourcepub(crate) fn is_operator(&self, uuid: Uuid) -> bool
pub(crate) fn is_operator(&self, uuid: Uuid) -> bool
Returns whether the latest published subject state assigns the operator group.
Sourcepub(crate) fn command_permission_snapshot(&self, uuid: Uuid) -> PermissionSet
pub(crate) fn command_permission_snapshot(&self, uuid: Uuid) -> PermissionSet
Captures effective command permissions from the latest published subject and group state.
Sourcepub async fn try_update_player_permissions<T, E>(
self: &Arc<Self>,
uuid: Uuid,
update: impl FnOnce(PermissionSubjectState) -> Result<(PermissionSubjectState, T), E> + Send,
) -> Result<(PermissionSubjectState, T), PlayerPermissionUpdateError<E>>
pub async fn try_update_player_permissions<T, E>( self: &Arc<Self>, uuid: Uuid, update: impl FnOnce(PermissionSubjectState) -> Result<(PermissionSubjectState, T), E> + Send, ) -> Result<(PermissionSubjectState, T), PlayerPermissionUpdateError<E>>
Atomically edits one player’s persisted permission state.
Persistence completes before the cache is published. An online player is refreshed from the latest cached snapshot at the server job tick stage.
§Errors
Returns an edit error, an unknown newly assigned group, or a storage error.
Sourcepub async fn replace_permission_groups(
self: &Arc<Self>,
config: PermissionGroupsConfig,
) -> Result<(), PermissionGroupManagerError>
pub async fn replace_permission_groups( self: &Arc<Self>, config: PermissionGroupsConfig, ) -> Result<(), PermissionGroupManagerError>
Replaces the complete permission group config and refreshes online players.
§Errors
Returns an error when validation or persistence fails.
Sourcepub async fn update_permission_groups(
self: &Arc<Self>,
update: impl FnOnce(&mut PermissionGroupsConfig) + Send,
) -> Result<(), PermissionGroupManagerError>
pub async fn update_permission_groups( self: &Arc<Self>, update: impl FnOnce(&mut PermissionGroupsConfig) + Send, ) -> Result<(), PermissionGroupManagerError>
Edits the latest permission group config and refreshes online players.
§Errors
Returns an error when validation or persistence fails.
Sourcepub async fn try_update_permission_groups<T, E>(
self: &Arc<Self>,
update: impl FnOnce(&mut PermissionGroupsConfig) -> Result<T, E> + Send,
) -> Result<T, PermissionGroupUpdateError<E>>
pub async fn try_update_permission_groups<T, E>( self: &Arc<Self>, update: impl FnOnce(&mut PermissionGroupsConfig) -> Result<T, E> + Send, ) -> Result<T, PermissionGroupUpdateError<E>>
Applies a fallible permission group edit and refreshes online players.
§Errors
Returns the caller edit error or a validation/persistence error.
fn queue_player_permission_refresh(self: &Arc<Self>, uuid: Uuid)
pub(crate) fn refresh_player_permission_state(self: &Arc<Self>, uuid: Uuid)
fn queue_online_permission_group_refresh(self: &Arc<Self>)
fn refresh_online_permission_groups(self: &Arc<Self>)
Source§impl Server
impl Server
Sourcepub fn queue_player_join(self: &Arc<Self>, player: Arc<Player>)
pub fn queue_player_join(self: &Arc<Self>, player: Arc<Player>)
Queues initial player join work.
Persistent data is loaded asynchronously, then world insertion is finalized at the game tick safe point so the socket reader can enter play immediately.
async fn prepare_player_join( &self, player: &Player, ) -> Result<DomainPlayerState, String>
pub(super) fn process_player_joins(self: &Arc<Self>)
pub(super) fn finish_prepared_player_join( self: &Arc<Self>, join: PendingPlayerJoin, )
pub(super) fn reserve_player_join(&self, player: &Player) -> bool
fn admit_reserved_player(&self, player: Arc<Player>) -> bool
fn reserve_player_disconnect(&self, player: &Arc<Player>) -> bool
pub(super) fn reserve_player_relocation(&self, player: &Arc<Player>) -> bool
fn transition_player_relocation_to_disconnect( &self, player: &Arc<Player>, ) -> bool
pub(super) fn release_player_admission( &self, uuid: Uuid, state: PlayerAdmissionState, )
fn remove_online_player_sync(&self, player: &Arc<Player>)
pub(crate) fn queue_player_disconnect(&self, player: Arc<Player>)
pub(crate) fn queue_detached_player_disconnect( &self, player: Arc<Player>, domain: String, player_data: Arc<PersistentPlayerData>, pending_token: PendingWorldChangeToken, )
pub(crate) fn queue_relocating_player_disconnect( &self, player: Arc<Player>, domain: String, player_data: Arc<PersistentPlayerData>, pending_token: PendingWorldChangeToken, )
pub(super) fn process_player_disconnects(&self) -> Vec<PendingPlayerDisconnect>
pub(super) fn process_player_disconnect( &self, player: Arc<Player>, ) -> Option<PendingPlayerDisconnect>
async fn save_disconnected_player(&self, pending: PendingPlayerDisconnect)
pub(super) fn start_player_disconnect_saves( self: &Arc<Self>, saves: &mut JoinSet<()>, )
Sourcepub fn broadcast_to_online<P: ClientPacket>(&self, packet: P)
pub fn broadcast_to_online<P: ClientPacket>(&self, packet: P)
Broadcasts a packet to every online player, regardless of world membership.
pub(super) fn broadcast_to_online_with<P: ClientPacket, F: Fn(&Player) -> P>( &self, packet: F, )
Sourcefn sync_tab_list(&self, player: &Arc<Player>)
fn sync_tab_list(&self, player: &Arc<Player>)
Sends full tab list synchronization for a newly joined player.
Server membership mirrors vanilla PlayerList; world entity spawning remains
owned by the per-world entity tracker.
pub(super) fn broadcast_player_latency_updates(&self)
Source§impl Server
impl Server
pub(super) async fn load_join_domain( &self, player: &Player, ) -> Result<String, String>
pub(super) async fn load_domain_player_state( &self, player: &Player, target_domain: &str, explicit_target_world: Option<Arc<World>>, ) -> Result<DomainPlayerState, String>
pub(super) async fn load_unprepared_domain_player_state( &self, player: &Player, target_domain: &str, explicit_target_world: Option<Arc<World>>, ) -> Result<UnpreparedDomainPlayerState, String>
async fn prepare_domain_player_state( &self, target_domain: &str, state: UnpreparedDomainPlayerState, ) -> Result<DomainPlayerState, String>
async fn prepare_target_spawn( &self, target_domain: &str, explicit_target_world: bool, world: &Arc<World>, ) -> Result<(Arc<World>, PreparedSpawn), String>
async fn prepare_default_spawn( world: &Arc<World>, ) -> Result<PreparedSpawn, String>
async fn prepare_respawn_spawn( world: &Arc<World>, respawn_data: &RespawnData, ) -> Result<PreparedSpawn, String>
fn resolve_saved_world( &self, saved_world: &str, target_domain: &str, explicit_target_world: Option<&Identifier>, player_name: &str, ) -> Option<Arc<World>>
pub(super) fn apply_domain_player_state( player: &Arc<Player>, state: &DomainPlayerState, )
pub(super) fn prepare_domain_restores( &self, player: &Player, state: &DomainPlayerState, ) -> PreparedDomainRestores
pub(super) fn install_domain_restores( player: &Player, residence_token: DomainResidenceToken, restores: &PreparedDomainRestores, ) -> bool
pub(super) fn schedule_domain_restores( &self, player: &Arc<Player>, residence_token: DomainResidenceToken, restores: PreparedDomainRestores, )
pub(super) fn root_vehicle_to_restore( state: &DomainPlayerState, ) -> Option<PersistentRootVehicle>
fn ender_pearls_to_restore( state: &DomainPlayerState, ) -> Vec<PersistentEnderPearl>
pub(super) fn resolve_pearl_world( &self, world_key: &str, expected_domain: &str, player: &Player, ) -> Option<Arc<World>>
pub(super) fn send_login_packet(&self, player: &Player, world: &World)
Sourcepub fn get_players(&self) -> Vec<Arc<Player>>
pub fn get_players(&self) -> Vec<Arc<Player>>
Gets all the players on the server
Sourcepub(crate) fn owns_online_player(&self, player: &Player) -> bool
pub(crate) fn owns_online_player(&self, player: &Player) -> bool
Returns whether this exact player owns the online session for its UUID.
Sourcepub(crate) fn live_world_for_player(
&self,
player: &Player,
) -> Option<Arc<World>>
pub(crate) fn live_world_for_player( &self, player: &Player, ) -> Option<Arc<World>>
Returns the world that owns this exact online player.
The player’s stored world pointer intentionally remains unchanged while detached domain data is loading, so live membership must also be present in that world’s player index.
Sourcepub(crate) fn command_world_for_player(
&self,
player: &Player,
) -> Option<Arc<World>>
pub(crate) fn command_world_for_player( &self, player: &Player, ) -> Option<Arc<World>>
Returns the live world in which a player may participate in gameplay commands.
A queued domain switch still has source-world membership until the safe point, but gameplay work must stop as soon as that transition owns the player. Finalization is live again and therefore remains available.
Sourcepub fn player_count(&self) -> usize
pub fn player_count(&self) -> usize
Returns the total number of players currently online across all worlds.
Sourcepub fn player_sample(&self) -> Vec<(String, String)>
pub fn player_sample(&self) -> Vec<(String, String)>
Returns a sample of up to 12 online players for the server list ping.
Sourcepub fn overworld(&self) -> &Arc<World> ⓘ
pub fn overworld(&self) -> &Arc<World> ⓘ
Returns the server default world or if not exists the first world.
§Panics
if no world exists on this server crisis is there!
Sourcepub fn respawn_world_and_data_for_domain(
&self,
domain: &str,
) -> Result<(Arc<World>, RespawnData), String>
pub fn respawn_world_and_data_for_domain( &self, domain: &str, ) -> Result<(Arc<World>, RespawnData), String>
Resolves the default respawn world and data for a domain.
Sourcepub fn respawn_data_for_domain(
&self,
domain: &str,
) -> Result<RespawnData, String>
pub fn respawn_data_for_domain( &self, domain: &str, ) -> Result<RespawnData, String>
Returns the default respawn data sent to clients in the given domain.
Sourcepub fn set_respawn_data(&self, respawn_data: RespawnData) -> Result<(), String>
pub fn set_respawn_data(&self, respawn_data: RespawnData) -> Result<(), String>
Sets the default respawn data for the respawn data’s domain and broadcasts it.
Source§impl Server
impl Server
pub(super) fn process_world_changes( self: &Arc<Self>, tick_count: u64, runs_normally: bool, )
fn queue_nether_portal_change( self: &Arc<Self>, entity: SharedEntity, source_world: Arc<World>, portal_pos: BlockPos, pending_token: PendingWorldChangeToken, tick_count: u64, runs_normally: bool, )
fn queue_end_portal_change( self: &Arc<Self>, entity: SharedEntity, source_world: Arc<World>, pending_token: PendingWorldChangeToken, tick_count: u64, runs_normally: bool, )
fn queue_end_entry_portal_change( self: &Arc<Self>, entity: SharedEntity, source_world: Arc<World>, pending_token: PendingWorldChangeToken, tick_count: u64, runs_normally: bool, )
fn queue_end_portal_player_return_change( self: &Arc<Self>, entity: SharedEntity, source_world: Arc<World>, pending_token: PendingWorldChangeToken, tick_count: u64, runs_normally: bool, )
fn queue_end_portal_entity_return_change( self: &Arc<Self>, entity: SharedEntity, source_world: Arc<World>, pending_token: PendingWorldChangeToken, tick_count: u64, runs_normally: bool, )
fn queue_end_gateway_change( self: &Arc<Self>, entity: SharedEntity, source_world: Arc<World>, portal_pos: BlockPos, pending_token: PendingWorldChangeToken, tick_count: u64, runs_normally: bool, )
pub(super) fn can_teleport_between_worlds( &self, entity: &dyn Entity, source_world: &World, target_world: &World, ) -> bool
fn projectile_owner_seen_credits_in_domain( &self, domain: &str, uuid: &Uuid, ) -> Option<bool>
fn strict_respawn_world_and_data_for_domain( &self, domain: &str, ) -> Result<(Arc<World>, RespawnData), String>
fn begin_player_relocation( &self, player: &Player, ) -> Result<(Arc<World>, PendingWorldChangeToken), String>
Sourcepub fn queue_player_world_selection(
&self,
player: Arc<Player>,
target_world: Arc<World>,
) -> Result<(), String>
pub fn queue_player_world_selection( &self, player: Arc<Player>, target_world: Arc<World>, ) -> Result<(), String>
Queues a selected loaded world through the player’s relocation lease.
Same-domain selections move to the world’s spawn. Cross-domain selections restore that domain while honoring the explicit target.
Sourcepub fn queue_domain_switch(
&self,
player: Arc<Player>,
target_domain: String,
) -> Result<(), String>
pub fn queue_domain_switch( &self, player: Arc<Player>, target_domain: String, ) -> Result<(), String>
Queues a player domain switch for processing at the server tick safe point.
pub(super) fn process_domain_switches(self: &Arc<Self>)
fn start_domain_switch( self: &Arc<Self>, request: DomainSwitchRequest, ) -> Result<(), String>
fn process_player_world_selection( self: &Arc<Self>, entity: SharedEntity, target_world: Arc<World>, pending_token: PendingWorldChangeToken, tick_count: u64, runs_normally: bool, )
Sourcepub fn queue_world_change(
&self,
entity: SharedEntity,
request: WorldChangeRequest,
)
pub fn queue_world_change( &self, entity: SharedEntity, request: WorldChangeRequest, )
Queues a world change to be processed after the current tick.
Source§impl Server
impl Server
pub(crate) fn permission_rule_suggestions(&self) -> Vec<String>
pub(crate) fn permission_metadata_suggestions(&self) -> Vec<String>
Sourcepub async fn new(
chunk_runtime: Arc<Runtime>,
cancel_token: CancellationToken,
config: RuntimeConfig,
worlds_config: WorldsConfig,
permission_groups: PermissionGroupManager,
) -> Result<Self, String>
pub async fn new( chunk_runtime: Arc<Runtime>, cancel_token: CancellationToken, config: RuntimeConfig, worlds_config: WorldsConfig, permission_groups: PermissionGroupManager, ) -> Result<Self, String>
Creates a new server with only Steel’s built-in commands.
Sourcepub async fn new_with_commands(
chunk_runtime: Arc<Runtime>,
cancel_token: CancellationToken,
config: RuntimeConfig,
worlds_config: WorldsConfig,
permission_groups: PermissionGroupManager,
command_registry: CommandRegistry,
) -> Result<Self, String>
pub async fn new_with_commands( chunk_runtime: Arc<Runtime>, cancel_token: CancellationToken, config: RuntimeConfig, worlds_config: WorldsConfig, permission_groups: PermissionGroupManager, command_registry: CommandRegistry, ) -> Result<Self, String>
Creates a new server and atomically merges startup command extensions after built-ins.
Sourcepub async fn save_command_storage(&self) -> Result<usize>
pub async fn save_command_storage(&self) -> Result<usize>
Saves all dirty domain command storage through domain default worlds.
Sourcepub async fn save_command_data(&self) -> CommandDataSaveResults
pub async fn save_command_data(&self) -> CommandDataSaveResults
Saves all command-owned persistent data while allowing each data set to fail independently.
Sourcepub fn submit_command(
&self,
sender: CommandSender,
command: String,
) -> Result<(), CommandQueueFull>
pub fn submit_command( &self, sender: CommandSender, command: String, ) -> Result<(), CommandQueueFull>
Queues a command for execution at the start of the next game tick.
pub(crate) fn submit_command_suggestions( &self, player: Arc<Player>, transaction_id: i32, input: String, ) -> Result<(), CommandQueueFull>
Sourcepub(crate) fn schedule_play_packet(
&self,
player: Arc<Player>,
packet: ScheduledPlayPacket,
payload_bytes: usize,
)
pub(crate) fn schedule_play_packet( &self, player: Arc<Player>, packet: ScheduledPlayPacket, payload_bytes: usize, )
Schedules a decoded play packet for the inter-tick packet phase.
Sourcepub fn command_completions(
self: &Arc<Self>,
sender: CommandSender,
input: &str,
) -> Vec<CommandCompletion>
pub fn command_completions( self: &Arc<Self>, sender: CommandSender, input: &str, ) -> Vec<CommandCompletion>
Returns Brigadier completions visible to a command sender.
Auto Trait Implementations§
impl !Freeze for Server
impl !RefUnwindSafe for Server
impl !UnwindSafe for Server
impl Send for Server
impl Sync for Server
impl Unpin for Server
impl UnsafeUnpin for Server
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreArc<SyncMutex<>>