pub struct HostWorldManager { /* private fields */ }Expand description
Drives outbound entity-lifecycle replication for one side of a connection, tracking delivery state and processing inbound authority responses.
Implementations§
Source§impl HostWorldManager
impl HostWorldManager
Sourcepub fn new(host_type: HostType, user_key: u64) -> Self
pub fn new(host_type: HostType, user_key: u64) -> Self
Creates a HostWorldManager for the given host_type side and user_key.
Sourcepub fn take_incoming_events<E: Copy + Eq + Hash + Send + Sync, W: WorldMutType<E>>(
&mut self,
spawner: &mut dyn GlobalEntitySpawner<E>,
global_world_manager: &dyn GlobalWorldManagerType,
local_entity_map: &LocalEntityMap,
world: &mut W,
incoming_messages: Vec<(MessageIndex, EntityMessage<HostEntity>)>,
) -> Vec<EntityEvent>
pub fn take_incoming_events<E: Copy + Eq + Hash + Send + Sync, W: WorldMutType<E>>( &mut self, spawner: &mut dyn GlobalEntitySpawner<E>, global_world_manager: &dyn GlobalWorldManagerType, local_entity_map: &LocalEntityMap, world: &mut W, incoming_messages: Vec<(MessageIndex, EntityMessage<HostEntity>)>, ) -> Vec<EntityEvent>
Processes incoming_messages through the host engine and returns all resulting EntityEvents.
Sourcepub fn take_outgoing_commands(&mut self) -> Vec<EntityCommand>
pub fn take_outgoing_commands(&mut self) -> Vec<EntityCommand>
Drains and returns all pending outbound EntityCommands queued by the host engine.
Sourcepub fn init_static_entity_send_host_commands(
&mut self,
converter: &dyn LocalEntityAndGlobalEntityConverter,
global_entity: &GlobalEntity,
component_kinds: Vec<ComponentKind>,
)
pub fn init_static_entity_send_host_commands( &mut self, converter: &dyn LocalEntityAndGlobalEntityConverter, global_entity: &GlobalEntity, component_kinds: Vec<ComponentKind>, )
Sends the initial spawn command(s) for a static entity, coalescing components into a single message when present.
Sourcepub fn init_entity_send_host_commands(
&mut self,
converter: &dyn LocalEntityAndGlobalEntityConverter,
global_entity: &GlobalEntity,
component_kinds: Vec<ComponentKind>,
entity_update_manager: &mut EntityUpdateManager,
component_kinds_map: &ComponentKinds,
)
pub fn init_entity_send_host_commands( &mut self, converter: &dyn LocalEntityAndGlobalEntityConverter, global_entity: &GlobalEntity, component_kinds: Vec<ComponentKind>, entity_update_manager: &mut EntityUpdateManager, component_kinds_map: &ComponentKinds, )
Registers components for diff-tracking and sends initial spawn command(s) when an entity first enters connection scope.
Sourcepub fn send_command(
&mut self,
converter: &dyn LocalEntityAndGlobalEntityConverter,
command: EntityCommand,
)
pub fn send_command( &mut self, converter: &dyn LocalEntityAndGlobalEntityConverter, command: EntityCommand, )
Enqueues command for reliable delivery to the remote peer.
Sourcepub fn on_delivered_despawn_entity(
&mut self,
local_entity_map: &mut LocalEntityMap,
host_entity: &HostEntity,
)
pub fn on_delivered_despawn_entity( &mut self, local_entity_map: &mut LocalEntityMap, host_entity: &HostEntity, )
Handles confirmed delivery of a despawn command, recycling the host entity ID and updating metrics.