TimedQueuedConnectionReceiver
A class in Root.Township, Alta.Networking.Internal.
Client connection receiver that spends a time budget per frame on messages and queues the rest, to keep the frame rate up. Queues everything until the local player is set.
Constructors
Fields
4 private and internal fields
| Member | What it is |
|---|
private bool isReady | True once the local player has been set. |
private readonly Stopwatch processedMessagesDuration | Stopwatch used to time each message. |
private float processingAllowance | Remaining time budget in milliseconds. |
private readonly ConnectionReceiveSettings settings | The global ConnectionReceiveSettings. |
Methods
| Member | What it is |
|---|
override void ProcessExistingQueues() | Adds to the time budget from the frame time and settings (capped), then works through the queue. |
protected override bool ProcessReceivedPacket(ArraySegment<byte> data, out int progressed) | Handles messages from a packet while budget remains, timing each one; returns true if the packet was finished. |
protected override bool ShouldPacketBeQueued() | Queues if not ready or the budget is below MinAllowanceToProcess; never queues while RenderLock is locked. |
1 private and internal method
| Member | What it is |
|---|
private void HandleSceneSync(IPlayer player) | When the local player is set, marks the receiver ready so messages start being handled. |