MiniQuake

src/miniquake/protocol_serverdata.ml

Package
miniquake.protocol_serverdata
Reachable
Yes

Imports

Declarations

appendDatagramIfFits

function appendDatagramIfFits(destination, source)

SV_SendClientDatagram copies sv.datagram only when the resulting size is strictly less than MAX_DATAGRAM. Equality is intentionally rejected.

ParameterTypeDefaultDescription
destinationdynamic—Destination value or collection to update.
sourcedynamic—Source value or collection to read.

View source

clientDataBits

function clientDataBits(data)

Return client data bits derived from the active module state.

ParameterTypeDefaultDescription
datadynamic—Input data consumed by the operation.

View source

initialDeliveryPlan

function initialDeliveryPlan(spawned, sendSignon, elapsed)

First phase of SV_SendClientMessages. Spawned clients send an unreliable datagram and continue into the reliable phase. Unspawned clients without a requested signon stage either receive a five-second keepalive or wait.

ParameterTypeDefaultDescription
spawneddynamic—The spawned input consumed by `initialDeliveryPlan`.
sendSignondynamic—The send signon input consumed by `initialDeliveryPlan`.
elapseddynamic—The elapsed input consumed by `initialDeliveryPlan`.

View source

PLAN_RELIABLE_PHASE

const PLAN_RELIABLE_PHASE = 8

Defines the plan reliable phase value used by `miniquake.protocol_serverdata`.

View source

PLAN_SEND_NOP

const PLAN_SEND_NOP = 2

Defines the plan send nop value used by `miniquake.protocol_serverdata`.

View source

PLAN_SEND_UNRELIABLE

const PLAN_SEND_UNRELIABLE = 1

Defines the plan send unreliable value used by `miniquake.protocol_serverdata`.

View source

PLAN_WAIT_SIGNON

const PLAN_WAIT_SIGNON = 4

Defines the plan wait signon value used by `miniquake.protocol_serverdata`.

View source

progsCrcText

function progsCrcText(crc)

Implements the `progsCrcText` operation for `miniquake.protocol_serverdata` (progs crc text).

ParameterTypeDefaultDescription
crcdynamic—The crc input consumed by `progsCrcText`.

View source

RELIABLE_DROP_ASAP

const RELIABLE_DROP_ASAP = 3

Defines the reliable drop asap value used by `miniquake.protocol_serverdata`.

View source

RELIABLE_DROP_OVERFLOW

const RELIABLE_DROP_OVERFLOW = 1

Defines the reliable drop overflow value used by `miniquake.protocol_serverdata`.

View source

RELIABLE_NONE

const RELIABLE_NONE = 0

Defines the reliable none value used by `miniquake.protocol_serverdata`.

View source

RELIABLE_SEND

const RELIABLE_SEND = 4

Defines the reliable send value used by `miniquake.protocol_serverdata`.

View source

RELIABLE_WAIT

const RELIABLE_WAIT = 2

Defines the reliable wait value used by `miniquake.protocol_serverdata`.

View source

reliableDeliveryPlan

function reliableDeliveryPlan(overflowed, messageSize, dropAsap, canSend)

Implements the `reliableDeliveryPlan` operation for `miniquake.protocol_serverdata` (reliable delivery plan).

ParameterTypeDefaultDescription
overfloweddynamic—The overflowed input consumed by `reliableDeliveryPlan`.
messageSizedynamic—Size of the requested data or resource.
dropAsapdynamic—The drop asap input consumed by `reliableDeliveryPlan`.
canSenddynamic—The can send input consumed by `reliableDeliveryPlan`.

View source

soundFieldMask

function soundFieldMask(volume, attenuation)

Implements the `soundFieldMask` operation for `miniquake.protocol_serverdata` (sound field mask).

ParameterTypeDefaultDescription
volumedynamic—The volume input consumed by `soundFieldMask`.
attenuationdynamic—The attenuation input consumed by `soundFieldMask`.

View source

writeBaseline

function writeBaseline(buffer, entityNumber, baseline)

Writes baseline for `miniquake.protocol_serverdata`.

ParameterTypeDefaultDescription
bufferdynamic—The buffer input consumed by `writeBaseline`.
entityNumberdynamic—The entity number input consumed by `writeBaseline`.
baselinedynamic—The baseline input consumed by `writeBaseline`.

View source

writeClientData

function writeClientData(buffer, data)

The final active-weapon byte intentionally follows stock Quake's two modes. In mission-pack mode a zero bitfield emits no byte, matching the original C loop's fall-through behavior.

ParameterTypeDefaultDescription
bufferdynamic—The buffer input consumed by `writeClientData`.
datadynamic—Input data consumed by the operation.

View source

writePrecacheList

function writePrecacheList(buffer, values)

Encode and write precache list.

ParameterTypeDefaultDescription
bufferdynamic—The buffer input consumed by `writePrecacheList`.
valuesdynamic—The values input consumed by `writePrecacheList`.

View source

writeServerInfo

function writeServerInfo(buffer, progsCrc, maxClients, gameType, levelName, modelPrecache, soundPrecache, cdTrack, viewEntity)

SV_SendServerinfo payload, including the leading version print and stage-1 signon marker. client lifecycle flags remain the caller's responsibility.

ParameterTypeDefaultDescription
bufferdynamic—The buffer input consumed by `writeServerInfo`.
progsCrcdynamic—The progs crc input consumed by `writeServerInfo`.
maxClientsdynamic—The max clients input consumed by `writeServerInfo`.
gameTypedynamic—The game type input consumed by `writeServerInfo`.
levelNamedynamic—Name that identifies the requested value or resource.
modelPrecachedynamic—The model precache input consumed by `writeServerInfo`.
soundPrecachedynamic—The sound precache input consumed by `writeServerInfo`.
cdTrackdynamic—The cd track input consumed by `writeServerInfo`.
viewEntitydynamic—The view entity input consumed by `writeServerInfo`.

View source

writeSound

function writeSound(buffer, entityNumber, channel, soundNumber, volume, attenuation, center)

SV_StartSound's wire payload. C has already converted channel/volume to int and attenuation to float before entering the function. Recreate that ABI boundary here so dynamic MiniLang callers cannot alter the optional bits. Validation, precache lookup and the MAX_DATAGRAM-16 early-out are performed by the production wrappers.

ParameterTypeDefaultDescription
bufferdynamic—The buffer input consumed by `writeSound`.
entityNumberdynamic—The entity number input consumed by `writeSound`.
channeldynamic—The channel input consumed by `writeSound`.
soundNumberdynamic—The sound number input consumed by `writeSound`.
volumedynamic—The volume input consumed by `writeSound`.
attenuationdynamic—The attenuation input consumed by `writeSound`.
centerdynamic—The center input consumed by `writeSound`.

View source