Skip to content
Brass Orrery

Orrery Terrain · OrreryTerrainCore module · class

Native::

FNetBatchWriter

Experimental

Packs a run of records into one batch payload (ClientRecords, and upstream requests), for one link.

Declaration

class FNetBatchWriter
Header
#include "Native/Net/NetBatch.h"
Module
PublicDependencyModuleNames.Add("OrreryTerrainCore"); in your module’s Build.cs.
Stability
Experimental: supported, may change in a minor version, with a changelog line.

Description

The payload is versioned and is not a stable format. Brush steps are delta-coded against the context's reference brush with implicit step numbers, and any other record travels verbatim. A request stream (SetRequests) also accepts the request-only MaskUpload record; a record stream refuses it as UnknownKind.

A centre-only brush step that moves less than 8.2 m costs 5 bytes against 56 unbatched.

Stream. Contexts and the sequence carry over from one batch to the next on the same link, so the reader must open every batch of the stream in order; Reset starts a new stream.

Records must be valid, as FTerrainNetLog holds them: the writer checks sequence numbers, kinds and sculpt commands, not a verbatim payload's content (the reader checks it).

Tier 1. One thread at a time. Allocation-free once its buffer is warm.

Functions

  • FNetBatchWriter

    A new stream whose first batch starts at FirstSeq (0 is taken as 1).

  • Reset

    Forget the stream, and any batch being written; the next batch is Fresh and starts at FirstSeq (0 is taken as 1).

  • SetRequests

    Make this a client's request stream, which also takes the request-only kinds (IsRequestNetRecordKind: MaskUpload), or a record stream (the default), which takes only IsKnownNetRecordKind.

  • Add

    Add one record to the batch being written, opening one if none is.

  • Finish

    Close the batch and append it to Out; the stream then includes it.

  • Discard

    Drop the batch being written; the stream stays where the last Finish left it.

  • Count

    Records in the batch being written.

  • PendingBytes

    Its entry bytes so far; the header adds at most 16.

  • NextSeq

    The sequence number the next sequenced record must carry.