Files
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.
| Parameter | Type | Default | Description |
|---|
runtime | dynamic | — | runtime value consumed by this operation. |
playerContext | dynamic | — | playerContext value consumed by this operation. |
entityString | dynamic | — | entityString value consumed by this operation. |
spawnPoint | dynamic | — | spawnPoint value consumed by this operation. |
View source
# findMonster
function findMonster(runtime, number)
Find monster.
| Parameter | Type | Default | Description |
|---|
runtime | dynamic | — | runtime value consumed by this operation. |
number | dynamic | — | number value consumed by this operation. |
View source
# itemByIndex
function itemByIndex(registry, index)
Return the item by index.
| Parameter | Type | Default | Description |
|---|
registry | dynamic | — | registry value consumed by this operation. |
index | dynamic | — | Zero-based index of the affected item. |
View source
# itemIndex
function itemIndex(item)
Return the item index.
| Parameter | Type | Default | Description |
|---|
item | dynamic | — | 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.
| Parameter | Type | Default | Description |
|---|
runtime | dynamic | — | runtime value consumed by this operation. |
number | dynamic | — | number value consumed by this operation. |
className | dynamic | — | 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.
| Parameter | Type | Default | Description |
|---|
projectile | dynamic | — | projectile value consumed by this operation. |
View source
# privateProjectileTouchKind
function privateProjectileTouchKind(projectile)
Return the reconstructible projectile touch callback identity.
| Parameter | Type | Default | Description |
|---|
projectile | dynamic | — | projectile value consumed by this operation. |
View source
# privateReadBool
function privateReadBool(buffer, label)
Read private bool.
| Parameter | Type | Default | Description |
|---|
buffer | dynamic | — | Buffer that receives or supplies the operation data. |
label | dynamic | — | label value consumed by this operation. |
View source
# privateReadFloat
function privateReadFloat(buffer, label)
Read private float.
| Parameter | Type | Default | Description |
|---|
buffer | dynamic | — | Buffer that receives or supplies the operation data. |
label | dynamic | — | label value consumed by this operation. |
View source
# privateReadPmove
function privateReadPmove(buffer, label)
Read a complete pmove state.
| Parameter | Type | Default | Description |
|---|
buffer | dynamic | — | Buffer that receives or supplies the operation data. |
label | dynamic | — | label value consumed by this operation. |
View source
# privateReadVec
function privateReadVec(buffer, label)
Read private vec.
| Parameter | Type | Default | Description |
|---|
buffer | dynamic | — | Buffer that receives or supplies the operation data. |
label | dynamic | — | label value consumed by this operation. |
View source
# privateReferenceNumber
function privateReferenceNumber(value)
Return the private reference number.
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed or transformed by the operation. |
View source
# privateResolveWorldReference
function privateResolveWorldReference(runtime, playerContext, number, label)
Resolve private world reference.
| Parameter | Type | Default | Description |
|---|
runtime | dynamic | — | runtime value consumed by this operation. |
playerContext | dynamic | — | playerContext value consumed by this operation. |
number | dynamic | — | number value consumed by this operation. |
label | dynamic | — | 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.
| Parameter | Type | Default | Description |
|---|
runtime | dynamic | — | runtime value consumed by this operation. |
number | dynamic | — | number value consumed by this operation. |
maxClients | dynamic | — | maxClients value consumed by this operation. |
exportTable | dynamic | — | exportTable value consumed by this operation. |
View source
# privateRestoreEnemy
function privateRestoreEnemy(runtime, number, maxClients, exportTable)
Restore private enemy.
| Parameter | Type | Default | Description |
|---|
runtime | dynamic | — | runtime value consumed by this operation. |
number | dynamic | — | number value consumed by this operation. |
maxClients | dynamic | — | maxClients value consumed by this operation. |
exportTable | dynamic | — | 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.
| Parameter | Type | Default | Description |
|---|
runtime | dynamic | — | runtime value consumed by this operation. |
number | dynamic | — | number value consumed by this operation. |
maxClients | dynamic | — | maxClients value consumed by this operation. |
exportTable | dynamic | — | exportTable value consumed by this operation. |
View source
miniquake2.game.private_save.PrivateWorldReference struct
# privateWriteBool
function privateWriteBool(buffer, value)
Write private bool.
| Parameter | Type | Default | Description |
|---|
buffer | dynamic | — | Buffer that receives or supplies the operation data. |
value | dynamic | — | 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.
| Parameter | Type | Default | Description |
|---|
buffer | dynamic | — | Buffer that receives or supplies the operation data. |
state | dynamic | — | Mutable state inspected or updated by the operation. |
View source
# privateWriteVec
function privateWriteVec(buffer, value)
Write private vec.
| Parameter | Type | Default | Description |
|---|
buffer | dynamic | — | Buffer that receives or supplies the operation data. |
value | dynamic | — | 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.
| Parameter | Type | Default | Description |
|---|
data | dynamic | — | Input data consumed by the operation. |
mapName | dynamic | — | mapName value consumed by this operation. |
maxClients | dynamic | — | maxClients value consumed by this operation. |
exportTable | dynamic | — | exportTable value consumed by this operation. |
playerContext | dynamic | — | playerContext value consumed by this operation. |
View source