Skip to content
Brass Orrery

Orrery Terrain · OrreryTerrainCore module · function

Native::

CheckNetPayload

Experimental

Check a payload against its kind, touching nothing.

Declaration

ENetDecode CheckNetPayload(ETerrainNetRecordKind Kind, const uint8_t* Payload, size_t Size, FSculptCommand* OutCommand = nullptr);
Header
#include "Native/Net/NetRecord.h"
Module
PublicDependencyModuleNames.Add("OrreryTerrainCore"); in your module’s Build.cs.
Stability
Experimental: supported, may change in a minor version, with a changelog line.
Thread
Pure, any thread.

Description

Sculpt: exactly kSculptCommandBytes of record version kSculptRecordVersion that DecodeSculptCommand accepts (the net never carries version 2; the Hello refuses such a peer). SculptPatch: version kSculptRecordVersion and DecodeSculptPatch accepts it. BrushMask: DecodeBrushMaskRecord accepts it, without building the mask. The others: their decoders accept them.

Parameters

NameTypeDefaultMeaning
KindETerrainNetRecordKind—

The record kind the payload claims.

Payloadconst uint8_t*—

The payload bytes.

Sizesize_t—

The payload's size in bytes.

OutCommandFSculptCommand*nullptr

Optional: the decoded command of a Sculpt payload.

Returns

Ok, or the first rule the payload breaks.

Note.

Pure, any thread. Allocates only to check a SculptPatch's or a Repair's tiles, or a BrushMask's bytes.