Files
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.
| Parameter | Type | Default | Description |
|---|
buffer | dynamic | — | The buffer input consumed by `canWriteTransient`. |
View source
# cFloat
function cFloat(value)
Implements the `cFloat` operation for `miniquake.protocol_events` (c float).
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed by `cFloat`. |
View source
# cFloatProduct
function cFloatProduct(left, right)
Implements the `cFloatProduct` operation for `miniquake.protocol_events` (c float product).
| Parameter | Type | Default | Description |
|---|
left | dynamic | — | The left input consumed by `cFloatProduct`. |
right | dynamic | — | The right input consumed by `cFloatProduct`. |
View source
# fragChanged
function fragChanged(oldFrags, currentFrags)
Implements the `fragChanged` operation for `miniquake.protocol_events` (frag changed).
| Parameter | Type | Default | Description |
|---|
oldFrags | dynamic | — | The old frags input consumed by `fragChanged`. |
currentFrags | dynamic | — | 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.
| Parameter | Type | Default | Description |
|---|
wireValue | dynamic | — | The wire value input consumed by `particleCount`. |
View source
# particleDirectionByte
function particleDirectionByte(value)
Return particle direction byte derived from the active module state.
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed by `particleDirectionByte`. |
View source
# staticSoundAttenuationByte
function staticSoundAttenuationByte(attenuation)
Return static sound attenuation byte derived from the active module state.
| Parameter | Type | Default | Description |
|---|
attenuation | dynamic | — | The attenuation input consumed by `staticSoundAttenuationByte`. |
View source
# staticSoundVolumeByte
function staticSoundVolumeByte(volume)
Return static sound volume byte derived from the active module state.
| Parameter | Type | Default | Description |
|---|
volume | dynamic | — | The volume input consumed by `staticSoundVolumeByte`. |
View source
# storedFrag
function storedFrag(currentFrags)
Implements the `storedFrag` operation for `miniquake.protocol_events` (stored frag).
| Parameter | Type | Default | Description |
|---|
currentFrags | dynamic | — | The current frags input consumed by `storedFrag`. |
View source
# truncatePlayerName
function truncatePlayerName(text)
Return truncate player name derived from the active module state.
| Parameter | Type | Default | Description |
|---|
text | dynamic | — | Text to parse or process. |
View source
# writeDisconnect
function writeDisconnect(buffer)
Encode and write disconnect.
| Parameter | Type | Default | Description |
|---|
buffer | dynamic | — | The buffer input consumed by `writeDisconnect`. |
View source
# writeParticle
function writeParticle(buffer, origin, direction, count, color)
Encode and write particle.
| Parameter | Type | Default | Description |
|---|
buffer | dynamic | — | The buffer input consumed by `writeParticle`. |
origin | dynamic | — | World-space origin of the operation. |
direction | dynamic | — | The direction input consumed by `writeParticle`. |
count | dynamic | — | Number of entries or units to process. |
color | dynamic | — | Color value used by the operation. |
View source
# writeScoreReset
function writeScoreReset(buffer, clientIndex)
Encode and write score reset.
| Parameter | Type | Default | Description |
|---|
buffer | dynamic | — | The buffer input consumed by `writeScoreReset`. |
clientIndex | dynamic | — | Zero-based index of the requested entry. |
View source
# writeScoreState
function writeScoreState(buffer, clientIndex, name, oldFrags, colors)
Encode and write score state.
| Parameter | Type | Default | Description |
|---|
buffer | dynamic | — | The buffer input consumed by `writeScoreState`. |
clientIndex | dynamic | — | Zero-based index of the requested entry. |
name | dynamic | — | Stable name that identifies the requested object or option. |
oldFrags | dynamic | — | The old frags input consumed by `writeScoreState`. |
colors | dynamic | — | The colors input consumed by `writeScoreState`. |
View source
# writeSpawnStatic
function writeSpawnStatic(buffer, modelIndex, frame, colormap, skin, origin, angles)
Encode and write spawn static.
| Parameter | Type | Default | Description |
|---|
buffer | dynamic | — | The buffer input consumed by `writeSpawnStatic`. |
modelIndex | dynamic | — | Zero-based index of the requested entry. |
frame | dynamic | — | The frame input consumed by `writeSpawnStatic`. |
colormap | dynamic | — | The colormap input consumed by `writeSpawnStatic`. |
skin | dynamic | — | The skin input consumed by `writeSpawnStatic`. |
origin | dynamic | — | World-space origin of the operation. |
angles | dynamic | — | Orientation angles used by the operation. |
View source
# writeStaticEntity
function writeStaticEntity(buffer, baseline)
Encode and write static entity.
| Parameter | Type | Default | Description |
|---|
buffer | dynamic | — | The buffer input consumed by `writeStaticEntity`. |
baseline | dynamic | — | The baseline input consumed by `writeStaticEntity`. |
View source
# writeStaticSound
function writeStaticSound(buffer, origin, soundIndex, volume, attenuation)
Encode and write static sound.
| Parameter | Type | Default | Description |
|---|
buffer | dynamic | — | The buffer input consumed by `writeStaticSound`. |
origin | dynamic | — | World-space origin of the operation. |
soundIndex | dynamic | — | Zero-based index of the requested entry. |
volume | dynamic | — | The volume input consumed by `writeStaticSound`. |
attenuation | dynamic | — | The attenuation input consumed by `writeStaticSound`. |
View source
# writeUpdateColors
function writeUpdateColors(buffer, clientIndex, colors)
Encode and write update colors.
| Parameter | Type | Default | Description |
|---|
buffer | dynamic | — | The buffer input consumed by `writeUpdateColors`. |
clientIndex | dynamic | — | Zero-based index of the requested entry. |
colors | dynamic | — | The colors input consumed by `writeUpdateColors`. |
View source
# writeUpdateFrags
function writeUpdateFrags(buffer, clientIndex, frags)
Encode and write update frags.
| Parameter | Type | Default | Description |
|---|
buffer | dynamic | — | The buffer input consumed by `writeUpdateFrags`. |
clientIndex | dynamic | — | Zero-based index of the requested entry. |
frags | dynamic | — | The frags input consumed by `writeUpdateFrags`. |
View source
# writeUpdateName
function writeUpdateName(buffer, clientIndex, name)
Encode and write update name.
| Parameter | Type | Default | Description |
|---|
buffer | dynamic | — | The buffer input consumed by `writeUpdateName`. |
clientIndex | dynamic | — | Zero-based index of the requested entry. |
name | dynamic | — | Stable name that identifies the requested object or option. |
View source