group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
registry_serialization Namespace Reference

Utilities for serializing and deserializing the ECS registry over the network. More...

Classes

struct  RemoteInputRecord
 A paired entity ID and input snapshot received from a remote client. More...
class  Loader
 Deserializes registry snapshots received from the server and applies them locally. More...

Typedefs

using Synced

Functions

std::vector< uint8_t > encodeDelta (const std::vector< uint8_t > &baseline, const std::vector< uint8_t > &current)
 Compute an RLE byte-diff patch from baseline to current.
std::vector< uint8_t > applyDelta (const std::vector< uint8_t > &baseline, const uint8_t *patch, std::size_t patchSize, std::size_t outputSize)
 Reconstruct current from baseline + patch.
std::vector< uint8_t > serialize (const entt::registry &registry)
 Serialize the full registry state into a byte buffer for transmission.

Detailed Description

Utilities for serializing and deserializing the ECS registry over the network.

Typedef Documentation

◆ Synced

Initial value:
std::tuple<entt::entity,
Definition AbilityState.hpp:87
Snapshot of an entity's full animation state at one instant.
Definition AnimSnapshot.hpp:73
Per-entity state of a continuous beam weapon.
Definition BeamState.hpp:19
Associates an entity with a connected network client.
Definition ClientId.hpp:10
Collision shape attached to an entity.
Definition CollisionShape.hpp:34
ECS component: information about the entity that killed this player.
Definition DeathInfo.hpp:14
ECS component: one-shot weapon pickup spawned at a player's death position.
Definition DroppedWeapon.hpp:14
A burning area on the ground that damages players standing in it.
Definition FireField.hpp:16
Definition GrenadeState.hpp:15
ECS component: world weapon pickup point with respawn cooldown.
Definition HealthPackSpawner.hpp:8
ECS component: player health, armor, and passive heal cooldown.
Definition Health.hpp:8
World-space orientation as a unit quaternion. Identity = no rotation.
Definition Orientation.hpp:16
Replicated tint assigned to a player on connect.
Definition PlayerColor.hpp:15
ECS component: per-player scoreboard statistics for the current match.
Definition PlayerMatchStats.hpp:16
Replicated player display name.
Definition PlayerName.hpp:28
Replicated subset of player locomotion state.
Definition PlayerVisState.hpp:40
World-space position of an entity, in game units.
Definition Position.hpp:10
ECS component: world powerup pickup point with respawn cooldown.
Definition PowerupSpawner.hpp:17
Component attached to projectile entities.
Definition Projectile.hpp:18
Marker on each ragdoll-body entity; points back to the parent ragdoll character and which bone slot t...
Definition Ragdoll.hpp:58
ECS component: player respawn point with cooldown state.
Definition RespawnPoint.hpp:13
ECS component: countdown until a dead player respawns.
Definition RespawnTimer.hpp:10
Linear velocity of an entity, in game units per second.
Definition Velocity.hpp:10
ECS component: world weapon pickup point with respawn cooldown.
Definition WeaponSpawner.hpp:9
Component attached to armed entities (players).
Definition WeaponState.hpp:60

Function Documentation

◆ applyDelta()

std::vector< uint8_t > registry_serialization::applyDelta ( const std::vector< uint8_t > & baseline,
const uint8_t * patch,
std::size_t patchSize,
std::size_t outputSize )

Reconstruct current from baseline + patch.

Parameters
baselineReceiver's stored baseline (size must match outputSize).
patchThe bytes returned by a prior encodeDelta.
outputSizeExpected size of the reconstructed buffer (passed on the wire as the third u32 of the delta header).
Returns
Reconstructed buffer of size outputSize, or empty on parse error (truncated patch, malformed offsets).
Here is the caller graph for this function:

◆ encodeDelta()

std::vector< uint8_t > registry_serialization::encodeDelta ( const std::vector< uint8_t > & baseline,
const std::vector< uint8_t > & current )

Compute an RLE byte-diff patch from baseline to current.

Both buffers MUST have the same size; the returned patch reconstructs current from a copy of baseline via applyDelta. The patch is always smaller than current only when many bytes are unchanged; callers should compare patch size to full size before sending.

Parameters
baselineBytes the receiver currently holds.
currentBytes the receiver should arrive at.
Returns
Patch bytes (possibly empty if both inputs are byte-identical).
Here is the caller graph for this function:

◆ serialize()

std::vector< uint8_t > registry_serialization::serialize ( const entt::registry & registry)

Serialize the full registry state into a byte buffer for transmission.

Parameters
registryThe source ECS registry.
Returns
A byte vector containing the serialized snapshot.
Here is the call graph for this function:
Here is the caller graph for this function: