Deserializes registry snapshots received from the server and applies them locally.
More...
#include <RegistrySerialization.hpp>
|
| | Loader (entt ::registry ®istry) |
| | Construct a Loader bound to the given registry.
|
| void | apply (const uint8_t *data, size_t size, std::optional< entt::entity > localPlayerServerEntity=std::nullopt, uint32_t *outServerAckedClientTick=nullptr) |
| | Apply a serialized registry snapshot to the local registry.
|
| entt::entity | map (entt::entity e) const |
| | Map a server-side entity ID to its local equivalent.
|
Deserializes registry snapshots received from the server and applies them locally.
◆ Loader()
| registry_serialization::Loader::Loader |
( |
entt ::registry & | registry | ) |
|
|
inlineexplicit |
Construct a Loader bound to the given registry.
- Parameters
-
| registry | The local ECS registry to update. |
◆ apply()
| void registry_serialization::Loader::apply |
( |
const uint8_t * | data, |
|
|
size_t | size, |
|
|
std::optional< entt::entity > | localPlayerServerEntity = std::nullopt, |
|
|
uint32_t * | outServerAckedClientTick = nullptr ) |
Apply a serialized registry snapshot to the local registry.
- Parameters
-
| data | Pointer to the serialized data buffer. |
| size | Size of the data buffer in bytes. |
| localPlayerServerEntity | Optional server-side entity ID of the local player (excluded from remote input application). |
| outServerAckedClientTick | Optional out-param. If non-null, receives the tick field from the local player's InputSnapshot in the server's remote-input list — the most-recently-applied client input tick the server has processed. Used by Phase 5b reconciliation to know how far forward to replay client predicted inputs after the snapshot apply. Set to 0 if the local player has no input record in this snapshot (e.g. no inputs sent yet). |
◆ map()
| entt::entity registry_serialization::Loader::map |
( |
entt::entity | e | ) |
const |
|
nodiscard |
Map a server-side entity ID to its local equivalent.
- Parameters
-
- Returns
- The corresponding local entity, or entt::null if not mapped.
◆ loader
| entt::continuous_loader registry_serialization::Loader::loader |
|
private |
◆ registry
| entt::registry& registry_serialization::Loader::registry |
|
private |
The documentation for this class was generated from the following files: