MiniQuake2

src/miniquake2/client/downloads.ml

Provides miniquake2 client downloads facilities for this project.

Package
miniquake2.client.downloads
Reachable
Yes

Imports

Declarations

acceptChunk

function acceptChunk(manager, data, percent, missing)

Accept chunk.

ParameterTypeDefaultDescription
managerdynamic—manager value consumed by this operation.
datadynamic—Input data consumed by the operation.
percentdynamic—percent value consumed by this operation.
missingdynamic—missing value consumed by this operation.

View source

addRequest

function addRequest(manager, kind, requestedName)

Add request.

ParameterTypeDefaultDescription
managerdynamic—manager value consumed by this operation.
kinddynamic—kind value consumed by this operation.
requestedNamedynamic—requestedName value consumed by this operation.

View source

advance

function advance(manager)

Performs the advance operation for the miniquake2 client downloads module.

ParameterTypeDefaultDescription
managerdynamic—manager value consumed by this operation.

View source

appendChunk

function appendChunk(path, data)

Append chunk.

ParameterTypeDefaultDescription
pathdynamic—Path of the file or directory used by the operation.
datadynamic—Input data consumed by the operation.

View source

beginPrecache

function beginPrecache(manager, configStrings, spawnCount)

Begin precache.

ParameterTypeDefaultDescription
managerdynamic—manager value consumed by this operation.
configStringsdynamic—configStrings value consumed by this operation.
spawnCountdynamic—Number of spawn to process.

View source

buildPrecachePlan

function buildPrecachePlan(manager, configStrings)

Build precache plan.

ParameterTypeDefaultDescription
managerdynamic—manager value consumed by this operation.
configStringsdynamic—configStrings value consumed by this operation.

View source

cancel

function cancel(manager)

Cancel state.

ParameterTypeDefaultDescription
managerdynamic—manager value consumed by this operation.

View source

classicPolicy

function classicPolicy(allow, maps, models, players, sounds)

Original menu/cvars expose no separate image switch: pics follow the global allow_download value. Keep this adapter as the single product/UI mapping.

ParameterTypeDefaultDescription
allowdynamic—allow value consumed by this operation.
mapsdynamic—maps value consumed by this operation.
modelsdynamic—models value consumed by this operation.
playersdynamic—players value consumed by this operation.
soundsdynamic—sounds value consumed by this operation.

View source

CloseHandle

extern function CloseHandle(handle as ptr) from "kernel32.dll" returns bool

Invokes the native CloseHandle entry point used by the miniquake2 client downloads module.

ParameterTypeDefaultDescription
handleptr—Native or runtime handle used by the operation.

Returns: Native bool result produced by the call.

View source

create

function create(baseDirectory, gameDirectory, policy, fileExists, readFile, registerAsset)

Creates create for the miniquake2 client downloads module.

ParameterTypeDefaultDescription
baseDirectorydynamic—baseDirectory value consumed by this operation.
gameDirectorydynamic—gameDirectory value consumed by this operation.
policydynamic—policy value consumed by this operation.
fileExistsdynamic—fileExists value consumed by this operation.
readFiledynamic—readFile value consumed by this operation.
registerAssetdynamic—registerAsset value consumed by this operation.

View source

CreateDirectoryW

extern function CreateDirectoryW(path as wstr, security as ptr) from "kernel32.dll" returns bool

Invokes the native CreateDirectoryW entry point used by the miniquake2 client downloads module.

ParameterTypeDefaultDescription
pathwstr—Path of the file or directory used by the operation.
securityptr—security value consumed by this operation.

Returns: Native bool result produced by the call.

View source

CreateFileW

extern function CreateFileW(path as wstr, access as int, share as int, security as ptr, creation as int, flags as int, template as ptr) from "kernel32.dll" returns ptr

Invokes the native CreateFileW entry point used by the miniquake2 client downloads module.

ParameterTypeDefaultDescription
pathwstr—Path of the file or directory used by the operation.
accessint—access value consumed by this operation.
shareint—share value consumed by this operation.
securityptr—security value consumed by this operation.
creationint—creation value consumed by this operation.
flagsint—Bit flags controlling the operation.
templateptr—template value consumed by this operation.

Returns: Native ptr result produced by the call.

View source

defaultPolicy

function defaultPolicy()

Return the default policy value.

View source

discoverDependencies

function discoverDependencies(manager, request)

Discover dependencies.

ParameterTypeDefaultDescription
managerdynamic—manager value consumed by this operation.
requestdynamic—request value consumed by this operation.

View source

miniquake2.client.downloads.DownloadManager struct

miniquake2.client.downloads.DownloadPolicy struct

miniquake2.client.downloads.DownloadRequest struct

ensureParentDirectory

function ensureParentDirectory(path)

Ensure parent directory.

ParameterTypeDefaultDescription
pathdynamic—Path of the file or directory used by the operation.

View source

FILE_ATTRIBUTE_NORMAL

const FILE_ATTRIBUTE_NORMAL = 128

Defines the file attribute normal constant used by the miniquake2 client downloads module.

View source

FILE_END

const FILE_END = 2

Defines the file end constant used by the miniquake2 client downloads module.

View source

FILE_SHARE_READ

const FILE_SHARE_READ = 1

Defines the file share read constant used by the miniquake2 client downloads module.

View source

finishCurrent

function finishCurrent(manager)

Finish current.

ParameterTypeDefaultDescription
managerdynamic—manager value consumed by this operation.

View source

FlushFileBuffers

extern function FlushFileBuffers(handle as ptr) from "kernel32.dll" returns bool

Invokes the native FlushFileBuffers entry point used by the miniquake2 client downloads module.

ParameterTypeDefaultDescription
handleptr—Native or runtime handle used by the operation.

Returns: Native bool result produced by the call.

View source

GENERIC_WRITE

const GENERIC_WRITE = 1073741824

Defines the generic write constant used by the miniquake2 client downloads module.

View source

ignoreRegister

function ignoreRegister(kind, name)

Ignore register.

ParameterTypeDefaultDescription
kinddynamic—kind value consumed by this operation.
namedynamic—Name of the affected item.

View source

INVALID_HANDLE_VALUE

const INVALID_HANDLE_VALUE = -1

Defines the invalid handle value constant used by the miniquake2 client downloads module.

View source

INVALID_SET_FILE_POINTER

const INVALID_SET_FILE_POINTER = 4294967295

Defines the invalid set file pointer constant used by the miniquake2 client downloads module.

View source

MAX_DOWNLOAD_COMMANDS

const MAX_DOWNLOAD_COMMANDS = 16

Defines the max download commands constant used by the miniquake2 client downloads module.

View source

MAX_DOWNLOAD_FILE_BYTES

const MAX_DOWNLOAD_FILE_BYTES = 2147483647

Defines the max download file bytes constant used by the miniquake2 client downloads module.

View source

MAX_DOWNLOAD_MISSING

const MAX_DOWNLOAD_MISSING = 1024

Defines the max download missing constant used by the miniquake2 client downloads module.

View source

MAX_DOWNLOAD_REQUESTS

const MAX_DOWNLOAD_REQUESTS = 4096

Defines the max download requests constant used by the miniquake2 client downloads module.

View source

missingFiles

function missingFiles(manager)

Report whether missing files.

ParameterTypeDefaultDescription
managerdynamic—manager value consumed by this operation.

View source

noteMissing

function noteMissing(manager, name)

Report whether note missing.

ParameterTypeDefaultDescription
managerdynamic—manager value consumed by this operation.
namedynamic—Name of the affected item.

View source

OPEN_ALWAYS

const OPEN_ALWAYS = 4

Defines the open always constant used by the miniquake2 client downloads module.

View source

persistenceRoot

function persistenceRoot(manager, name)

Return the persistence root value.

ParameterTypeDefaultDescription
managerdynamic—manager value consumed by this operation.
namedynamic—Name of the affected item.

View source

persistentPath

function persistentPath(manager, name)

Return the persistent path.

ParameterTypeDefaultDescription
managerdynamic—manager value consumed by this operation.
namedynamic—Name of the affected item.

View source

playerIdentity

function playerIdentity(value)

Return the player identity value.

ParameterTypeDefaultDescription
valuedynamic—Value consumed or transformed by the operation.

View source

policyAllows

function policyAllows(policy, kind)

Report whether policy allows.

ParameterTypeDefaultDescription
policydynamic—policy value consumed by this operation.
kinddynamic—kind value consumed by this operation.

View source

queueCommand

function queueCommand(manager, command)

Queue command.

ParameterTypeDefaultDescription
managerdynamic—manager value consumed by this operation.
commanddynamic—command value consumed by this operation.

View source

requestFile

function requestFile(manager, kind, name, spawnCount)

Return the request file value.

ParameterTypeDefaultDescription
managerdynamic—manager value consumed by this operation.
kinddynamic—kind value consumed by this operation.
namedynamic—Name of the affected item.
spawnCountdynamic—Number of spawn to process.

View source

reset

function reset(manager)

Performs the reset operation for the miniquake2 client downloads module.

ParameterTypeDefaultDescription
managerdynamic—manager value consumed by this operation.

View source

SetFilePointer

extern function SetFilePointer(handle as ptr, distance as int, high as ptr, method as int) from "kernel32.dll" returns u32

Invokes the native SetFilePointer entry point used by the miniquake2 client downloads module.

ParameterTypeDefaultDescription
handleptr—Native or runtime handle used by the operation.
distanceint—distance value consumed by this operation.
highptr—high value consumed by this operation.
methodint—method value consumed by this operation.

Returns: Native u32 result produced by the call.

View source

setGameDirectory

function setGameDirectory(manager, gameDirectory)

Set game directory.

ParameterTypeDefaultDescription
managerdynamic—manager value consumed by this operation.
gameDirectorydynamic—gameDirectory value consumed by this operation.

View source

takeCommands

function takeCommands(manager)

Consume commands.

ParameterTypeDefaultDescription
managerdynamic—manager value consumed by this operation.

View source

temporaryPath

function temporaryPath(finalPath)

COM_StripExtension(downloadname) + ".tmp". Matching the retail temporary name preserves resume compatibility with interrupted original-client downloads while the final rename still occurs inside the same directory.

ParameterTypeDefaultDescription
finalPathdynamic—Path associated with final.

View source

textSlice

function textSlice(value, start, count)

Performs the textSlice operation for the miniquake2 client downloads module.

ParameterTypeDefaultDescription
valuedynamic—Value consumed or transformed by the operation.
startdynamic—start value consumed by this operation.
countdynamic—Number of items or units to process.

View source

validateGameDirectory

function validateGameDirectory(name)

Validate game directory.

ParameterTypeDefaultDescription
namedynamic—Name of the affected item.

View source

WriteFile

extern function WriteFile(handle as ptr, data as bytes, count as int, written as bytes, overlapped as ptr) from "kernel32.dll" returns bool

Invokes the native WriteFile entry point used by the miniquake2 client downloads module.

ParameterTypeDefaultDescription
handleptr—Native or runtime handle used by the operation.
databytes—Input data consumed by the operation.
countint—Number of items or units to process.
writtenbytes—written value consumed by this operation.
overlappedptr—overlapped value consumed by this operation.

Returns: Native bool result produced by the call.

View source