MiniQuake2

src/miniquake2/runtime/client_session.ml

Provides miniquake2 runtime client session facilities for this project.

Package
miniquake2.runtime.client_session
Reachable
Yes

Imports

Declarations

CLIENT_COMMAND_MSEC

const CLIENT_COMMAND_MSEC = 11

Defines the client command msec constant used by the miniquake2 runtime client session module.

View source

miniquake2.runtime.client_session.ClientSession struct

CMD_BACKUP

const CMD_BACKUP = 64

Defines the cmd backup constant used by the miniquake2 runtime client session module.

View source

CMD_MASK

const CMD_MASK = 63

Defines the cmd mask constant used by the miniquake2 runtime client session module.

View source

configureDownloads

function configureDownloads(session, manager)

Configure downloads.

ParameterTypeDefaultDescription
sessiondynamic—session value consumed by this operation.
managerdynamic—manager value consumed by this operation.

View source

copyUserCmdInto

function copyUserCmdInto(output, command)

Populate the copy user cmd destination.

ParameterTypeDefaultDescription
outputdynamic—Output collection or buffer populated by the operation.
commanddynamic—command value consumed by this operation.

View source

create

function create(serverAddress, serverPort, userInfo, localPort)

Creates create for the miniquake2 runtime client session module.

ParameterTypeDefaultDescription
serverAddressdynamic—serverAddress value consumed by this operation.
serverPortdynamic—serverPort value consumed by this operation.
userInfodynamic—userInfo value consumed by this operation.
localPortdynamic—localPort value consumed by this operation.

View source

createPredictionCommandScratch

function createPredictionCommandScratch()

Create prediction command scratch.

View source

fillPredictionCommands

function fillPredictionCommands(session, previewCommand, output)

Allocation-stable form used by the product render loop. History entries are session-owned immutable copies; the preview is consumed synchronously by prediction, which copies each command into its reusable Pmove command.

ParameterTypeDefaultDescription
sessiondynamic—session value consumed by this operation.
previewCommanddynamic—previewCommand value consumed by this operation.
outputdynamic—Output collection or buffer populated by the operation.

View source

makeOriginScratch

function makeOriginScratch(count)

Create origin scratch.

ParameterTypeDefaultDescription
countdynamic—Number of items or units to process.

View source

makeUserCmdScratch

function makeUserCmdScratch(count)

Create user cmd scratch.

ParameterTypeDefaultDescription
countdynamic—Number of items or units to process.

View source

MAX_PENDING_USERCMDS

const MAX_PENDING_USERCMDS = 64

Defines the max pending usercmds constant used by the miniquake2 runtime client session module.

View source

movementDue

function movementDue(previousTime, now)

Return the movement due value.

ParameterTypeDefaultDescription
previousTimedynamic—previousTime value consumed by this operation.
nowdynamic—now value consumed by this operation.

View source

nextUserCmd

function nextUserCmd(session)

Return the next user cmd value.

ParameterTypeDefaultDescription
sessiondynamic—session value consumed by this operation.

View source

pendingUserCmds

function pendingUserCmds(session)

Report whether pending user cmds.

ParameterTypeDefaultDescription
sessiondynamic—session value consumed by this operation.

View source

poll

function poll(session)

Receive/ACK/signon half of a listen-server tick without synthesizing a second usercmd for the same UI frame.

ParameterTypeDefaultDescription
sessiondynamic—session value consumed by this operation.

View source

predictionCommands

function predictionCommands(session, previewCommand)

Return exactly the unacknowledged cmd ring followed by the current render preview. Missing pre-active/sign-on sequences are intentionally skipped.

ParameterTypeDefaultDescription
sessiondynamic—session value consumed by this operation.
previewCommanddynamic—previewCommand value consumed by this operation.

View source

predictionSequence

function predictionSequence(session)

Return the prediction sequence value.

ParameterTypeDefaultDescription
sessiondynamic—session value consumed by this operation.

View source

predictRemote

function predictRemote(session, previewCommand, collision)

CL_PredictMovement for a real remote client: replay the unacknowledged command ring against the locally loaded BSP plus the current packet-entity solids. Listen play may keep using its authoritative Game-API bridge.

ParameterTypeDefaultDescription
sessiondynamic—session value consumed by this operation.
previewCommanddynamic—previewCommand value consumed by this operation.
collisiondynamic—collision value consumed by this operation.

View source

processDownloads

function processDownloads(session, now)

Process downloads.

ParameterTypeDefaultDescription
sessiondynamic—session value consumed by this operation.
nowdynamic—now value consumed by this operation.

View source

processSignon

function processSignon(session, now)

Process signon.

ParameterTypeDefaultDescription
sessiondynamic—session value consumed by this operation.
nowdynamic—now value consumed by this operation.

View source

pump

function pump(session, sendMovement)

Pump state.

ParameterTypeDefaultDescription
sessiondynamic—session value consumed by this operation.
sendMovementdynamic—sendMovement value consumed by this operation.

View source

queueUserCmd

function queueUserCmd(session, command)

Queue preserves every input sample. The bounded backlog prevents a paused UI producer from causing unbounded latency when networking resumes.

ParameterTypeDefaultDescription
sessiondynamic—session value consumed by this operation.
commanddynamic—command value consumed by this operation.

View source

reconcilePrediction

function reconcilePrediction(session)

Reconcile prediction.

ParameterTypeDefaultDescription
sessiondynamic—session value consumed by this operation.

View source

resetMapInput

function resetMapInput(session)

Reset map input.

ParameterTypeDefaultDescription
sessiondynamic—session value consumed by this operation.

View source

resetUserCmd

function resetUserCmd(output, msec)

Reset user cmd.

ParameterTypeDefaultDescription
outputdynamic—Output collection or buffer populated by the operation.
msecdynamic—msec value consumed by this operation.

View source

run

function run(session, frameLimit)

Runs run for the miniquake2 runtime client session workflow.

ParameterTypeDefaultDescription
sessiondynamic—session value consumed by this operation.
frameLimitdynamic—frameLimit value consumed by this operation.

View source

sendMove

function sendMove(session, now)

Send move.

ParameterTypeDefaultDescription
sessiondynamic—session value consumed by this operation.
nowdynamic—now value consumed by this operation.

View source

sendStringCommand

function sendStringCommand(session, command, now)

Send string command.

ParameterTypeDefaultDescription
sessiondynamic—session value consumed by this operation.
commanddynamic—command value consumed by this operation.
nowdynamic—now value consumed by this operation.

View source

sendUserInfo

function sendUserInfo(session, userInfo, now)

Send user info.

ParameterTypeDefaultDescription
sessiondynamic—session value consumed by this operation.
userInfodynamic—userInfo value consumed by this operation.
nowdynamic—now value consumed by this operation.

View source

sequenceDistance

inline function sequenceDistance(candidate, base)

Return the sequence distance value.

ParameterTypeDefaultDescription
candidatedynamic—candidate value consumed by this operation.
basedynamic—base value consumed by this operation.

View source

setUserCmd

function setUserCmd(session, command)

Replace pending samples with the newest command, useful for frame-driven UI where old unsent mouse deltas must not be replayed later.

ParameterTypeDefaultDescription
sessiondynamic—session value consumed by this operation.
commanddynamic—command value consumed by this operation.

View source

shutdown

function shutdown(session)

Performs the shutdown operation for the miniquake2 runtime client session module.

ParameterTypeDefaultDescription
sessiondynamic—session value consumed by this operation.

View source

signonCommand

function signonCommand(text)

Return the signon command value.

ParameterTypeDefaultDescription
textdynamic—Text consumed by the operation.

View source

step

function step(session)

Performs the step operation for the miniquake2 runtime client session module.

ParameterTypeDefaultDescription
sessiondynamic—session value consumed by this operation.

View source

storePredictedOrigin

function storePredictedOrigin(session, sequence, fixedOrigin)

Return the store predicted origin.

ParameterTypeDefaultDescription
sessiondynamic—session value consumed by this operation.
sequencedynamic—sequence value consumed by this operation.
fixedOrigindynamic—fixedOrigin value consumed by this operation.

View source

synchronizeSpawnCount

function synchronizeSpawnCount(session)

Synchronize spawn count.

ParameterTypeDefaultDescription
sessiondynamic—session value consumed by this operation.

View source

validatedMovement

function validatedMovement(value)

Return the validated movement value.

ParameterTypeDefaultDescription
valuedynamic—Value consumed or transformed by the operation.

View source

validateUserCmd

function validateUserCmd(command)

Validate user cmd.

ParameterTypeDefaultDescription
commanddynamic—command value consumed by this operation.

View source

validateUserCmdInto

function validateUserCmdInto(output, command)

Populate the validate user cmd destination.

ParameterTypeDefaultDescription
outputdynamic—Output collection or buffer populated by the operation.
commanddynamic—command value consumed by this operation.

View source