Skip to main content

Module sync

Module sync 

Source
Expand description

Sync registration, snapshotting, and packet application. Sync registration, snapshots, and packet application.

This module is the bridge between Bevy ECS state and the wire format used by NetResource. Attribute macros submit metadata into inventory; this module collects that metadata, registers systems, and translates packets in both directions.

Structs§

ComponentRegistration
Metadata for a syncable component type.
PrefabRegistration
Metadata for a prefab definition used to spawn visuals remotely.
PrefabRegistry
Runtime registry for prefab handlers.
ResourceRegistration
Metadata for a syncable resource type.
SyncRegistry
Runtime registry for component sync handlers.
SyncResourceRegistry
Runtime registry for resource sync handlers.
SyncResourceSendState
Per-system state used to dedupe and coalesce resource snapshots.
SyncResourceSettings
Runtime options for syncing a resource.

Traits§

SyncComponent
Trait implemented by syncable components.
SyncResource
Trait implemented by syncable resources.

Functions§

apply_incoming_packets
Applies queued incoming replication packets to the local world.
apply_resource_update
Applies a resource snapshot only when the serialized value actually changed.
assign_network_ids
Assigns network IDs to newly replicated entities on the server.
assign_prefab_ids
Detects prefab matches on newly replicated entities.
flush_network_outbox
Flushes queued packets after the frame has finished mutating state.
hash_type_path
FNV-1a hash used to derive wire IDs from type paths.
poll_network_incoming
Poll hook run before the main replication systems.
register_sync_components
Collects all inventory registrations and stores them in runtime registries.
replicate_removals
Converts despawned replicated entities into network despawn packets.
sync_component
Sends updated sync components for entities that are added or changed.
sync_new_connections
Sends the initial world state to newly connected clients.
sync_resource
Sends updated resources when they are added or changed.
sync_resource_with_settings
Sends updated resources with byte-level dedupe and optional send coalescing.