MiniQuake

src/miniquake/savegame.ml

Package
miniquake.savegame
Reachable
Yes

Imports

Declarations

apply

function apply(server, saved)

Apply the requested value to the active subsystem state.

ParameterTypeDefaultDescription
serverdynamic—Server state participating in the operation.
saveddynamic—The saved input consumed by `apply`.

View source

decodeText

function decodeText(data)

Decodes text for `miniquake.savegame`.

ParameterTypeDefaultDescription
datadynamic—Input data consumed by the operation.

View source

displayComment

function displayComment(comment)

Implements the `displayComment` operation for `miniquake.savegame` (display comment).

ParameterTypeDefaultDescription
commentdynamic—The comment input consumed by `displayComment`.

View source

encodeText

function encodeText(text)

Encodes text for `miniquake.savegame`.

ParameterTypeDefaultDescription
textdynamic—Text to parse or process.

View source

fieldName

function fieldName(machine, offset)

Return field name derived from the active module state.

ParameterTypeDefaultDescription
machinedynamic—The machine input consumed by `fieldName`.
offsetdynamic—Zero-based offset of the requested data.

View source

filename

function filename(name)

Implements the `filename` operation for `miniquake.savegame` (filename).

ParameterTypeDefaultDescription
namedynamic—Stable name that identifies the requested object or option.

View source

floatLine

function floatLine(data, offset, label)

Implements the `floatLine` operation for `miniquake.savegame` (float line).

ParameterTypeDefaultDescription
datadynamic—Input data consumed by the operation.
offsetdynamic—Zero-based offset of the requested data.
labeldynamic—The label input consumed by `floatLine`.

View source

functionName

function functionName(machine, index)

Return function name derived from the active module state.

ParameterTypeDefaultDescription
machinedynamic—The machine input consumed by `functionName`.
indexdynamic—Zero-based index of the requested entry.

View source

hasSuffixInsensitive

function hasSuffixInsensitive(text, suffix)

Report whether suffix insensitive.

ParameterTypeDefaultDescription
textdynamic—Text to parse or process.
suffixdynamic—The suffix input consumed by `hasSuffixInsensitive`.

View source

Host_SavegameComment

function Host_SavegameComment(levelName, killed, total)

host_cmd.c entry points. SaveGamestate/LoadGamestate are used only by the QUAKE2 compile-time path in the reference, but retain useful in-memory counterparts so the original functions have concrete MiniLang code sites.

ParameterTypeDefaultDescription
levelNamedynamic—Name that identifies the requested value or resource.
killeddynamic—The killed input consumed by `Host_SavegameComment`.
totaldynamic—The total input consumed by `Host_SavegameComment`.

View source

inspectComment

function inspectComment(text)

Inspect comment and emit its decoded metadata.

ParameterTypeDefaultDescription
textdynamic—Text to parse or process.

View source

inspectCommentBytes

function inspectCommentBytes(data)

Inspect comment bytes and emit its decoded metadata.

ParameterTypeDefaultDescription
datadynamic—Input data consumed by the operation.

View source

LoadGamestate

function LoadGamestate(server, text)

Read and validate gamestate.

ParameterTypeDefaultDescription
serverdynamic—Server state participating in the operation.
textdynamic—Text to parse or process.

View source

LoadGamestateBytes

function LoadGamestateBytes(server, data)

Read and validate gamestate bytes.

ParameterTypeDefaultDescription
serverdynamic—Server state participating in the operation.
datadynamic—Input data consumed by the operation.

View source

namedGlobalFloat

function namedGlobalFloat(machine, name)

Implements the `namedGlobalFloat` operation for `miniquake.savegame` (named global float).

ParameterTypeDefaultDescription
machinedynamic—The machine input consumed by `namedGlobalFloat`.
namedynamic—Stable name that identifies the requested object or option.

View source

numberLine

function numberLine(data, offset, label)

Implements the `numberLine` operation for `miniquake.savegame` (number line).

ParameterTypeDefaultDescription
datadynamic—Input data consumed by the operation.
offsetdynamic—Zero-based offset of the requested data.
labeldynamic—The label input consumed by `numberLine`.

View source

paddedComment

function paddedComment(levelName, killed, total)

Implements the `paddedComment` operation for `miniquake.savegame` (padded comment).

ParameterTypeDefaultDescription
levelNamedynamic—Name that identifies the requested value or resource.
killeddynamic—The killed input consumed by `paddedComment`.
totaldynamic—The total input consumed by `paddedComment`.

View source

parse

function parse(text)

Implements the `parse` operation for `miniquake.savegame` (parse).

ParameterTypeDefaultDescription
textdynamic—Text to parse or process.

View source

parseBytes

function parseBytes(data)

Parses bytes for `miniquake.savegame`.

ParameterTypeDefaultDescription
datadynamic—Input data consumed by the operation.

View source

readLine

function readLine(data, offset)

Read and validate line.

ParameterTypeDefaultDescription
datadynamic—Input data consumed by the operation.
offsetdynamic—Zero-based offset of the requested data.

View source

SAVEGAME_COMMENT_LENGTH

const SAVEGAME_COMMENT_LENGTH = 39

Defines the savegame comment length value used by `miniquake.savegame`.

View source

SAVEGAME_VERSION

const SAVEGAME_VERSION = 5

Defines the savegame version value used by `miniquake.savegame`.

View source

SaveGamestate

function SaveGamestate(server)

Encode and write gamestate.

ParameterTypeDefaultDescription
serverdynamic—Server state participating in the operation.

View source

SaveGamestateBytes

function SaveGamestateBytes(server)

Encode and write gamestate bytes.

ParameterTypeDefaultDescription
serverdynamic—Server state participating in the operation.

View source

serializeBytes

function serializeBytes(server)

fopen(..., "w") writes the one-byte Quake text stream verbatim. Keep the in-memory string API for tests and command code, but make byte I/O the authoritative savegame boundary.

ParameterTypeDefaultDescription
serverdynamic—Server state participating in the operation.

View source

serializeServer

function serializeServer(server)

Encode and write server.

ParameterTypeDefaultDescription
serverdynamic—Server state participating in the operation.

View source

typeSize

function typeSize(valueType)

Implements the `typeSize` operation for `miniquake.savegame` (type size).

ParameterTypeDefaultDescription
valueTypedynamic—The value type input consumed by `typeSize`.

View source

uglyValue

function uglyValue(machine, words, definition)

Return ugly value derived from the active module state.

ParameterTypeDefaultDescription
machinedynamic—The machine input consumed by `uglyValue`.
wordsdynamic—The words input consumed by `uglyValue`.
definitiondynamic—The definition input consumed by `uglyValue`.

View source

vectorComponentName

function vectorComponentName(name)

Return vector component name derived from the active module state.

ParameterTypeDefaultDescription
namedynamic—Stable name that identifies the requested object or option.

View source

wordsAreZero

function wordsAreZero(words, offset, count)

Implements the `wordsAreZero` operation for `miniquake.savegame` (words are zero).

ParameterTypeDefaultDescription
wordsdynamic—The words input consumed by `wordsAreZero`.
offsetdynamic—Zero-based offset of the requested data.
countdynamic—Number of entries or units to process.

View source

writeDefinitions

function writeDefinitions(machine, words, definitions, globalsOnly)

Encode and write definitions.

ParameterTypeDefaultDescription
machinedynamic—The machine input consumed by `writeDefinitions`.
wordsdynamic—The words input consumed by `writeDefinitions`.
definitionsdynamic—The definitions input consumed by `writeDefinitions`.
globalsOnlydynamic—The globals only input consumed by `writeDefinitions`.

View source

writeEdict

function writeEdict(machine, entityIndex)

Encode and write edict.

ParameterTypeDefaultDescription
machinedynamic—The machine input consumed by `writeEdict`.
entityIndexdynamic—Zero-based index of the requested entry.

View source

writeGlobals

function writeGlobals(machine)

Encode and write globals.

ParameterTypeDefaultDescription
machinedynamic—The machine input consumed by `writeGlobals`.

View source