MiniQuake

src/miniquake/protocol_events.ml

Package
miniquake.protocol_events
Reachable
Yes

Imports

Declarations

canWriteTransient

function canWriteTransient(buffer)

SV_StartParticle and SV_StartSound share the historical 16-byte preflight. Equality is accepted; only cursize > MAX_DATAGRAM-16 is rejected.

ParameterTypeDefaultDescription
bufferdynamic—The buffer input consumed by `canWriteTransient`.

View source

cFloat

function cFloat(value)

Implements the `cFloat` operation for `miniquake.protocol_events` (c float).

ParameterTypeDefaultDescription
valuedynamic—Value consumed by `cFloat`.

View source

cFloatProduct

function cFloatProduct(left, right)

Implements the `cFloatProduct` operation for `miniquake.protocol_events` (c float product).

ParameterTypeDefaultDescription
leftdynamic—The left input consumed by `cFloatProduct`.
rightdynamic—The right input consumed by `cFloatProduct`.

View source

fragChanged

function fragChanged(oldFrags, currentFrags)

Implements the `fragChanged` operation for `miniquake.protocol_events` (frag changed).

ParameterTypeDefaultDescription
oldFragsdynamic—The old frags input consumed by `fragChanged`.
currentFragsdynamic—The current frags input consumed by `fragChanged`.

View source

MAX_PLAYER_NAME_BYTES

const MAX_PLAYER_NAME_BYTES = 15

Defines the max player name bytes value used by `miniquake.protocol_events`.

View source

particleCount

function particleCount(wireValue)

R_ParseParticleEffect expands the special wire value 255 to 1024 particles.

ParameterTypeDefaultDescription
wireValuedynamic—The wire value input consumed by `particleCount`.

View source

particleDirectionByte

function particleDirectionByte(value)

Return particle direction byte derived from the active module state.

ParameterTypeDefaultDescription
valuedynamic—Value consumed by `particleDirectionByte`.

View source

staticSoundAttenuationByte

function staticSoundAttenuationByte(attenuation)

Return static sound attenuation byte derived from the active module state.

ParameterTypeDefaultDescription
attenuationdynamic—The attenuation input consumed by `staticSoundAttenuationByte`.

View source

staticSoundVolumeByte

function staticSoundVolumeByte(volume)

Return static sound volume byte derived from the active module state.

ParameterTypeDefaultDescription
volumedynamic—The volume input consumed by `staticSoundVolumeByte`.

View source

storedFrag

function storedFrag(currentFrags)

Implements the `storedFrag` operation for `miniquake.protocol_events` (stored frag).

ParameterTypeDefaultDescription
currentFragsdynamic—The current frags input consumed by `storedFrag`.

View source

truncatePlayerName

function truncatePlayerName(text)

Return truncate player name derived from the active module state.

ParameterTypeDefaultDescription
textdynamic—Text to parse or process.

View source

writeDisconnect

function writeDisconnect(buffer)

Encode and write disconnect.

ParameterTypeDefaultDescription
bufferdynamic—The buffer input consumed by `writeDisconnect`.

View source

writeParticle

function writeParticle(buffer, origin, direction, count, color)

Encode and write particle.

ParameterTypeDefaultDescription
bufferdynamic—The buffer input consumed by `writeParticle`.
origindynamic—World-space origin of the operation.
directiondynamic—The direction input consumed by `writeParticle`.
countdynamic—Number of entries or units to process.
colordynamic—Color value used by the operation.

View source

writeScoreReset

function writeScoreReset(buffer, clientIndex)

Encode and write score reset.

ParameterTypeDefaultDescription
bufferdynamic—The buffer input consumed by `writeScoreReset`.
clientIndexdynamic—Zero-based index of the requested entry.

View source

writeScoreState

function writeScoreState(buffer, clientIndex, name, oldFrags, colors)

Encode and write score state.

ParameterTypeDefaultDescription
bufferdynamic—The buffer input consumed by `writeScoreState`.
clientIndexdynamic—Zero-based index of the requested entry.
namedynamic—Stable name that identifies the requested object or option.
oldFragsdynamic—The old frags input consumed by `writeScoreState`.
colorsdynamic—The colors input consumed by `writeScoreState`.

View source

writeSpawnStatic

function writeSpawnStatic(buffer, modelIndex, frame, colormap, skin, origin, angles)

Encode and write spawn static.

ParameterTypeDefaultDescription
bufferdynamic—The buffer input consumed by `writeSpawnStatic`.
modelIndexdynamic—Zero-based index of the requested entry.
framedynamic—The frame input consumed by `writeSpawnStatic`.
colormapdynamic—The colormap input consumed by `writeSpawnStatic`.
skindynamic—The skin input consumed by `writeSpawnStatic`.
origindynamic—World-space origin of the operation.
anglesdynamic—Orientation angles used by the operation.

View source

writeStaticEntity

function writeStaticEntity(buffer, baseline)

Encode and write static entity.

ParameterTypeDefaultDescription
bufferdynamic—The buffer input consumed by `writeStaticEntity`.
baselinedynamic—The baseline input consumed by `writeStaticEntity`.

View source

writeStaticSound

function writeStaticSound(buffer, origin, soundIndex, volume, attenuation)

Encode and write static sound.

ParameterTypeDefaultDescription
bufferdynamic—The buffer input consumed by `writeStaticSound`.
origindynamic—World-space origin of the operation.
soundIndexdynamic—Zero-based index of the requested entry.
volumedynamic—The volume input consumed by `writeStaticSound`.
attenuationdynamic—The attenuation input consumed by `writeStaticSound`.

View source

writeUpdateColors

function writeUpdateColors(buffer, clientIndex, colors)

Encode and write update colors.

ParameterTypeDefaultDescription
bufferdynamic—The buffer input consumed by `writeUpdateColors`.
clientIndexdynamic—Zero-based index of the requested entry.
colorsdynamic—The colors input consumed by `writeUpdateColors`.

View source

writeUpdateFrags

function writeUpdateFrags(buffer, clientIndex, frags)

Encode and write update frags.

ParameterTypeDefaultDescription
bufferdynamic—The buffer input consumed by `writeUpdateFrags`.
clientIndexdynamic—Zero-based index of the requested entry.
fragsdynamic—The frags input consumed by `writeUpdateFrags`.

View source

writeUpdateName

function writeUpdateName(buffer, clientIndex, name)

Encode and write update name.

ParameterTypeDefaultDescription
bufferdynamic—The buffer input consumed by `writeUpdateName`.
clientIndexdynamic—Zero-based index of the requested entry.
namedynamic—Stable name that identifies the requested object or option.

View source