Files
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.
| Parameter | Type | Default | Description |
|---|
manager | dynamic | — | manager value consumed by this operation. |
data | dynamic | — | Input data consumed by the operation. |
percent | dynamic | — | percent value consumed by this operation. |
missing | dynamic | — | missing value consumed by this operation. |
View source
# addRequest
function addRequest(manager, kind, requestedName)
Add request.
| Parameter | Type | Default | Description |
|---|
manager | dynamic | — | manager value consumed by this operation. |
kind | dynamic | — | kind value consumed by this operation. |
requestedName | dynamic | — | requestedName value consumed by this operation. |
View source
# advance
function advance(manager)
Performs the advance operation for the miniquake2 client downloads module.
| Parameter | Type | Default | Description |
|---|
manager | dynamic | — | manager value consumed by this operation. |
View source
# appendChunk
function appendChunk(path, data)
Append chunk.
| Parameter | Type | Default | Description |
|---|
path | dynamic | — | Path of the file or directory used by the operation. |
data | dynamic | — | Input data consumed by the operation. |
View source
# beginPrecache
function beginPrecache(manager, configStrings, spawnCount)
Begin precache.
| Parameter | Type | Default | Description |
|---|
manager | dynamic | — | manager value consumed by this operation. |
configStrings | dynamic | — | configStrings value consumed by this operation. |
spawnCount | dynamic | — | Number of spawn to process. |
View source
# buildPrecachePlan
function buildPrecachePlan(manager, configStrings)
Build precache plan.
| Parameter | Type | Default | Description |
|---|
manager | dynamic | — | manager value consumed by this operation. |
configStrings | dynamic | — | configStrings value consumed by this operation. |
View source
# cancel
function cancel(manager)
Cancel state.
| Parameter | Type | Default | Description |
|---|
manager | dynamic | — | 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.
| Parameter | Type | Default | Description |
|---|
allow | dynamic | — | allow value consumed by this operation. |
maps | dynamic | — | maps value consumed by this operation. |
models | dynamic | — | models value consumed by this operation. |
players | dynamic | — | players value consumed by this operation. |
sounds | dynamic | — | 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.
| Parameter | Type | Default | Description |
|---|
handle | ptr | — | 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.
| Parameter | Type | Default | Description |
|---|
baseDirectory | dynamic | — | baseDirectory value consumed by this operation. |
gameDirectory | dynamic | — | gameDirectory value consumed by this operation. |
policy | dynamic | — | policy value consumed by this operation. |
fileExists | dynamic | — | fileExists value consumed by this operation. |
readFile | dynamic | — | readFile value consumed by this operation. |
registerAsset | dynamic | — | 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.
| Parameter | Type | Default | Description |
|---|
path | wstr | — | Path of the file or directory used by the operation. |
security | ptr | — | 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.
| Parameter | Type | Default | Description |
|---|
path | wstr | — | Path of the file or directory used by the operation. |
access | int | — | access value consumed by this operation. |
share | int | — | share value consumed by this operation. |
security | ptr | — | security value consumed by this operation. |
creation | int | — | creation value consumed by this operation. |
flags | int | — | Bit flags controlling the operation. |
template | ptr | — | 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.
| Parameter | Type | Default | Description |
|---|
manager | dynamic | — | manager value consumed by this operation. |
request | dynamic | — | 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.
| Parameter | Type | Default | Description |
|---|
path | dynamic | — | 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.
| Parameter | Type | Default | Description |
|---|
manager | dynamic | — | 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.
| Parameter | Type | Default | Description |
|---|
handle | ptr | — | 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.
| Parameter | Type | Default | Description |
|---|
kind | dynamic | — | kind value consumed by this operation. |
name | dynamic | — | 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.
| Parameter | Type | Default | Description |
|---|
manager | dynamic | — | manager value consumed by this operation. |
View source
# noteMissing
function noteMissing(manager, name)
Report whether note missing.
| Parameter | Type | Default | Description |
|---|
manager | dynamic | — | manager value consumed by this operation. |
name | dynamic | — | 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.
| Parameter | Type | Default | Description |
|---|
manager | dynamic | — | manager value consumed by this operation. |
name | dynamic | — | Name of the affected item. |
View source
# persistentPath
function persistentPath(manager, name)
Return the persistent path.
| Parameter | Type | Default | Description |
|---|
manager | dynamic | — | manager value consumed by this operation. |
name | dynamic | — | Name of the affected item. |
View source
# playerIdentity
function playerIdentity(value)
Return the player identity value.
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed or transformed by the operation. |
View source
# policyAllows
function policyAllows(policy, kind)
Report whether policy allows.
| Parameter | Type | Default | Description |
|---|
policy | dynamic | — | policy value consumed by this operation. |
kind | dynamic | — | kind value consumed by this operation. |
View source
# queueCommand
function queueCommand(manager, command)
Queue command.
| Parameter | Type | Default | Description |
|---|
manager | dynamic | — | manager value consumed by this operation. |
command | dynamic | — | command value consumed by this operation. |
View source
# requestFile
function requestFile(manager, kind, name, spawnCount)
Return the request file value.
| Parameter | Type | Default | Description |
|---|
manager | dynamic | — | manager value consumed by this operation. |
kind | dynamic | — | kind value consumed by this operation. |
name | dynamic | — | Name of the affected item. |
spawnCount | dynamic | — | Number of spawn to process. |
View source
# reset
function reset(manager)
Performs the reset operation for the miniquake2 client downloads module.
| Parameter | Type | Default | Description |
|---|
manager | dynamic | — | 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.
| Parameter | Type | Default | Description |
|---|
handle | ptr | — | Native or runtime handle used by the operation. |
distance | int | — | distance value consumed by this operation. |
high | ptr | — | high value consumed by this operation. |
method | int | — | method value consumed by this operation. |
Returns: Native u32 result produced by the call.
View source
# setGameDirectory
function setGameDirectory(manager, gameDirectory)
Set game directory.
| Parameter | Type | Default | Description |
|---|
manager | dynamic | — | manager value consumed by this operation. |
gameDirectory | dynamic | — | gameDirectory value consumed by this operation. |
View source
# takeCommands
function takeCommands(manager)
Consume commands.
| Parameter | Type | Default | Description |
|---|
manager | dynamic | — | 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.
| Parameter | Type | Default | Description |
|---|
finalPath | dynamic | — | Path associated with final. |
View source
# textSlice
function textSlice(value, start, count)
Performs the textSlice operation for the miniquake2 client downloads module.
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed or transformed by the operation. |
start | dynamic | — | start value consumed by this operation. |
count | dynamic | — | Number of items or units to process. |
View source
# validateGameDirectory
function validateGameDirectory(name)
Validate game directory.
| Parameter | Type | Default | Description |
|---|
name | dynamic | — | 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.
| Parameter | Type | Default | Description |
|---|
handle | ptr | — | Native or runtime handle used by the operation. |
data | bytes | — | Input data consumed by the operation. |
count | int | — | Number of items or units to process. |
written | bytes | — | written value consumed by this operation. |
overlapped | ptr | — | overlapped value consumed by this operation. |
Returns: Native bool result produced by the call.
View source