Files
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.
| Parameter | Type | Default | Description |
|---|
runtime | dynamic | — | 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.
| Parameter | Type | Default | Description |
|---|
integrated | dynamic | — | integrated value consumed by this operation. |
payload | dynamic | — | payload value consumed by this operation. |
sequence | dynamic | — | sequence value consumed by this operation. |
now | dynamic | — | 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.
| Parameter | Type | Default | Description |
|---|
runtime | dynamic | — | runtime value consumed by this operation. |
now | dynamic | — | now value consumed by this operation. |
View source
# flushClient
function flushClient(runtime, socket, now, unreliable, stats)
Flush client.
| Parameter | Type | Default | Description |
|---|
runtime | dynamic | — | runtime value consumed by this operation. |
socket | dynamic | — | socket value consumed by this operation. |
now | dynamic | — | now value consumed by this operation. |
unreliable | dynamic | — | unreliable value consumed by this operation. |
stats | dynamic | — | 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.
| Parameter | Type | Default | Description |
|---|
runtime | dynamic | — | runtime value consumed by this operation. |
socket | dynamic | — | socket value consumed by this operation. |
now | dynamic | — | now value consumed by this operation. |
stats | dynamic | — | stats value consumed by this operation. |
View source
# flushServerClient
function flushServerClient(runtime, socket, slot, now, stats)
Flush server client.
| Parameter | Type | Default | Description |
|---|
runtime | dynamic | — | runtime value consumed by this operation. |
socket | dynamic | — | socket value consumed by this operation. |
slot | dynamic | — | slot value consumed by this operation. |
now | dynamic | — | now value consumed by this operation. |
stats | dynamic | — | stats value consumed by this operation. |
View source
# pumpClient
function pumpClient(runtime, socket, now, maximumPackets)
Pump client.
| Parameter | Type | Default | Description |
|---|
runtime | dynamic | — | runtime value consumed by this operation. |
socket | dynamic | — | socket value consumed by this operation. |
now | dynamic | — | now value consumed by this operation. |
maximumPackets | dynamic | — | 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.
| Parameter | Type | Default | Description |
|---|
serverRuntime | dynamic | — | serverRuntime value consumed by this operation. |
serverSocket | dynamic | — | serverSocket value consumed by this operation. |
masters | dynamic | — | masters value consumed by this operation. |
now | dynamic | — | now value consumed by this operation. |
View source
# pumpIntegratedClient
function pumpIntegratedClient(integrated, socket, now, maximumPackets)
Pump integrated client.
| Parameter | Type | Default | Description |
|---|
integrated | dynamic | — | integrated value consumed by this operation. |
socket | dynamic | — | socket value consumed by this operation. |
now | dynamic | — | now value consumed by this operation. |
maximumPackets | dynamic | — | maximumPackets value consumed by this operation. |
View source
# pumpPair
function pumpPair(clientRuntime, serverRuntime, clientSocket, serverSocket, now, maximumPackets)
Pump pair.
| Parameter | Type | Default | Description |
|---|
clientRuntime | dynamic | — | clientRuntime value consumed by this operation. |
serverRuntime | dynamic | — | serverRuntime value consumed by this operation. |
clientSocket | dynamic | — | clientSocket value consumed by this operation. |
serverSocket | dynamic | — | serverSocket value consumed by this operation. |
now | dynamic | — | now value consumed by this operation. |
maximumPackets | dynamic | — | maximumPackets value consumed by this operation. |
View source
# pumpServer
function pumpServer(runtime, socket, now, maximumPackets)
Pump server.
| Parameter | Type | Default | Description |
|---|
runtime | dynamic | — | runtime value consumed by this operation. |
socket | dynamic | — | socket value consumed by this operation. |
now | dynamic | — | now value consumed by this operation. |
maximumPackets | dynamic | — | maximumPackets value consumed by this operation. |
View source
# pumpServerPaused
function pumpServerPaused(runtime, socket, now, maximumPackets, paused)
Pump server paused.
| Parameter | Type | Default | Description |
|---|
runtime | dynamic | — | runtime value consumed by this operation. |
socket | dynamic | — | socket value consumed by this operation. |
now | dynamic | — | now value consumed by this operation. |
maximumPackets | dynamic | — | maximumPackets value consumed by this operation. |
paused | dynamic | — | paused value consumed by this operation. |
View source
# sendActions
function sendActions(socket, actions, stats)
Send actions.
| Parameter | Type | Default | Description |
|---|
socket | dynamic | — | socket value consumed by this operation. |
actions | dynamic | — | actions value consumed by this operation. |
stats | dynamic | — | stats value consumed by this operation. |
View source
# sendDatagram
function sendDatagram(socket, address, data, stats)
Send datagram.
| Parameter | Type | Default | Description |
|---|
socket | dynamic | — | socket value consumed by this operation. |
address | dynamic | — | address value consumed by this operation. |
data | dynamic | — | Input data consumed by the operation. |
stats | dynamic | — | 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.
| Parameter | Type | Default | Description |
|---|
runtime | dynamic | — | runtime value consumed by this operation. |
socket | dynamic | — | socket value consumed by this operation. |
slot | dynamic | — | slot value consumed by this operation. |
now | dynamic | — | now value consumed by this operation. |
payload | dynamic | — | payload value consumed by this operation. |
View source
# shutdownServer
function shutdownServer(serverRuntime, serverSocket)
Shut down server.
| Parameter | Type | Default | Description |
|---|
serverRuntime | dynamic | — | serverRuntime value consumed by this operation. |
serverSocket | dynamic | — | serverSocket value consumed by this operation. |
View source