Files
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.
| Parameter | Type | Default | Description |
|---|
destination | dynamic | — | Destination value or collection to update. |
source | dynamic | — | Source value or collection to read. |
View source
# clientDataBits
function clientDataBits(data)
Return client data bits derived from the active module state.
| Parameter | Type | Default | Description |
|---|
data | dynamic | — | 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.
| Parameter | Type | Default | Description |
|---|
spawned | dynamic | — | The spawned input consumed by `initialDeliveryPlan`. |
sendSignon | dynamic | — | The send signon input consumed by `initialDeliveryPlan`. |
elapsed | dynamic | — | 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).
| Parameter | Type | Default | Description |
|---|
crc | dynamic | — | 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).
| Parameter | Type | Default | Description |
|---|
overflowed | dynamic | — | The overflowed input consumed by `reliableDeliveryPlan`. |
messageSize | dynamic | — | Size of the requested data or resource. |
dropAsap | dynamic | — | The drop asap input consumed by `reliableDeliveryPlan`. |
canSend | dynamic | — | 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).
| Parameter | Type | Default | Description |
|---|
volume | dynamic | — | The volume input consumed by `soundFieldMask`. |
attenuation | dynamic | — | The attenuation input consumed by `soundFieldMask`. |
View source
# writeBaseline
function writeBaseline(buffer, entityNumber, baseline)
Writes baseline for `miniquake.protocol_serverdata`.
| Parameter | Type | Default | Description |
|---|
buffer | dynamic | — | The buffer input consumed by `writeBaseline`. |
entityNumber | dynamic | — | The entity number input consumed by `writeBaseline`. |
baseline | dynamic | — | 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.
| Parameter | Type | Default | Description |
|---|
buffer | dynamic | — | The buffer input consumed by `writeClientData`. |
data | dynamic | — | Input data consumed by the operation. |
View source
# writePrecacheList
function writePrecacheList(buffer, values)
Encode and write precache list.
| Parameter | Type | Default | Description |
|---|
buffer | dynamic | — | The buffer input consumed by `writePrecacheList`. |
values | dynamic | — | 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.
| Parameter | Type | Default | Description |
|---|
buffer | dynamic | — | The buffer input consumed by `writeServerInfo`. |
progsCrc | dynamic | — | The progs crc input consumed by `writeServerInfo`. |
maxClients | dynamic | — | The max clients input consumed by `writeServerInfo`. |
gameType | dynamic | — | The game type input consumed by `writeServerInfo`. |
levelName | dynamic | — | Name that identifies the requested value or resource. |
modelPrecache | dynamic | — | The model precache input consumed by `writeServerInfo`. |
soundPrecache | dynamic | — | The sound precache input consumed by `writeServerInfo`. |
cdTrack | dynamic | — | The cd track input consumed by `writeServerInfo`. |
viewEntity | dynamic | — | 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.
| Parameter | Type | Default | Description |
|---|
buffer | dynamic | — | The buffer input consumed by `writeSound`. |
entityNumber | dynamic | — | The entity number input consumed by `writeSound`. |
channel | dynamic | — | The channel input consumed by `writeSound`. |
soundNumber | dynamic | — | The sound number input consumed by `writeSound`. |
volume | dynamic | — | The volume input consumed by `writeSound`. |
attenuation | dynamic | — | The attenuation input consumed by `writeSound`. |
center | dynamic | — | The center input consumed by `writeSound`. |
View source