MiniQuake2

src/miniquake2/game/private_save.ml

Provides miniquake2 game private save facilities for this project.

Package
miniquake2.game.private_save
Reachable
Yes

Imports

Declarations

encode

function encode(runtime, playerContext, entityString, spawnPoint)

Encode the pointer-free private payload in one fixed field order. New fields are append-only within their versioned record so older readers stay explicit.

ParameterTypeDefaultDescription
runtimedynamic—runtime value consumed by this operation.
playerContextdynamic—playerContext value consumed by this operation.
entityStringdynamic—entityString value consumed by this operation.
spawnPointdynamic—spawnPoint value consumed by this operation.

View source

findMonster

function findMonster(runtime, number)

Find monster.

ParameterTypeDefaultDescription
runtimedynamic—runtime value consumed by this operation.
numberdynamic—number value consumed by this operation.

View source

itemByIndex

function itemByIndex(registry, index)

Return the item by index.

ParameterTypeDefaultDescription
registrydynamic—registry value consumed by this operation.
indexdynamic—Zero-based index of the affected item.

View source

itemIndex

function itemIndex(item)

Return the item index.

ParameterTypeDefaultDescription
itemdynamic—item value consumed by this operation.

View source

PRIVATE_MAGIC

const PRIVATE_MAGIC = "MQ2BASEQ2"

Defines the private magic constant used by the miniquake2 game private save module.

View source

PRIVATE_VERSION

const PRIVATE_VERSION = 21

Defines the private version constant used by the miniquake2 game private save module.

View source

privateFindWorld

function privateFindWorld(runtime, number, className)

Find private world.

ParameterTypeDefaultDescription
runtimedynamic—runtime value consumed by this operation.
numberdynamic—number value consumed by this operation.
classNamedynamic—className value consumed by this operation.

View source

miniquake2.game.private_save.PrivateMonsterReference struct

miniquake2.game.private_save.PrivateNoiseReference struct

miniquake2.game.private_save.PrivateProjectileReference struct

privateProjectileThinkKind

function privateProjectileThinkKind(projectile)

Return the reconstructible projectile think callback identity.

ParameterTypeDefaultDescription
projectiledynamic—projectile value consumed by this operation.

View source

privateProjectileTouchKind

function privateProjectileTouchKind(projectile)

Return the reconstructible projectile touch callback identity.

ParameterTypeDefaultDescription
projectiledynamic—projectile value consumed by this operation.

View source

privateReadBool

function privateReadBool(buffer, label)

Read private bool.

ParameterTypeDefaultDescription
bufferdynamic—Buffer that receives or supplies the operation data.
labeldynamic—label value consumed by this operation.

View source

privateReadFloat

function privateReadFloat(buffer, label)

Read private float.

ParameterTypeDefaultDescription
bufferdynamic—Buffer that receives or supplies the operation data.
labeldynamic—label value consumed by this operation.

View source

privateReadPmove

function privateReadPmove(buffer, label)

Read a complete pmove state.

ParameterTypeDefaultDescription
bufferdynamic—Buffer that receives or supplies the operation data.
labeldynamic—label value consumed by this operation.

View source

privateReadVec

function privateReadVec(buffer, label)

Read private vec.

ParameterTypeDefaultDescription
bufferdynamic—Buffer that receives or supplies the operation data.
labeldynamic—label value consumed by this operation.

View source

privateReferenceNumber

function privateReferenceNumber(value)

Return the private reference number.

ParameterTypeDefaultDescription
valuedynamic—Value consumed or transformed by the operation.

View source

privateResolveWorldReference

function privateResolveWorldReference(runtime, playerContext, number, label)

Resolve private world reference.

ParameterTypeDefaultDescription
runtimedynamic—runtime value consumed by this operation.
playerContextdynamic—playerContext value consumed by this operation.
numberdynamic—number value consumed by this operation.
labeldynamic—label value consumed by this operation.

View source

miniquake2.game.private_save.PrivateRestore struct

privateRestoreAIReference

function privateRestoreAIReference(runtime, number, maxClients, exportTable)

Restore private ai reference.

ParameterTypeDefaultDescription
runtimedynamic—runtime value consumed by this operation.
numberdynamic—number value consumed by this operation.
maxClientsdynamic—maxClients value consumed by this operation.
exportTabledynamic—exportTable value consumed by this operation.

View source

privateRestoreEnemy

function privateRestoreEnemy(runtime, number, maxClients, exportTable)

Restore private enemy.

ParameterTypeDefaultDescription
runtimedynamic—runtime value consumed by this operation.
numberdynamic—number value consumed by this operation.
maxClientsdynamic—maxClients value consumed by this operation.
exportTabledynamic—exportTable value consumed by this operation.

View source

privateRestoreLevelAIReference

function privateRestoreLevelAIReference(runtime, number, maxClients, exportTable)

Resolve an AI level-global reference, including synthetic player-noise slots.

ParameterTypeDefaultDescription
runtimedynamic—runtime value consumed by this operation.
numberdynamic—number value consumed by this operation.
maxClientsdynamic—maxClients value consumed by this operation.
exportTabledynamic—exportTable value consumed by this operation.

View source

miniquake2.game.private_save.PrivateWorldReference struct

privateWriteBool

function privateWriteBool(buffer, value)

Write private bool.

ParameterTypeDefaultDescription
bufferdynamic—Buffer that receives or supplies the operation data.
valuedynamic—Value consumed or transformed by the operation.

View source

privateWritePmove

function privateWritePmove(buffer, state)

Write a complete pmove state without relying on the engine save envelope.

ParameterTypeDefaultDescription
bufferdynamic—Buffer that receives or supplies the operation data.
statedynamic—Mutable state inspected or updated by the operation.

View source

privateWriteVec

function privateWriteVec(buffer, value)

Write private vec.

ParameterTypeDefaultDescription
bufferdynamic—Buffer that receives or supplies the operation data.
valuedynamic—Value consumed or transformed by the operation.

View source

restore

function restore(data, mapName, maxClients, exportTable, playerContext)

Restore the versioned, pointer-free MiniQuake2 payload in two phases: first allocate stable entity/AI slots, then resolve saved numeric relationships. This prevents partially decoded references from escaping on malformed input.

ParameterTypeDefaultDescription
datadynamic—Input data consumed by the operation.
mapNamedynamic—mapName value consumed by this operation.
maxClientsdynamic—maxClients value consumed by this operation.
exportTabledynamic—exportTable value consumed by this operation.
playerContextdynamic—playerContext value consumed by this operation.

View source