# decode
function decode(data, maxEdicts)Decode state.
| Parameter | Type | Default | Description |
|---|---|---|---|
data | dynamic | — | Input data consumed by the operation. |
maxEdicts | dynamic | — | maxEdicts value consumed by this operation. |
src/miniquake2/game/persistence.mlProvides miniquake2 game persistence facilities for this project.
miniquake2/game/types.ml as gt → src/miniquake2/game/types.mlminiquake2/protocol/checked.ml as pchecked → src/miniquake2/protocol/checked.mlminiquake2/qcommon/message.ml as qmsg → src/miniquake2/qcommon/message.mlminiquake2/qcommon/sizebuf.ml as qsz → src/miniquake2/qcommon/sizebuf.mlstd/fs.ml as savefs → ../MiniLangCompilerML/std/fs.ml external dependencyfunction decode(data, maxEdicts)Decode state.
| Parameter | Type | Default | Description |
|---|---|---|---|
data | dynamic | — | Input data consumed by the operation. |
maxEdicts | dynamic | — | maxEdicts value consumed by this operation. |
function decodeSaveImage(data, maxEdicts)Decode save image.
| Parameter | Type | Default | Description |
|---|---|---|---|
data | dynamic | — | Input data consumed by the operation. |
maxEdicts | dynamic | — | maxEdicts value consumed by this operation. |
function encode(exportTable, kind, mapName, frameNumber)Encodes encode for the miniquake2 game persistence workflow.
| Parameter | Type | Default | Description |
|---|---|---|---|
exportTable | dynamic | — | exportTable value consumed by this operation. |
kind | dynamic | — | kind value consumed by this operation. |
mapName | dynamic | — | mapName value consumed by this operation. |
frameNumber | dynamic | — | frameNumber value consumed by this operation. |
function encodeSaveImageWithPrivate(exportTable, kind, mapName, frameNumber, privateData)Encode save image with private.
| Parameter | Type | Default | Description |
|---|---|---|---|
exportTable | dynamic | — | exportTable value consumed by this operation. |
kind | dynamic | — | kind value consumed by this operation. |
mapName | dynamic | — | mapName value consumed by this operation. |
frameNumber | dynamic | — | frameNumber value consumed by this operation. |
privateData | dynamic | — | privateData value consumed by this operation. |
function encodeWithPrivate(exportTable, kind, mapName, frameNumber, privateData)Encode with private.
| Parameter | Type | Default | Description |
|---|---|---|---|
exportTable | dynamic | — | exportTable value consumed by this operation. |
kind | dynamic | — | kind value consumed by this operation. |
mapName | dynamic | — | mapName value consumed by this operation. |
frameNumber | dynamic | — | frameNumber value consumed by this operation. |
privateData | dynamic | — | privateData value consumed by this operation. |
function readEntityState(buffer, expectedNumber)Read entity state.
| Parameter | Type | Default | Description |
|---|---|---|---|
buffer | dynamic | — | Buffer that receives or supplies the operation data. |
expectedNumber | dynamic | — | expectedNumber value consumed by this operation. |
function readFile(filename, maxEdicts)Read file.
| Parameter | Type | Default | Description |
|---|---|---|---|
filename | dynamic | — | filename value consumed by this operation. |
maxEdicts | dynamic | — | maxEdicts value consumed by this operation. |
function readFloat(buffer, operation)Read float.
| Parameter | Type | Default | Description |
|---|---|---|---|
buffer | dynamic | — | Buffer that receives or supplies the operation data. |
operation | dynamic | — | operation value consumed by this operation. |
function readPlayerState(buffer)Read player state.
| Parameter | Type | Default | Description |
|---|---|---|---|
buffer | dynamic | — | Buffer that receives or supplies the operation data. |
function readPmoveState(buffer)Read pmove state.
| Parameter | Type | Default | Description |
|---|---|---|---|
buffer | dynamic | — | Buffer that receives or supplies the operation data. |
function readVec3(buffer, operation)Read vec 3.
| Parameter | Type | Default | Description |
|---|---|---|---|
buffer | dynamic | — | Buffer that receives or supplies the operation data. |
operation | dynamic | — | operation value consumed by this operation. |
const SAVE_MAGIC = "MQ2SAVE1"Defines the save magic constant used by the miniquake2 game persistence module.
const SAVE_VERSION = 2Defines the save version constant used by the miniquake2 game persistence module.
function saveFormat(data)Save format.
| Parameter | Type | Default | Description |
|---|---|---|---|
data | dynamic | — | Input data consumed by the operation. |
miniquake2.game.persistence.SaveImage struct
function writeEntityState(buffer, state)Write entity state.
| Parameter | Type | Default | Description |
|---|---|---|---|
buffer | dynamic | — | Buffer that receives or supplies the operation data. |
state | dynamic | — | Mutable state inspected or updated by the operation. |
function writeFile(exportTable, kind, mapName, frameNumber, filename)Write file.
| Parameter | Type | Default | Description |
|---|---|---|---|
exportTable | dynamic | — | exportTable value consumed by this operation. |
kind | dynamic | — | kind value consumed by this operation. |
mapName | dynamic | — | mapName value consumed by this operation. |
frameNumber | dynamic | — | frameNumber value consumed by this operation. |
filename | dynamic | — | filename value consumed by this operation. |
function writeFileWithPrivate(exportTable, kind, mapName, frameNumber, privateData, filename)Write file with private.
| Parameter | Type | Default | Description |
|---|---|---|---|
exportTable | dynamic | — | exportTable value consumed by this operation. |
kind | dynamic | — | kind value consumed by this operation. |
mapName | dynamic | — | mapName value consumed by this operation. |
frameNumber | dynamic | — | frameNumber value consumed by this operation. |
privateData | dynamic | — | privateData value consumed by this operation. |
filename | dynamic | — | filename value consumed by this operation. |
function writePlayerState(buffer, state)Write player state.
| Parameter | Type | Default | Description |
|---|---|---|---|
buffer | dynamic | — | Buffer that receives or supplies the operation data. |
state | dynamic | — | Mutable state inspected or updated by the operation. |
function writePmoveState(buffer, state)Write pmove state.
| Parameter | Type | Default | Description |
|---|---|---|---|
buffer | dynamic | — | Buffer that receives or supplies the operation data. |
state | dynamic | — | Mutable state inspected or updated by the operation. |
function writeVec3(buffer, value)Write vec 3.
| Parameter | Type | Default | Description |
|---|---|---|---|
buffer | dynamic | — | Buffer that receives or supplies the operation data. |
value | dynamic | — | Value consumed or transformed by the operation. |