pub struct RemoteWorldManager { /* private fields */ }Expand description
Manages the inbound side of entity replication — entities whose authoritative state comes from the remote peer.
Implementations§
Source§impl RemoteWorldManager
impl RemoteWorldManager
Sourcepub fn new(host_type: HostType) -> Self
pub fn new(host_type: HostType) -> Self
Creates a RemoteWorldManager for the given host_type side of a connection.
Sourcepub fn entity_waitlist(&self) -> &RemoteEntityWaitlist
pub fn entity_waitlist(&self) -> &RemoteEntityWaitlist
Returns a shared reference to the entity waitlist.
Sourcepub fn entity_waitlist_mut(&mut self) -> &mut RemoteEntityWaitlist
pub fn entity_waitlist_mut(&mut self) -> &mut RemoteEntityWaitlist
Returns a mutable reference to the entity waitlist.
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 from the remote engine.
Sourcepub fn send_entity_command(
&mut self,
converter: &dyn LocalEntityAndGlobalEntityConverter,
command: EntityCommand,
)
pub fn send_entity_command( &mut self, converter: &dyn LocalEntityAndGlobalEntityConverter, command: EntityCommand, )
Enqueues command for the entity identified in command via the remote engine, silently skipping if the entity no longer exists.
Sourcepub fn spawn_entity(&mut self, entity: &RemoteEntity)
pub fn spawn_entity(&mut self, entity: &RemoteEntity)
Notifies the waitlist that entity has been spawned, unblocking any queued operations.
Sourcepub fn despawn_entity(
&mut self,
_local_entity_map: &mut LocalEntityMap,
entity: &RemoteEntity,
)
pub fn despawn_entity( &mut self, _local_entity_map: &mut LocalEntityMap, entity: &RemoteEntity, )
Removes entity from the waitlist tracking structures.
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: &mut LocalEntityMap,
component_kinds: &ComponentKinds,
world: &mut W,
now: &Instant,
incoming_components: &mut HashMap<(OwnedLocalEntity, ComponentKind), Box<dyn Replicate>>,
incoming_updates: Vec<(Tick, OwnedLocalEntity, ComponentUpdate)>,
incoming_messages: Vec<(MessageIndex, EntityMessage<RemoteEntity>)>,
) -> 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: &mut LocalEntityMap, component_kinds: &ComponentKinds, world: &mut W, now: &Instant, incoming_components: &mut HashMap<(OwnedLocalEntity, ComponentKind), Box<dyn Replicate>>, incoming_updates: Vec<(Tick, OwnedLocalEntity, ComponentUpdate)>, incoming_messages: Vec<(MessageIndex, EntityMessage<RemoteEntity>)>, ) -> Vec<EntityEvent>
Processes all buffered incoming messages and updates, applying them to world and returning the resulting EntityEvents.
Sourcepub fn get_entity_auth_status(
&self,
entity: &RemoteEntity,
) -> Option<EntityAuthStatus>
pub fn get_entity_auth_status( &self, entity: &RemoteEntity, ) -> Option<EntityAuthStatus>
Returns the current authority status for entity’s remote channel, if one exists.
Trait Implementations§
Source§impl InScopeEntities<RemoteEntity> for RemoteWorldManager
impl InScopeEntities<RemoteEntity> for RemoteWorldManager
Source§fn has_entity(&self, entity: &RemoteEntity) -> bool
fn has_entity(&self, entity: &RemoteEntity) -> bool
true if entity is currently tracked as in-scope.