class

FNetAudioEventGate

What the server checks before it lets a client's audio event reach the other peers. A client is untrusted: it can name any cue id, any position and any volume, as often as it likes. The gate only passes a cue the server registered, a finite position near the sender's own pawn, a sane volume, and no more than the sender's rate allows. The pure rules, apart from the network layer, so they can be tested by value.

Module
Audio
Header
#include "Audio/NetAudioEvent.h"
Namespace
Mowo

Public functions

ReturnsNameDescription
uint32_tCueIdFromName
uint32_tPickVariantThe take a seed names; the same on every peer.
voidRegisterCue
const FCue*FindCue
voidSetMaxClaimDistanceHow far from the sender's own position an event may claim to sound.
voidSetRateA peer's bucket holds burst events and refills at perSecond.
ENetAudioEventVerdictValidate
voidRefill
voidForgetPeer
boolIsRelevantTrue when a listener at listener is within the cue's radius of the event.

Function details

CueIdFromName

C++
static uint32_t CueIdFromName(const std::string& name)

PickVariant

C++
static uint32_t PickVariant(uint32_t seed, uint32_t count)

The take a seed names; the same on every peer.

RegisterCue

C++
void RegisterCue(uint32_t cueId, const std::vector<std::string>& variants, float radius)

FindCue

C++
const FCue* FindCue(uint32_t cueId) const

SetMaxClaimDistance

C++
void SetMaxClaimDistance(float meters)

How far from the sender's own position an event may claim to sound.

SetRate

C++
void SetRate(float perSecond, float burst)

A peer's bucket holds burst events and refills at perSecond.

Validate

C++
ENetAudioEventVerdict Validate(uint32_t peerId, const FNetAudioEvent& event, const Vec3& senderPosition, bool haveSenderPosition)

Refill

C++
void Refill(float deltaTime)

ForgetPeer

C++
void ForgetPeer(uint32_t peerId)

IsRelevant

C++
bool IsRelevant(const FNetAudioEvent& event, const Vec3& listener) const

True when a listener at listener is within the cue's radius of the event.

Generated from Audio/NetAudioEvent.h via audio.json · Dec 5, 2026Version 1.1.0