PlayerInputLog struct

Public functions

auto IsDirty() const -> bool
void ClearDirty()
void Initialize(uint32_t temporalFrameCount)
Must be called before use. Allocates Depth slots.
void Store(const InputWindowPacket& payload)
auto ConsumeFrame(uint32_t frameNumber) -> InputConsumeResult

Public variables

std::unique_ptr<PlayerInputLogEntry[]> Entries
uint32_t Depth
uint32_t LastConsumedFrame
uint32_t LastReceivedFrame
uint32_t HighWaterFirstFrame
int32_t FrameOffset
bool bActive
bool bDirty
uint32_t EarliestDirtyFrame
uint32_t LastStallLogFrame

Function documentation

void PlayerInputLog::Store(const InputWindowPacket& payload)

Called by NetThread when an InputFrame arrives. Payload carries client-local frame numbers. FrameOffset is applied internally to translate to server-frame space before ring indexing. For frames not yet consumed: store normally (first-write-wins with out-of-order correction). For frames already consumed as predicted: compare and mark dirty if different.

InputConsumeResult PlayerInputLog::ConsumeFrame(uint32_t frameNumber)

Called by server LogicThread injector each sim tick. Hit: advances LastConsumedFrame, returns the real entry. NotYetReceived (within lead budget): writes a predicted entry from last known state and returns it — server keeps running, entry is flagged for correction on late arrival. NotYetReceived (beyond lead budget): caller should stall the sim.