FSpatialStreamServer
- Module
- Networking
- Header
#include "Networking/Replication/SpatialStream.h"- Namespace
Mowo
Public functions
| Returns | Name | Description |
|---|---|---|
void | SetConfig | |
const FSpatialStreamConfig& | GetConfig | |
uint32_t | Publish | Appends a delta to a key's history and returns its version (1, 2, ... |
bool | Compact | Replaces every history entry up to and including throughVersion with one snapshot entry at that version. |
uint32_t | GetVersion | |
size_t | GetHistoryEntryCount | |
size_t | GetHistoryBytes | |
size_t | GetKeyCount | |
void | AddClient | |
void | RemoveClient | |
bool | HasClient | |
void | SetInterest | Explicit interest, nearest first: the first key sends first. |
void | SetInterestRadius | Radius interest: a key enters the set at distance <= enterRadius and leaves only beyond leaveRadius, so walking along a border does not make a key flap in and out. |
void | RefreshInterest | |
void | SetKnownVersion | What the client says it already has (a persisted cache), so a rejoin resends only what changed. |
bool | IsInInterest | |
uint32_t | GetAckedVersion | |
void | OnPacket | Packets arriving from a client: acknowledgements and interest updates. |
void | Tick | Sends what each client's budget allows, nearest first. |
FSpatialClientStats | GetClientStats | |
void | Clear |
Function details
SetConfig
void SetConfig(const FSpatialStreamConfig& config)GetConfig
const FSpatialStreamConfig& GetConfig() constPublish
uint32_t Publish(const FSpatialKey& key, std::vector<uint8_t> payload)Appends a delta to a key's history and returns its version (1, 2, ... per key, strictly increasing). Interested clients get it on their next Tick.
Compact
bool Compact(const FSpatialKey& key, uint32_t throughVersion, std::vector<uint8_t> snapshotPayload)Replaces every history entry up to and including throughVersion with one snapshot entry at that version. A client already past it is unaffected; a client behind it receives the snapshot and then the later deltas. False if the key or version is unknown.
GetVersion
uint32_t GetVersion(const FSpatialKey& key) constGetHistoryEntryCount
size_t GetHistoryEntryCount(const FSpatialKey& key) constGetHistoryBytes
size_t GetHistoryBytes(const FSpatialKey& key) constGetKeyCount
size_t GetKeyCount() constAddClient
void AddClient(uint32_t clientId)RemoveClient
void RemoveClient(uint32_t clientId)HasClient
bool HasClient(uint32_t clientId) constSetInterest
void SetInterest(uint32_t clientId, const std::vector<FSpatialKey>& keysNearestFirst)Explicit interest, nearest first: the first key sends first.
SetInterestRadius
void SetInterestRadius(uint32_t clientId, FSpatialDistanceFn distance, float enterRadius, float leaveRadius)Radius interest: a key enters the set at distance <= enterRadius and leaves only beyond leaveRadius, so walking along a border does not make a key flap in and out. Nearest sends first. Re-evaluated every interestRefreshSeconds and whenever a new key is published.
RefreshInterest
void RefreshInterest(uint32_t clientId)SetKnownVersion
void SetKnownVersion(uint32_t clientId, const FSpatialKey& key, uint32_t version)What the client says it already has (a persisted cache), so a rejoin resends only what changed.
IsInInterest
bool IsInInterest(uint32_t clientId, const FSpatialKey& key) constGetAckedVersion
uint32_t GetAckedVersion(uint32_t clientId, const FSpatialKey& key) constOnPacket
void OnPacket(uint32_t clientId, const uint8_t* data, size_t len)Packets arriving from a client: acknowledgements and interest updates.
Tick
void Tick(float deltaTime, const FSpatialSendFn& send)Sends what each client's budget allows, nearest first.
GetClientStats
FSpatialClientStats GetClientStats(uint32_t clientId) constClear
void Clear()