MiniQuake2

src/miniquake2/network/runtime/pump.ml

Provides miniquake2 network runtime pump facilities for this project.

Package
miniquake2.network.runtime.pump
Reachable
Yes

Imports

Declarations

calculatePings

function calculatePings(runtime)

SV_CalcPings averages the positive samples in frame_latency and publishes the result both on client_t and the corresponding game client. Keeping the Game API write behind a callback avoids coupling the transport runtime to a concrete game implementation.

ParameterTypeDefaultDescription
runtimedynamic—runtime value consumed by this operation.

View source

dispatchIntegratedPayload

function dispatchIntegratedPayload(integrated, payload, sequence, now)

Product client path: identical transport/Netchan handling, with accepted payloads committed through the transactional effects/snapshot/demo dispatcher instead of the legacy protocol-only parser.

ParameterTypeDefaultDescription
integrateddynamic—integrated value consumed by this operation.
payloaddynamic—payload value consumed by this operation.
sequencedynamic—sequence value consumed by this operation.
nowdynamic—now value consumed by this operation.

View source

expireTimedOutClients

function expireTimedOutClients(runtime, now)

SV_CheckTimeouts routes spawned clients through SV_DropClient before the slot is reclaimed. SV_DropClient calls the game DLL's ClientDisconnect, which removes the player entity and other game-owned state. Keep that callback boundary in the managed runtime; connected clients have not entered the game yet and therefore deliberately do not receive it.

ParameterTypeDefaultDescription
runtimedynamic—runtime value consumed by this operation.
nowdynamic—now value consumed by this operation.

View source

flushClient

function flushClient(runtime, socket, now, unreliable, stats)

Flush client.

ParameterTypeDefaultDescription
runtimedynamic—runtime value consumed by this operation.
socketdynamic—socket value consumed by this operation.
nowdynamic—now value consumed by this operation.
unreliabledynamic—unreliable value consumed by this operation.
statsdynamic—stats value consumed by this operation.

View source

flushClientForPump

function flushClientForPump(runtime, socket, now, stats)

CL_SendCmd throttles a connected (not yet active) client with no reliable work to one keepalive per second. The lower-level flushClient deliberately remains an unconditional Netchan transmit primitive for callers/tests.

ParameterTypeDefaultDescription
runtimedynamic—runtime value consumed by this operation.
socketdynamic—socket value consumed by this operation.
nowdynamic—now value consumed by this operation.
statsdynamic—stats value consumed by this operation.

View source

flushServerClient

function flushServerClient(runtime, socket, slot, now, stats)

Flush server client.

ParameterTypeDefaultDescription
runtimedynamic—runtime value consumed by this operation.
socketdynamic—socket value consumed by this operation.
slotdynamic—slot value consumed by this operation.
nowdynamic—now value consumed by this operation.
statsdynamic—stats value consumed by this operation.

View source

pumpClient

function pumpClient(runtime, socket, now, maximumPackets)

Pump client.

ParameterTypeDefaultDescription
runtimedynamic—runtime value consumed by this operation.
socketdynamic—socket value consumed by this operation.
nowdynamic—now value consumed by this operation.
maximumPacketsdynamic—maximumPackets value consumed by this operation.

View source

pumpHeartbeats

function pumpHeartbeats(serverRuntime, serverSocket, masters, now)

Master addresses are already-resolved managed endpoints. DNS discovery is a platform/bootstrap concern and deliberately stays outside this UDP pump.

ParameterTypeDefaultDescription
serverRuntimedynamic—serverRuntime value consumed by this operation.
serverSocketdynamic—serverSocket value consumed by this operation.
mastersdynamic—masters value consumed by this operation.
nowdynamic—now value consumed by this operation.

View source

pumpIntegratedClient

function pumpIntegratedClient(integrated, socket, now, maximumPackets)

Pump integrated client.

ParameterTypeDefaultDescription
integrateddynamic—integrated value consumed by this operation.
socketdynamic—socket value consumed by this operation.
nowdynamic—now value consumed by this operation.
maximumPacketsdynamic—maximumPackets value consumed by this operation.

View source

pumpPair

function pumpPair(clientRuntime, serverRuntime, clientSocket, serverSocket, now, maximumPackets)

Pump pair.

ParameterTypeDefaultDescription
clientRuntimedynamic—clientRuntime value consumed by this operation.
serverRuntimedynamic—serverRuntime value consumed by this operation.
clientSocketdynamic—clientSocket value consumed by this operation.
serverSocketdynamic—serverSocket value consumed by this operation.
nowdynamic—now value consumed by this operation.
maximumPacketsdynamic—maximumPackets value consumed by this operation.

View source

pumpServer

function pumpServer(runtime, socket, now, maximumPackets)

Pump server.

ParameterTypeDefaultDescription
runtimedynamic—runtime value consumed by this operation.
socketdynamic—socket value consumed by this operation.
nowdynamic—now value consumed by this operation.
maximumPacketsdynamic—maximumPackets value consumed by this operation.

View source

pumpServerPaused

function pumpServerPaused(runtime, socket, now, maximumPackets, paused)

Pump server paused.

ParameterTypeDefaultDescription
runtimedynamic—runtime value consumed by this operation.
socketdynamic—socket value consumed by this operation.
nowdynamic—now value consumed by this operation.
maximumPacketsdynamic—maximumPackets value consumed by this operation.
pauseddynamic—paused value consumed by this operation.

View source

sendActions

function sendActions(socket, actions, stats)

Send actions.

ParameterTypeDefaultDescription
socketdynamic—socket value consumed by this operation.
actionsdynamic—actions value consumed by this operation.
statsdynamic—stats value consumed by this operation.

View source

sendDatagram

function sendDatagram(socket, address, data, stats)

Send datagram.

ParameterTypeDefaultDescription
socketdynamic—socket value consumed by this operation.
addressdynamic—address value consumed by this operation.
datadynamic—Input data consumed by the operation.
statsdynamic—stats value consumed by this operation.

View source

sendServerPayload

function sendServerPayload(runtime, socket, slot, now, payload)

Send one unreliable server payload while preserving any staged reliable bytes in the same Netchan packet. Runtime/session uses this for snapshots; the regular pump retains responsibility for pure ACK/reliable flushes.

ParameterTypeDefaultDescription
runtimedynamic—runtime value consumed by this operation.
socketdynamic—socket value consumed by this operation.
slotdynamic—slot value consumed by this operation.
nowdynamic—now value consumed by this operation.
payloaddynamic—payload value consumed by this operation.

View source

shutdownServer

function shutdownServer(serverRuntime, serverSocket)

Shut down server.

ParameterTypeDefaultDescription
serverRuntimedynamic—serverRuntime value consumed by this operation.
serverSocketdynamic—serverSocket value consumed by this operation.

View source