MiniQuake

src/miniquake/client.ml

Package
miniquake.client
Reachable
Yes

Imports

Declarations

addEntityEffectDlights

function addEntityEffectDlights(entity, currentTime)

Add state for add entity effect dlights.

ParameterTypeDefaultDescription
entitydynamic—Entity affected by the operation.
currentTimedynamic—Time value used by the operation.

View source

advanceSignon

function advanceSignon(client, stage)

Advance signon by one processing step.

ParameterTypeDefaultDescription
clientdynamic—Client state participating in the operation.
stagedynamic—The stage input consumed by `advanceSignon`.

View source

appendPrioritizedVisibleEntity

function appendPrioritizedVisibleEntity(builder, entity, modelFlags)

Append one dynamic render entity while preserving projectile visibility at the original MAX_VISEDICTS limit. A newly allocated rocket or grenade often has a high edict number; when the list is already full, replace the newest ordinary entry rather than rendering only the later explosion event.

ParameterTypeDefaultDescription
builderdynamic—The builder input consumed by `appendPrioritizedVisibleEntity`.
entitydynamic—Entity affected by the operation.
modelFlagsdynamic—The model flags input consumed by `appendPrioritizedVisibleEntity`.

View source

applyBaseline

function applyBaseline(client, number, baseline)

Apply baseline to the active subsystem state.

ParameterTypeDefaultDescription
clientdynamic—Client state participating in the operation.
numberdynamic—The number input consumed by `applyBaseline`.
baselinedynamic—The baseline input consumed by `applyBaseline`.

View source

applyEvent

function applyEvent(client, item)

Apply event to the active subsystem state.

ParameterTypeDefaultDescription
clientdynamic—Client state participating in the operation.
itemdynamic—The item input consumed by `applyEvent`.

View source

applyFastUpdate

function applyFastUpdate(client, payload)

Apply fast update to the active subsystem state.

ParameterTypeDefaultDescription
clientdynamic—Client state participating in the operation.
payloaddynamic—The payload input consumed by `applyFastUpdate`.

View source

assignBaseline

function assignBaseline(entity, baseline)

Apply baseline values to an existing dynamic or static client entity.

ParameterTypeDefaultDescription
entitydynamic—Entity affected by the operation.
baselinedynamic—The baseline input consumed by `assignBaseline`.

View source

CL_ActiveVisibleEntities

function CL_ActiveVisibleEntities(client)

Return the exact entity list consumed by the renderer after CL_RelinkEntities. WinQuake renders cl_visedicts rather than the entire sparse cl_entities array. Keep this as a defensive view: invalid/cleared entries can never leak into a modern backend even if a caller retained an older visibleEntities array.

ParameterTypeDefaultDescription
clientdynamic—Client state participating in the operation.

View source

CL_AllocDlight

function CL_AllocDlight(key)

CL_AllocDlight from cl_main.c. Exact key matches are preferred, then an expired slot, with slot zero as the original overflow fallback.

ParameterTypeDefaultDescription
keydynamic—Key used to identify the requested entry.

View source

CL_AllocDlightAt

function CL_AllocDlightAt(key, currentTime)

Apply the Quake-compatible cl alloc dlight at behavior.

ParameterTypeDefaultDescription
keydynamic—Key used to identify the requested entry.
currentTimedynamic—Time value used by the operation.

View source

CL_ApplyAuthoritativeEntityVisibility

function CL_ApplyAuthoritativeEntityVisibility(client, authoritativeEdicts)

Apply an integrated listen server's authoritative entity visibility before CL_RelinkEntities constructs the frame list. Pickups commonly clear only their QuakeC `model` string while retaining the precached modelindex for a possible deathmatch respawn. Protocol omission clears the entity on the following client message; the shared local process can safely clear it in the same frame and must do so before any renderer or efrag consumer runs.

ParameterTypeDefaultDescription
clientdynamic—Client state participating in the operation.
authoritativeEdictsdynamic—The authoritative edicts input consumed by `CL_ApplyAuthoritativeEntityVisibility`.

View source

CL_AssignModelSyncBase

function CL_AssignModelSyncBase(entity, previousModelIndex)

Apply the Quake-compatible cl assign model sync base behavior.

ParameterTypeDefaultDescription
entitydynamic—Entity affected by the operation.
previousModelIndexdynamic—Zero-based index of the requested entry.

View source

CL_BeginRelinkParticles

function CL_BeginRelinkParticles(active)

Apply the Quake-compatible cl begin relink particles behavior.

ParameterTypeDefaultDescription
activedynamic—The active input consumed by `CL_BeginRelinkParticles`.

View source

CL_ClearDlights

function CL_ClearDlights()

Apply the Quake-compatible cl clear dlights behavior.

View source

CL_ClearState

function CL_ClearState(client)

CL_ClearState wipes client_state_t while retaining the transport and the client_static_t connection/signon fields represented by LocalClient.

ParameterTypeDefaultDescription
clientdynamic—Client state participating in the operation.

View source

CL_DecayLights

function CL_DecayLights()

Apply the Quake-compatible cl decay lights behavior.

View source

CL_DecayLightsAt

function CL_DecayLightsAt(currentTime, elapsed)

Apply the Quake-compatible cl decay lights at behavior.

ParameterTypeDefaultDescription
currentTimedynamic—Time value used by the operation.
elapseddynamic—The elapsed input consumed by `CL_DecayLightsAt`.

View source

CL_Disconnect

function CL_Disconnect(client)

Apply the Quake-compatible cl disconnect behavior.

ParameterTypeDefaultDescription
clientdynamic—Client state participating in the operation.

View source

CL_Disconnect_f

function CL_Disconnect_f(client)

Apply the Quake-compatible cl disconnect f behavior.

ParameterTypeDefaultDescription
clientdynamic—Client state participating in the operation.

View source

CL_DlightIndexForKey

function CL_DlightIndexForKey(key)

Apply the Quake-compatible cl dlight index for key behavior.

ParameterTypeDefaultDescription
keydynamic—Key used to identify the requested entry.

View source

CL_Dlights

function CL_Dlights()

Apply the Quake-compatible cl dlights behavior.

View source

CL_EfragRemovalCandidates

function CL_EfragRemovalCandidates(client)

Apply the Quake-compatible cl efrag removal candidates behavior.

ParameterTypeDefaultDescription
clientdynamic—Client state participating in the operation.

View source

CL_EndRelinkParticles

function CL_EndRelinkParticles()

Apply the Quake-compatible cl end relink particles behavior.

View source

CL_EntityNum

function CL_EntityNum(client, number)

Apply the Quake-compatible cl entity num behavior.

ParameterTypeDefaultDescription
clientdynamic—Client state participating in the operation.
numberdynamic—The number input consumed by `CL_EntityNum`.

View source

CL_EstablishConnection

function CL_EstablishConnection(client, network, host)

Apply the Quake-compatible cl establish connection behavior.

ParameterTypeDefaultDescription
clientdynamic—Client state participating in the operation.
networkdynamic—The network input consumed by `CL_EstablishConnection`.
hostdynamic—The host input consumed by `CL_EstablishConnection`.

View source

CL_EstablishInteropConnection

function CL_EstablishInteropConnection(client, network, host, timeoutMilliseconds, resendMilliseconds)

Apply the Quake-compatible cl establish interop connection behavior.

ParameterTypeDefaultDescription
clientdynamic—Client state participating in the operation.
networkdynamic—The network input consumed by `CL_EstablishInteropConnection`.
hostdynamic—The host input consumed by `CL_EstablishInteropConnection`.
timeoutMillisecondsdynamic—The timeout milliseconds input consumed by `CL_EstablishInteropConnection`.
resendMillisecondsdynamic—The resend milliseconds input consumed by `CL_EstablishInteropConnection`.

View source

CL_FilterAuthoritativeVisibleEntities

function CL_FilterAuthoritativeVisibleEntities(visibleEntities, authoritativeEdicts)

Filter an integrated listen client's render list against the authoritative server-edict mirror. Protocol 15 normally removes an omitted entity during CL_RelinkEntities. This final boundary also covers a retained list from an earlier frame: a freed edict or an item hidden by `self.model = string_null` must never reach any renderer backend. The common all-valid path is deliberately zero-copy.

ParameterTypeDefaultDescription
visibleEntitiesdynamic—The visible entities input consumed by `CL_FilterAuthoritativeVisibleEntities`.
authoritativeEdictsdynamic—The authoritative edicts input consumed by `CL_FilterAuthoritativeVisibleEntities`.

View source

CL_Init

function CL_Init(client, registry)

Apply the Quake-compatible cl init behavior.

ParameterTypeDefaultDescription
clientdynamic—Client state participating in the operation.
registrydynamic—The registry input consumed by `CL_Init`.

View source

CL_KeepaliveMessage

function CL_KeepaliveMessage(client, localServerActive, realtime)

Apply the Quake-compatible cl keepalive message behavior.

ParameterTypeDefaultDescription
clientdynamic—Client state participating in the operation.
localServerActivedynamic—The local server active input consumed by `CL_KeepaliveMessage`.
realtimedynamic—Time value used by the operation.

View source

CL_LerpPoint

function CL_LerpPoint(client)

Apply the Quake-compatible cl lerp point behavior.

ParameterTypeDefaultDescription
clientdynamic—Client state participating in the operation.

View source

CL_ModelFlags

function CL_ModelFlags()

Apply the Quake-compatible cl model flags behavior.

View source

CL_ModelSyncTypes

function CL_ModelSyncTypes()

Apply the Quake-compatible cl model sync types behavior.

View source

CL_MoveMessageCount

function CL_MoveMessageCount()

Apply the Quake-compatible cl move message count behavior.

View source

CL_NewTranslation

function CL_NewTranslation(client, slot)

Apply the Quake-compatible cl new translation behavior.

ParameterTypeDefaultDescription
clientdynamic—Client state participating in the operation.
slotdynamic—The slot input consumed by `CL_NewTranslation`.

View source

CL_NextDemo

function CL_NextDemo(commands, demos, demoNumber)

CL_NextDemo returns the updated demonum because MiniLang integers are value types. The command buffer and demo selection behavior match cl_main.c.

ParameterTypeDefaultDescription
commandsdynamic—The commands input consumed by `CL_NextDemo`.
demosdynamic—The demos input consumed by `CL_NextDemo`.
demoNumberdynamic—The demo number input consumed by `CL_NextDemo`.

View source

CL_PrintEntities_f

function CL_PrintEntities_f(client)

Apply the Quake-compatible cl print entities f behavior.

ParameterTypeDefaultDescription
clientdynamic—Client state participating in the operation.

View source

CL_ReadFromServer

function CL_ReadFromServer(client, frameTime, realtime)

Apply the Quake-compatible cl read from server behavior.

ParameterTypeDefaultDescription
clientdynamic—Client state participating in the operation.
frameTimedynamic—Time value used by the operation.
realtimedynamic—Time value used by the operation.

View source

CL_RegisteredCommands

function CL_RegisteredCommands()

Apply the Quake-compatible cl registered commands behavior.

View source

CL_RelinkEntities

function CL_RelinkEntities(client)

Apply the Quake-compatible cl relink entities behavior.

ParameterTypeDefaultDescription
clientdynamic—Client state participating in the operation.

View source

CL_SendCmd

function CL_SendCmd(client, command)

Apply the Quake-compatible cl send cmd behavior.

ParameterTypeDefaultDescription
clientdynamic—Client state participating in the operation.
commanddynamic—Console or protocol command to execute.

View source

CL_SendMove

function CL_SendMove(client, command)

Apply the Quake-compatible cl send move behavior.

ParameterTypeDefaultDescription
clientdynamic—Client state participating in the operation.
commanddynamic—Console or protocol command to execute.

View source

CL_ServerShutdownRequested

function CL_ServerShutdownRequested()

Apply the Quake-compatible cl server shutdown requested behavior.

View source

CL_SetChaseActive

function CL_SetChaseActive(active)

Apply the Quake-compatible cl set chase active behavior.

ParameterTypeDefaultDescription
activedynamic—The active input consumed by `CL_SetChaseActive`.

View source

CL_SetDlightTime

function CL_SetDlightTime(oldTime, currentTime)

Apply the Quake-compatible cl set dlight time behavior.

ParameterTypeDefaultDescription
oldTimedynamic—Time value used by the operation.
currentTimedynamic—Time value used by the operation.

View source

CL_SetModelFlags

function CL_SetModelFlags(flags)

Apply the Quake-compatible cl set model flags behavior.

ParameterTypeDefaultDescription
flagsdynamic—The flags input consumed by `CL_SetModelFlags`.

View source

CL_SetModelSyncTypes

function CL_SetModelSyncTypes(syncTypes)

Apply the Quake-compatible cl set model sync types behavior.

ParameterTypeDefaultDescription
syncTypesdynamic—The sync types input consumed by `CL_SetModelSyncTypes`.

View source

CL_SetMoveMessageCount

function CL_SetMoveMessageCount(value)

Apply the Quake-compatible cl set move message count behavior.

ParameterTypeDefaultDescription
valuedynamic—Value consumed by `CL_SetMoveMessageCount`.

View source

CL_SetRandomSeed

function CL_SetRandomSeed(seed)

Apply the Quake-compatible cl set random seed behavior.

ParameterTypeDefaultDescription
seeddynamic—The seed input consumed by `CL_SetRandomSeed`.

View source

CL_SetStandardQuake

function CL_SetStandardQuake(client, value)

Apply the Quake-compatible cl set standard quake behavior.

ParameterTypeDefaultDescription
clientdynamic—Client state participating in the operation.
valuedynamic—Value consumed by `CL_SetStandardQuake`.

View source

CL_SignonReply

function CL_SignonReply(client)

Apply the Quake-compatible cl signon reply behavior.

ParameterTypeDefaultDescription
clientdynamic—Client state participating in the operation.

View source

CL_TakeRelinkParticleEffects

function CL_TakeRelinkParticleEffects()

Apply the Quake-compatible cl take relink particle effects behavior.

View source

CL_UpdateEntityDlights

function CL_UpdateEntityDlights(client, currentTime)

The EF_* lights are created during CL_RelinkEntities in WinQuake. This helper performs only that lighting side effect; entity interpolation and trail generation remain in their existing rendering path.

ParameterTypeDefaultDescription
clientdynamic—Client state participating in the operation.
currentTimedynamic—Time value used by the operation.

View source

CL_ViewEntityOrigin

function CL_ViewEntityOrigin(client)

gl_refrag.c removes stale efrags when a force-linked entity no longer has a model. The integrated renderer does not expose native efrag pointers, so this source-guided list is the hand-off boundary for efrag-aware backends.

ParameterTypeDefaultDescription
clientdynamic—Client state participating in the operation.

View source

clChaseActive

clChaseActive

Tracks the module-level cl chase active state owned by `miniquake.client`.

View source

clDisconnectRequestedServerShutdown

clDisconnectRequestedServerShutdown

Tracks the module-level cl disconnect requested server shutdown state owned by `miniquake.client`.

View source

clDlightOldTime

clDlightOldTime

Tracks the module-level cl dlight old time state owned by `miniquake.client`.

View source

clDlights

clDlights

cl_main.c: client-side dynamic-light pool. The original stores this as a fixed translation-unit array rather than inside client_state_t; a package global is the direct MiniLang equivalent.

View source

clDlightTime

clDlightTime

Tracks the module-level cl dlight time state owned by `miniquake.client`.

View source

clearState

function clearState(client)

Update module state for state.

ParameterTypeDefaultDescription
clientdynamic—Client state participating in the operation.

View source

clientCommandExists

function clientCommandExists(name)

Report whether client command exists holds for the active state.

ParameterTypeDefaultDescription
namedynamic—Stable name that identifies the requested object or option.

View source

clientFloat

function clientFloat(value)

client_state_t stores interpolation velocities, entity transforms and dlight fields as C floats even though cl.time/mtime are doubles.

ParameterTypeDefaultDescription
valuedynamic—Value consumed by `clientFloat`.

View source

clientLerp

function clientLerp(previous, current, fraction)

Implements the `clientLerp` operation for `miniquake.client` (client lerp).

ParameterTypeDefaultDescription
previousdynamic—The previous input consumed by `clientLerp`.
currentdynamic—The current input consumed by `clientLerp`.
fractiondynamic—The fraction input consumed by `clientLerp`.

View source

clKeepaliveLastMessage

clKeepaliveLastMessage

Tracks the module-level cl keepalive last message state owned by `miniquake.client`.

View source

clModelFlags

clModelFlags

Tracks the module-level cl model flags state owned by `miniquake.client`.

View source

clModelSyncTypes

clModelSyncTypes

Tracks the module-level cl model sync types state owned by `miniquake.client`.

View source

clMoveMessages

clMoveMessages

Tracks the module-level cl move messages state owned by `miniquake.client`.

View source

clRegisteredCommands

clRegisteredCommands

Tracks the module-level cl registered commands state owned by `miniquake.client`.

View source

clRelinkParticleEffects

clRelinkParticleEffects

Tracks the module-level cl relink particle effects state owned by `miniquake.client`.

View source

clRelinkParticlePool

clRelinkParticlePool

Tracks the module-level cl relink particle pool state owned by `miniquake.client`.

View source

clRelinkParticlePoolActive

clRelinkParticlePoolActive

Tracks the module-level cl relink particle pool active state owned by `miniquake.client`.

View source

clRelinkParticleTime

clRelinkParticleTime

Tracks the module-level cl relink particle time state owned by `miniquake.client`.

View source

clStandardQuake

clStandardQuake

Tracks the module-level cl standard quake state owned by `miniquake.client`.

View source

clTranslations

clTranslations

Tracks the module-level cl translations state owned by `miniquake.client`.

View source

connect

function connect(client, network)

Implements the `connect` operation for `miniquake.client` (connect).

ParameterTypeDefaultDescription
clientdynamic—Client state participating in the operation.
networkdynamic—The network input consumed by `connect`.

View source

connectHost

function connectHost(client, network, host)

Establish host using the active network transport.

ParameterTypeDefaultDescription
clientdynamic—Client state participating in the operation.
networkdynamic—The network input consumed by `connectHost`.
hostdynamic—The host input consumed by `connectHost`.

View source

connectHostInterop

function connectHostInterop(client, network, host, timeoutMilliseconds, resendMilliseconds)

Establish host interop using the active network transport.

ParameterTypeDefaultDescription
clientdynamic—Client state participating in the operation.
networkdynamic—The network input consumed by `connectHostInterop`.
hostdynamic—The host input consumed by `connectHostInterop`.
timeoutMillisecondsdynamic—The timeout milliseconds input consumed by `connectHostInterop`.
resendMillisecondsdynamic—The resend milliseconds input consumed by `connectHostInterop`.

View source

consumeMessages

function consumeMessages(client)

Consume pending state for consume messages.

ParameterTypeDefaultDescription
clientdynamic—Client state participating in the operation.

View source

consumePrintLog

function consumePrintLog(client)

Consume pending state for consume print log.

ParameterTypeDefaultDescription
clientdynamic—Client state participating in the operation.

View source

create

function create(player)

Implements the `create` operation for `miniquake.client` (create).

ParameterTypeDefaultDescription
playerdynamic—The player input consumed by `create`.

View source

createEntity

function createEntity(number)

Create and initialize entity.

ParameterTypeDefaultDescription
numberdynamic—The number input consumed by `createEntity`.

View source

disconnect

function disconnect(client)

Terminate the requested value and release its transport state.

ParameterTypeDefaultDescription
clientdynamic—Client state participating in the operation.

View source

drainMessages

function drainMessages(client)

Consume pending state for drain messages.

ParameterTypeDefaultDescription
clientdynamic—Client state participating in the operation.

View source

dropConnection

function dropConnection(client)

Release state for drop connection.

ParameterTypeDefaultDescription
clientdynamic—Client state participating in the operation.

View source

ensureClientCvar

function ensureClientCvar(registry, name, value, archive)

Ensure sufficient storage or state for client cvar.

ParameterTypeDefaultDescription
registrydynamic—The registry input consumed by `ensureClientCvar`.
namedynamic—Stable name that identifies the requested object or option.
valuedynamic—Value consumed by `ensureClientCvar`.
archivedynamic—The archive input consumed by `ensureClientCvar`.

View source

ensureDynamicLights

function ensureDynamicLights()

Ensure sufficient storage or state for dynamic lights.

View source

ensureEntity

function ensureEntity(client, number)

Ensure sufficient storage or state for entity.

ParameterTypeDefaultDescription
clientdynamic—Client state participating in the operation.
numberdynamic—The number input consumed by `ensureEntity`.

View source

interpolatedAngle

function interpolatedAngle(previous, current, fraction)

Implements the `interpolatedAngle` operation for `miniquake.client` (interpolated angle).

ParameterTypeDefaultDescription
previousdynamic—The previous input consumed by `interpolatedAngle`.
currentdynamic—The current input consumed by `interpolatedAngle`.
fractiondynamic—The fraction input consumed by `interpolatedAngle`.

View source

modelFlagsForIndex

function modelFlagsForIndex(modelIndex)

Return model flags for index derived from the active module state.

ParameterTypeDefaultDescription
modelIndexdynamic—Zero-based index of the requested entry.

View source

modelSyncTypeForIndex

function modelSyncTypeForIndex(modelIndex)

Return model sync type for index derived from the active module state.

ParameterTypeDefaultDescription
modelIndexdynamic—Zero-based index of the requested entry.

View source

newDynamicLight

function newDynamicLight()

Create and initialize dynamic light.

View source

nextDlightRandom

function nextDlightRandom()

Return next dlight random for the active module state.

View source

parseMessage

function parseMessage(client, data)

Read and validate message.

ParameterTypeDefaultDescription
clientdynamic—Client state participating in the operation.
datadynamic—Input data consumed by the operation.

View source

projectileModelFlags

function projectileModelFlags(modelFlags)

Report whether alias-model flags identify a stock trail projectile whose model is more time-sensitive than an ordinary visible entity.

ParameterTypeDefaultDescription
modelFlagsdynamic—The model flags input consumed by `projectileModelFlags`.

View source

pump

function pump(client)

Implements the `pump` operation for `miniquake.client` (pump).

ParameterTypeDefaultDescription
clientdynamic—Client state participating in the operation.

View source

pumpRecording

function pumpRecording(client, recording)

Advance recording by one processing step.

ParameterTypeDefaultDescription
clientdynamic—Client state participating in the operation.
recordingdynamic—The recording input consumed by `pumpRecording`.

View source

queueRelinkParticleEffect

function queueRelinkParticleEffect(command, payload)

Add state for queue relink particle effect.

ParameterTypeDefaultDescription
commanddynamic—Console or protocol command to execute.
payloaddynamic—The payload input consumed by `queueRelinkParticleEffect`.

View source

queueString

function queueString(client, text)

Add state for queue string.

ParameterTypeDefaultDescription
clientdynamic—Client state participating in the operation.
textdynamic—Text to parse or process.

View source

readNetworkMessages

function readNetworkMessages(client, realtime)

Read and validate network messages.

ParameterTypeDefaultDescription
clientdynamic—Client state participating in the operation.
realtimedynamic—Time value used by the operation.

View source

reconnect

function reconnect(client)

Implements the `reconnect` operation for `miniquake.client` (reconnect).

ParameterTypeDefaultDescription
clientdynamic—Client state participating in the operation.

View source

resetDynamicLight

function resetDynamicLight(light, key)

Update module state for dynamic light.

ParameterTypeDefaultDescription
lightdynamic—The light input consumed by `resetDynamicLight`.
keydynamic—Key used to identify the requested entry.

View source

resetScores

function resetScores(client, count)

Update module state for scores.

ParameterTypeDefaultDescription
clientdynamic—Client state participating in the operation.
countdynamic—Number of entries or units to process.

View source

sendMove

function sendMove(client, command)

Send move through the active connection.

ParameterTypeDefaultDescription
clientdynamic—Client state participating in the operation.
commanddynamic—Console or protocol command to execute.

View source

sendReliable

function sendReliable(client)

Send reliable through the active connection.

ParameterTypeDefaultDescription
clientdynamic—Client state participating in the operation.

View source

sendString

function sendString(client, text)

Send string through the active connection.

ParameterTypeDefaultDescription
clientdynamic—Client state participating in the operation.
textdynamic—Text to parse or process.

View source

SetPal

inline function SetPal(index)

The MiniQuake SetPal debug body is compiled out with #if 0.

ParameterTypeDefaultDescription
indexdynamic—Zero-based index of the requested entry.

View source

validScoreIndex

function validScoreIndex(client, index)

Report whether score index.

ParameterTypeDefaultDescription
clientdynamic—Client state participating in the operation.
indexdynamic—Zero-based index of the requested entry.

View source