AuthorityNet class
#include <Runtime/Net/Public/AuthorityNet.h>
Authority-side network handler. Owns server-side message routing.
Routes inbound messages: ConnectionHandshake, InputFrame, Ping/Pong, ClockSync, TravelNotify, LevelReady, SoulRPC.
Holds non-owning pointers to the server World and ReplicationSystem — the caller (typically TrinyxEngine) manages their lifetimes.
Base classes
-
template<typename Derived>class NetThreadBase<AuthorityNet>
Public functions
- void SetAuthorityWorld(WorldBase* world)
- Set the authority-side world (non-owning).
- auto GetAuthorityWorld() const -> WorldBase*
- Get the authority-side world.
- void SetReplicationSystem(ReplicationSystem* repl)
- Bind the ReplicationSystem (non-owning).
- auto GetReplicator() const -> ReplicationSystem*
- Get the bound ReplicationSystem.
- auto GetConfig() const -> const EngineConfig*
- Get the engine configuration.
- void BindSoulCallbacks()
- Called after ConnectionMgr is valid (post Initialize/InitAsHandler).
- auto GetInputLog(uint8_t ownerID) -> PlayerInputLog*
- Returns the input log for ownerID if the channel is active, nullptr otherwise.
- void WireNetMode(WorldBase* world)
- void HandleMessage(const ReceivedMessage& msg)
- Route one inbound network message.
- void TickDispatch()
- Dispatch spawn and correction build jobs for newly published logic frames. Called from Sentinel on every loop tick (ungated).
- void TickReplication()
- Flush built packets to the wire at the network update rate.
- void CreateInputLog(uint8_t ownerID)
- void SendStreamLoad(uint8_t ownerID, int64_t assetIDRaw, uint16_t instanceIndex, bool bAutoActivate)
- void SendChunkActivate(uint8_t ownerID, int64_t assetIDRaw, uint16_t instanceIndex)
Function documentation
void AuthorityNet:: WireNetMode(WorldBase* world)
Wire AuthoritySim into the world's LogicThread as the active net mode. Call after both LogicThread and AuthorityNet are initialized.
void AuthorityNet:: CreateInputLog(uint8_t ownerID)
Opens a ServerClientChannel for ownerID, sized to match the temporal slab. Call within the ConnectionHandshake handler when an ownerID is assigned.
void AuthorityNet:: SendStreamLoad(uint8_t ownerID,
int64_t assetIDRaw,
uint16_t instanceIndex,
bool bAutoActivate)
Tell ownerID's client to background-load a content chunk. bAutoActivate=true: client activates immediately on load (fire-and-forget, no reply). bAutoActivate=false: client sends StreamReady; server drives activation via SendChunkActivate.
void AuthorityNet:: SendChunkActivate(uint8_t ownerID,
int64_t assetIDRaw,
uint16_t instanceIndex)
Tell ownerID's client to activate a previously streamed chunk. Only meaningful when the original StreamLoad had bAutoActivate=false.