MiniQuake

src/miniquake/protocol_update.ml

Package
miniquake.protocol_update
Reachable
Yes

Imports

Declarations

absolute

function absolute(value)

Implements the `absolute` operation for `miniquake.protocol_update` (absolute).

ParameterTypeDefaultDescription
valuedynamic—Value consumed by `absolute`.

View source

canWrite

function canWrite(buffer, bits)

Report whether can write.

ParameterTypeDefaultDescription
bufferdynamic—The buffer input consumed by `canWrite`.
bitsdynamic—The bits input consumed by `canWrite`.

View source

canWriteWithReservedTail

function canWriteWithReservedTail(buffer, bits, reservedBytes)

The stock server appends sv.datagram after fast entity updates. Under a dense PVS that can discard the complete transient tail, including gunshot puffs and explosions. Reserve the already-known tail while scheduling entity deltas; the strict '< maxSize' append boundary still applies.

ParameterTypeDefaultDescription
bufferdynamic—The buffer input consumed by `canWriteWithReservedTail`.
bitsdynamic—The bits input consumed by `canWriteWithReservedTail`.
reservedBytesdynamic—Byte data consumed by the operation.

View source

computeBits

function computeBits(entityNumber, baseline, modelIndex, frame, colormap, skin, effects, origin, angles, moveType)

Exact Protocol-15 bit selection from WinQuake sv_main.c: SV_WriteEntitiesToClient. The entity-state baseline includes effects even though svc_spawnbaseline does not transmit it; SV_CreateBaseline leaves that field at zero in the original zero-initialized edict baseline.

ParameterTypeDefaultDescription
entityNumberdynamic—The entity number input consumed by `computeBits`.
baselinedynamic—The baseline input consumed by `computeBits`.
modelIndexdynamic—Zero-based index of the requested entry.
framedynamic—The frame input consumed by `computeBits`.
colormapdynamic—The colormap input consumed by `computeBits`.
skindynamic—The skin input consumed by `computeBits`.
effectsdynamic—The effects input consumed by `computeBits`.
origindynamic—World-space origin of the operation.
anglesdynamic—Orientation angles used by the operation.
moveTypedynamic—The move type input consumed by `computeBits`.

View source

encodedSize

function encodedSize(bits)

Exact byte count for one Protocol-15 fast entity update. The original SV_WriteEntitiesToClient used a fixed 16-byte preflight even though the theoretical long-entity maximum is 18 bytes. MiniQuake preserves the original 16-byte scheduling gate and adds this exact memory-safety check.

ParameterTypeDefaultDescription
bitsdynamic—The bits input consumed by `encodedSize`.

View source

writeFastUpdate

function writeFastUpdate(buffer, entityNumber, baseline, modelIndex, frame, colormap, skin, effects, origin, angles, moveType)

Encode and write fast update.

ParameterTypeDefaultDescription
bufferdynamic—The buffer input consumed by `writeFastUpdate`.
entityNumberdynamic—The entity number input consumed by `writeFastUpdate`.
baselinedynamic—The baseline input consumed by `writeFastUpdate`.
modelIndexdynamic—Zero-based index of the requested entry.
framedynamic—The frame input consumed by `writeFastUpdate`.
colormapdynamic—The colormap input consumed by `writeFastUpdate`.
skindynamic—The skin input consumed by `writeFastUpdate`.
effectsdynamic—The effects input consumed by `writeFastUpdate`.
origindynamic—World-space origin of the operation.
anglesdynamic—Orientation angles used by the operation.
moveTypedynamic—The move type input consumed by `writeFastUpdate`.

View source

writeFastUpdateBits

function writeFastUpdateBits(buffer, bits, entityNumber, modelIndex, frame, colormap, skin, effects, origin, angles)

Encode and write fast update bits.

ParameterTypeDefaultDescription
bufferdynamic—The buffer input consumed by `writeFastUpdateBits`.
bitsdynamic—The bits input consumed by `writeFastUpdateBits`.
entityNumberdynamic—The entity number input consumed by `writeFastUpdateBits`.
modelIndexdynamic—Zero-based index of the requested entry.
framedynamic—The frame input consumed by `writeFastUpdateBits`.
colormapdynamic—The colormap input consumed by `writeFastUpdateBits`.
skindynamic—The skin input consumed by `writeFastUpdateBits`.
effectsdynamic—The effects input consumed by `writeFastUpdateBits`.
origindynamic—World-space origin of the operation.
anglesdynamic—Orientation angles used by the operation.

View source