Files
src/miniquake2/server/game_bridge.ml
Provides miniquake2 server game bridge facilities for this project.
- Package
miniquake2.server.game_bridge- Reachable
- Yes
Imports
Declarations
# activateRuntime
function activateRuntime(context)
Listen-client prediction shares the exact live collision bridge with the authoritative server. Explicit activation prevents a second test/listen session from leaving the module-global callback context on the wrong map.
| Parameter | Type | Default | Description |
|---|
context | dynamic | — | Context that carries state for the operation. |
View source
# activeRuntime
function activeRuntime()
Return the optional active bridge for Game API-only lifecycle adapters.
View source
# adaptCollisionTrace
function adaptCollisionTrace(context, result)
Trace adapt collision.
| Parameter | Type | Default | Description |
|---|
context | dynamic | — | Context that carries state for the operation. |
result | dynamic | — | Result object populated or inspected by the operation. |
View source
# adaptCollisionTraceWithEntity
function adaptCollisionTraceWithEntity(context, result, hitEntity)
Trace adapt collision with entity.
| Parameter | Type | Default | Description |
|---|
context | dynamic | — | Context that carries state for the operation. |
result | dynamic | — | Result object populated or inspected by the operation. |
hitEntity | dynamic | — | hitEntity value consumed by this operation. |
View source
# addCommandString
function addCommandString(value)
Add command string.
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed or transformed by the operation. |
View source
# appendLog
function appendLog(level, value)
Append log.
| Parameter | Type | Default | Description |
|---|
level | dynamic | — | level value consumed by this operation. |
value | dynamic | — | Value consumed or transformed by the operation. |
View source
# areasConnected
function areasConnected(first, second)
Report whether areas connected.
| Parameter | Type | Default | Description |
|---|
first | dynamic | — | first value consumed by this operation. |
second | dynamic | — | second value consumed by this operation. |
View source
# argc
function argc()
Return the argc value.
View source
# args
function args()
Return the args value.
View source
# argv
function argv(index)
Return the argv value.
| Parameter | Type | Default | Description |
|---|
index | dynamic | — | Zero-based index of the affected item. |
View source
# boxEdicts
function boxEdicts(mins, maxs, areaType)
Return the box edicts value.
| Parameter | Type | Default | Description |
|---|
mins | dynamic | — | mins value consumed by this operation. |
maxs | dynamic | — | maxs value consumed by this operation. |
areaType | dynamic | — | areaType value consumed by this operation. |
View source
# bprintf
function bprintf(value)
Return the bprintf value.
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed or transformed by the operation. |
View source
# bridgeImageIndex
function bridgeImageIndex(name)
Return the bridge image index.
| Parameter | Type | Default | Description |
|---|
name | dynamic | — | Name of the affected item. |
View source
# bridgeModelIndex
function bridgeModelIndex(name)
Return the bridge model index.
| Parameter | Type | Default | Description |
|---|
name | dynamic | — | Name of the affected item. |
View source
# bridgeSoundIndex
function bridgeSoundIndex(name)
Return the bridge sound index.
| Parameter | Type | Default | Description |
|---|
name | dynamic | — | Name of the affected item. |
View source
# centerprintf
function centerprintf(entity, value)
Return the centerprintf value.
| Parameter | Type | Default | Description |
|---|
entity | dynamic | — | entity value consumed by this operation. |
value | dynamic | — | Value consumed or transformed by the operation. |
View source
# clearSpatialCaches
function clearSpatialCaches(context)
Discard every level-owned spatial index in one atomic replacement. Counts alone are insufficient: the reverse-position tables would make a reused edict number appear to be an old map's brush, trigger or box entity.
| Parameter | Type | Default | Description |
|---|
context | dynamic | — | Context that carries state for the operation. |
View source
# collectLinkedEntityVisibility
function collectLinkedEntityVisibility(context, nodeNumber, mins, maxs, entity)
SV_LinkEdict records every distinct PVS cluster touched by the complete linked bounds, not merely the leaf containing s.origin. Inline BSP origins commonly lie in solid or on the far side of an area boundary, so a point lookup makes doors, plats and buttons disappear even while their geometry is visible. Fold cluster collection into the existing allocation-free BSP traversal. MAX_ENT_CLUSTERS overflow retains Quake II's -1 sentinel; the per-client snapshot path then tests all leaves covered by the cached bounds.
| Parameter | Type | Default | Description |
|---|
context | dynamic | — | Context that carries state for the operation. |
nodeNumber | dynamic | — | nodeNumber value consumed by this operation. |
mins | dynamic | — | mins value consumed by this operation. |
maxs | dynamic | — | maxs value consumed by this operation. |
entity | dynamic | — | entity value consumed by this operation. |
View source
# collisionWorldReady
function collisionWorldReady()
Report whether collision world ready.
View source
# configString
function configString(index, value)
Return the config string value.
| Parameter | Type | Default | Description |
|---|
index | dynamic | — | Zero-based index of the affected item. |
value | dynamic | — | Value consumed or transformed by the operation. |
View source
# cprintf
function cprintf(entity, level, value)
Return the cprintf value.
| Parameter | Type | Default | Description |
|---|
entity | dynamic | — | entity value consumed by this operation. |
level | dynamic | — | level value consumed by this operation. |
value | dynamic | — | Value consumed or transformed by the operation. |
View source
# createRuntime
function createRuntime(maxClients)
Create runtime.
| Parameter | Type | Default | Description |
|---|
maxClients | dynamic | — | maxClients value consumed by this operation. |
View source
# debugGraph
function debugGraph(value, color)
Return the debug graph value.
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed or transformed by the operation. |
color | dynamic | — | color value consumed by this operation. |
View source
# dprintf
function dprintf(value)
Return the dprintf value.
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed or transformed by the operation. |
View source
# emptyBridgeTrace
function emptyBridgeTrace(finish)
Report whether empty bridge trace.
| Parameter | Type | Default | Description |
|---|
finish | dynamic | — | finish value consumed by this operation. |
View source
# fail
function fail(value)
Return the fail value.
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed or transformed by the operation. |
View source
# findIndex
function findIndex(values, name, create)
Find index.
| Parameter | Type | Default | Description |
|---|
values | dynamic | — | values value consumed by this operation. |
name | dynamic | — | Name of the affected item. |
create | dynamic | — | create value consumed by this operation. |
View source
# freeTags
function freeTags(tag)
Release tags.
| Parameter | Type | Default | Description |
|---|
tag | dynamic | — | tag value consumed by this operation. |
View source
# gameBridgeActiveRuntime
gameBridgeActiveRuntime
Stores module-wide game bridge active runtime state for the miniquake2 server game bridge module.
View source
# gameBridgeAppendLog
function gameBridgeAppendLog(context, value)
Append game bridge log.
| Parameter | Type | Default | Description |
|---|
context | dynamic | — | Context that carries state for the operation. |
value | dynamic | — | Value consumed or transformed by the operation. |
View source
# gameCvar
function gameCvar(name, value, flags)
Return the game cvar value.
| Parameter | Type | Default | Description |
|---|
name | dynamic | — | Name of the affected item. |
value | dynamic | — | Value consumed or transformed by the operation. |
flags | dynamic | — | Bit flags controlling the operation. |
View source
# gameCvarForceSet
function gameCvarForceSet(name, value)
Set game cvar force.
| Parameter | Type | Default | Description |
|---|
name | dynamic | — | Name of the affected item. |
value | dynamic | — | Value consumed or transformed by the operation. |
View source
# gameCvarSet
function gameCvarSet(name, value)
Set game cvar.
| Parameter | Type | Default | Description |
|---|
name | dynamic | — | Name of the affected item. |
value | dynamic | — | Value consumed or transformed by the operation. |
View source
# inlineBrushCacheIndex
function inlineBrushCacheIndex(context, entity)
Cache inline brush index.
| Parameter | Type | Default | Description |
|---|
context | dynamic | — | Context that carries state for the operation. |
entity | dynamic | — | entity value consumed by this operation. |
View source
# inlineModelNumber
function inlineModelNumber(name)
Return the inline model number.
| Parameter | Type | Default | Description |
|---|
name | dynamic | — | Name of the affected item. |
View source
# inPHS
function inPHS(first, second)
Return the in phs value.
| Parameter | Type | Default | Description |
|---|
first | dynamic | — | first value consumed by this operation. |
second | dynamic | — | second value consumed by this operation. |
View source
# inPVS
function inPVS(first, second)
Return the in pvs value.
| Parameter | Type | Default | Description |
|---|
first | dynamic | — | first value consumed by this operation. |
second | dynamic | — | second value consumed by this operation. |
View source
# linkEntity
function linkEntity(entity)
Link entity.
| Parameter | Type | Default | Description |
|---|
entity | dynamic | — | entity value consumed by this operation. |
View source
# makeImports
function makeImports(context)
Create imports.
| Parameter | Type | Default | Description |
|---|
context | dynamic | — | Context that carries state for the operation. |
View source
# MAX_GAME_BRIDGE_LOGS
const MAX_GAME_BRIDGE_LOGS = 1024
Defines the max game bridge logs constant used by the miniquake2 server game bridge module.
View source
# multicast
function multicast(origin, destination)
Return the multicast value.
| Parameter | Type | Default | Description |
|---|
origin | dynamic | — | origin value consumed by this operation. |
destination | dynamic | — | destination value consumed by this operation. |
View source
# pmove
function pmove(value)
Return the pmove value.
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed or transformed by the operation. |
View source
# pointContents
function pointContents(point)
Performs the pointContents operation for the miniquake2 server game bridge module.
| Parameter | Type | Default | Description |
|---|
point | dynamic | — | point value consumed by this operation. |
View source
# positionedSound
function positionedSound(origin, entity, channel, soundIndex, volume, attenuation, timeOffset)
Return the positioned sound value.
| Parameter | Type | Default | Description |
|---|
origin | dynamic | — | origin value consumed by this operation. |
entity | dynamic | — | entity value consumed by this operation. |
channel | dynamic | — | channel value consumed by this operation. |
soundIndex | dynamic | — | Zero-based index of sound. |
volume | dynamic | — | volume value consumed by this operation. |
attenuation | dynamic | — | attenuation value consumed by this operation. |
timeOffset | dynamic | — | timeOffset value consumed by this operation. |
View source
# rebuildSpatialCaches
function rebuildSpatialCaches(context, edicts, count)
Rebuild the compact spatial sets from the authoritative exported edicts. Save restore replaces that whole array, so retaining any previous references would create phantom collisions or touches after the load.
| Parameter | Type | Default | Description |
|---|
context | dynamic | — | Context that carries state for the operation. |
edicts | dynamic | — | edicts value consumed by this operation. |
count | dynamic | — | Number of items or units to process. |
View source
# requireActive
function requireActive(operation)
Report whether require active.
| Parameter | Type | Default | Description |
|---|
operation | dynamic | — | operation value consumed by this operation. |
View source
# sameTraceEntity
function sameTraceEntity(first, second)
Trace same entity.
| Parameter | Type | Default | Description |
|---|
first | dynamic | — | first value consumed by this operation. |
second | dynamic | — | second value consumed by this operation. |
View source
# setAreaPortalState
function setAreaPortalState(portalNumber, isOpen)
Set area portal state.
| Parameter | Type | Default | Description |
|---|
portalNumber | dynamic | — | portalNumber value consumed by this operation. |
isOpen | dynamic | — | isOpen value consumed by this operation. |
View source
# setModel
function setModel(entity, name)
Set model.
| Parameter | Type | Default | Description |
|---|
entity | dynamic | — | entity value consumed by this operation. |
name | dynamic | — | Name of the affected item. |
View source
# solidBoxCacheIndex
function solidBoxCacheIndex(context, entity)
Cache solid box index.
| Parameter | Type | Default | Description |
|---|
context | dynamic | — | Context that carries state for the operation. |
entity | dynamic | — | entity value consumed by this operation. |
View source
# solidBoxTrace
function solidBoxTrace(start, mins, maxs, finish, entity)
CM_HeadnodeForBox + CM_TransformedBoxTrace for a linked SOLID_BBOX. The original collision model implements this as a temporary BSP hull; scalar Minkowski slabs are identical and avoid rebuilding or allocating that hull in every authoritative Pmove trace.
| Parameter | Type | Default | Description |
|---|
start | dynamic | — | start value consumed by this operation. |
mins | dynamic | — | mins value consumed by this operation. |
maxs | dynamic | — | maxs value consumed by this operation. |
finish | dynamic | — | finish value consumed by this operation. |
entity | dynamic | — | entity value consumed by this operation. |
View source
# sound
function sound(entity, channel, soundIndex, volume, attenuation, timeOffset)
Return the sound value.
| Parameter | Type | Default | Description |
|---|
entity | dynamic | — | entity value consumed by this operation. |
channel | dynamic | — | channel value consumed by this operation. |
soundIndex | dynamic | — | Zero-based index of sound. |
volume | dynamic | — | volume value consumed by this operation. |
attenuation | dynamic | — | attenuation value consumed by this operation. |
timeOffset | dynamic | — | timeOffset value consumed by this operation. |
View source
# tagFree
function tagFree(value)
Release tag.
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed or transformed by the operation. |
View source
# tagMalloc
function tagMalloc(size, tag)
Return the tag malloc value.
| Parameter | Type | Default | Description |
|---|
size | dynamic | — | Size in the units required by the operation. |
tag | dynamic | — | tag value consumed by this operation. |
View source
# trace
function trace(start, mins, maxs, finish, passEntity, contentMask)
Trace state.
| Parameter | Type | Default | Description |
|---|
start | dynamic | — | start value consumed by this operation. |
mins | dynamic | — | mins value consumed by this operation. |
maxs | dynamic | — | maxs value consumed by this operation. |
finish | dynamic | — | finish value consumed by this operation. |
passEntity | dynamic | — | passEntity value consumed by this operation. |
contentMask | dynamic | — | contentMask value consumed by this operation. |
View source
# traceDot
function traceDot(first, second)
Trace dot.
| Parameter | Type | Default | Description |
|---|
first | dynamic | — | first value consumed by this operation. |
second | dynamic | — | second value consumed by this operation. |
View source
# traceEntityExcluded
function traceEntityExcluded(entity, passEntity, contentMask)
Trace entity excluded.
| Parameter | Type | Default | Description |
|---|
entity | dynamic | — | entity value consumed by this operation. |
passEntity | dynamic | — | passEntity value consumed by this operation. |
contentMask | dynamic | — | contentMask value consumed by this operation. |
View source
# traceNormalToWorld
function traceNormalToWorld(normal, basis)
Trace normal to world.
| Parameter | Type | Default | Description |
|---|
normal | dynamic | — | normal value consumed by this operation. |
basis | dynamic | — | basis value consumed by this operation. |
View source
# traceToModel
function traceToModel(point, origin, basis)
Trace to model.
| Parameter | Type | Default | Description |
|---|
point | dynamic | — | point value consumed by this operation. |
origin | dynamic | — | origin value consumed by this operation. |
basis | dynamic | — | basis value consumed by this operation. |
View source
# transformedEntityBounds
function transformedEntityBounds(entity)
Return the transformed entity bounds.
| Parameter | Type | Default | Description |
|---|
entity | dynamic | — | entity value consumed by this operation. |
View source
# triggerCacheIndex
function triggerCacheIndex(context, entity)
Cache trigger index.
| Parameter | Type | Default | Description |
|---|
context | dynamic | — | Context that carries state for the operation. |
entity | dynamic | — | entity value consumed by this operation. |
View source
# unicast
function unicast(entity, reliable)
Return the unicast value.
| Parameter | Type | Default | Description |
|---|
entity | dynamic | — | entity value consumed by this operation. |
reliable | dynamic | — | reliable value consumed by this operation. |
View source
# unlinkEntity
function unlinkEntity(entity)
Return the unlink entity value.
| Parameter | Type | Default | Description |
|---|
entity | dynamic | — | entity value consumed by this operation. |
View source
# updateInlineBrushCache
function updateInlineBrushCache(context, entity, linked)
SV_ClipMoveToEntities previously scanned every allocated edict for every Pmove trace. Maintain the tiny linked inline-brush set instead; retail maps typically reduce this hot loop from hundreds of entries to a few doors.
| Parameter | Type | Default | Description |
|---|
context | dynamic | — | Context that carries state for the operation. |
entity | dynamic | — | entity value consumed by this operation. |
linked | dynamic | — | linked value consumed by this operation. |
View source
# updateSolidBoxCache
function updateSolidBoxCache(context, entity, linked)
AREA_SOLID is a spatial linked list in BaseQ2. Keep the dynamic BBOX subset as an allocation-free indexed set so the authoritative PMove hot path visits only currently linked players, monsters and other box solids.
| Parameter | Type | Default | Description |
|---|
context | dynamic | — | Context that carries state for the operation. |
entity | dynamic | — | entity value consumed by this operation. |
linked | dynamic | — | linked value consumed by this operation. |
View source
# updateTriggerCache
function updateTriggerCache(context, entity, linked)
AREA_TRIGGERS is a linked spatial set in the original server. Keep an allocation-free indexed set here as well so each walking monster does not rescan every retail-map edict merely to touch nearby triggers.
| Parameter | Type | Default | Description |
|---|
context | dynamic | — | Context that carries state for the operation. |
entity | dynamic | — | entity value consumed by this operation. |
linked | dynamic | — | linked value consumed by this operation. |
View source
# writeAngle
function writeAngle(value)
Write angle.
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed or transformed by the operation. |
View source
# writeByte
function writeByte(value)
Write byte.
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed or transformed by the operation. |
View source
# writeChar
function writeChar(value)
Write char.
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed or transformed by the operation. |
View source
# writeDirection
function writeDirection(value)
Write direction.
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed or transformed by the operation. |
View source
# writeFloat
function writeFloat(value)
Write float.
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed or transformed by the operation. |
View source
# writeLong
function writeLong(value)
Write long.
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed or transformed by the operation. |
View source
# writePosition
function writePosition(value)
Write position.
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed or transformed by the operation. |
View source
# writeShort
function writeShort(value)
Write short.
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed or transformed by the operation. |
View source
# writeString
function writeString(value)
Write string.
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed or transformed by the operation. |
View source