-
Notifications
You must be signed in to change notification settings - Fork 0
AntiStack Database Extension Audit
This page is the canonical source-backed map for AntiStack skill balancing and its out-of-repo A2WaspDatabase extension dependency. Use Integration trust boundary audit for the cross-integration security overview; use this page before changing AntiStack loops, join checks, score persistence or database wrappers.
AntiStack is both gameplay logic and server operations glue:
- It can deny a first side join when a player tries to join the stronger side.
- It periodically stores player score deltas.
- It periodically sends active player/team lists to the database.
- It can grant side-supply compensation when total team skill diverges.
- It persists score diffs on disconnect and at match end.
The current source has an operational ON/OFF switch, which is good. But when AntiStack is enabled, all DB wrapper paths still trust strings returned by a separate A2WaspDatabase extension that is not shipped in this repo.
| Part | Source evidence | Meaning |
|---|---|---|
| Compile registry | Server/Init/Init_Server.sqf:72-80,85-87 |
AntiStack wrappers, scoring helpers and the launch PVEH are compiled during server init. |
| Mission parameter |
Rsc/Parameters.hpp:546-552, fallback Common/Init/Init_CommonConstants.sqf:170-171
|
WFBE_C_ANTISTACK_ENABLED defaults to enabled, with a constants fallback for older parameter sets. |
| Loop start gate | Server/Init/Init_Server.sqf:597-608 |
Server logs enabled/disabled state, records antistack_state if performance audit exists, and starts scheduled AntiStack loops only when enabled. |
| Disabled-mode join behavior | Server/PVFunctions/RequestJoin.sqf:49-53 |
Team-swap protection remains active, but first-join skill DB checks are skipped when AntiStack is disabled. |
| Disabled-mode persistence behavior |
Server/Functions/Server_OnPlayerDisconnected.sqf:151-153, Server/FSM/server_victory_threeway.sqf:51-53
|
Disconnect and final-score DB persistence are skipped when AntiStack is disabled, avoiding false missing-score errors. |
| Enabled-mode DB dependency | Server/Module/AntiStack/callDatabase*.sqf |
All database work relies on "A2WaspDatabase" callExtension return strings. The DLL is not in the repo. |
AntiStack and join persistence mostly use durable UIDs, but several lifecycle helpers also depend on object, group and owner identity. Keep these distinctions visible when hardening reconnect, launch-join or skill-balance behavior.
| Key | Source evidence | Meaning / risk |
|---|---|---|
| UID |
Server_OnPlayerConnected.sqf:9,27,42,65,70,79,93,101; Server_OnPlayerDisconnected.sqf:39,48,125,128,129,133,157,164,170,174,175; AntiStack/mainLoop.sqf:28,32,36,40; AntiStack/flushLoop.sqf:32,34,36,39
|
Primary durable identity for JIP records, disconnect persistence and database score/list work. |
| Player name |
Server_OnPlayerConnected.sqf:10,16; Server_OnPlayerDisconnected.sqf:10,20
|
Used for logs only in the audited server paths; do not promote names into authority keys. |
| Group / player object |
Server_OnPlayerConnected.sqf:23,27,45,56,64-66; Server_OnPlayerDisconnected.sqf:32,34,45,48,57,68,79,93,102,117,125,128,129; Server_HandleSpecial.sqf:11,29,138,141,144
|
Owns team state and cleanup side effects. Fast reconnects can overlap stale disconnect cleanup unless UID/object checks are repeated before clearing state. |
| Network owner |
clientHasConnectedAtLaunch.sqf:4,15; Server_PV_RequestSupplyValue.sqf:4,8; Server_SetLocalityOwner.sqf:10,13; Server_HandleSpecial.sqf:120,123,127,130
|
Used for targeted responses and locality changes. Validate payload object ownership where the engine exposes enough context. |
| Profile name | Source search found no profileName use in the scoped server lifecycle paths. |
Good: profile names are mutable and should stay out of authority decisions. |
flowchart TD
Init["Init_Server.sqf"] -->|"compiles wrappers"| Wrappers["callDatabase*.sqf"]
Init -->|"if enabled"| Count["countPlayerScores.sqf"]
Count --> Main["mainLoop.sqf score flush"]
Count --> Update["updateScoreInternal.sqf score sampling"]
Count --> Flush["flushLoop.sqf player-list send"]
Init --> JoinMonitor["monitorTeamToJoin.sqf"]
Init --> Comp["skillDiffCompensation.sqf"]
RequestJoin["RequestJoin.sqf first join"] --> GetTeam["getTeamScore.sqf"]
GetTeam --> SideSkill["callDatabaseRequestSideTotalSkill.sqf"]
Main --> Retrieve["callDatabaseRetrieve.sqf"]
Main --> Store["callDatabaseStore.sqf"]
Flush --> SendList["callDatabaseSendPlayerList.sqf"]
Comp --> SideSkill
Disconnect["Server_OnPlayerDisconnected.sqf"] --> Store
Disconnect --> StoreSide["callDatabaseStoreSide.sqf"]
Victory["server_victory_threeway.sqf"] --> Store
Victory --> FlushList["callDatabaseFlushPlayerList.sqf"]
Wrappers -->|"A2WaspDatabase callExtension"| DLL["A2WaspDatabase extension absent from repo"]
| Wrapper | Procedure code(s) | Return use | Current guard | Remaining risk |
|---|---|---|---|---|
callDatabaseRetrieve.sqf |
101, poll 505
|
Compiles request id, selects index 1, polls up to 120 attempts, then expects [code,totalScore,ticks]. |
Disabled mode returns [0,1]; timeout fallback returns [1,1]. |
Enabled mode compiles untrusted strings twice and assumes array shape at :30,39-51,62-63. With default _sleep = 0.10, retrieve can poll for about 12 seconds per player. |
callDatabaseRequestSideTotalSkill.sqf |
606, poll 707
|
Compiles request id, polls up to 9 attempts with _sleep = 3, then selects total skill. |
Disabled mode returns 0; timeout fallback returns [1,1] even though callers expect scalar skill. |
Enabled mode compiles untrusted strings twice and can block about 27 seconds per side-skill request. Timeout return-shape mismatch can leak an array into skill math. |
callDatabaseStore.sqf |
202 |
Compiles response and selects response code. | Disabled mode returns 1. |
Enabled mode compiles returned string and assumes index 0 exists. |
callDatabaseStoreSide.sqf |
404 |
Converts side to 0/1/2, compiles response, selects response code. |
Disabled mode returns 1. |
Enabled mode compiles returned string and assumes index 0 exists. |
callDatabaseSendPlayerList.sqf |
303 |
Formats GUID/side list, compiles response, selects response code. | Disabled mode returns 1. |
Enabled mode compiles returned string and assumes index 0 exists; parameter string grows with players. |
callDatabaseFlushPlayerList.sqf |
808 |
Compiles response and selects response code. | Disabled mode returns 1. |
Enabled mode compiles returned string and assumes index 0 exists. |
callDatabaseSetMap.sqf |
909 |
Compiles response and selects response code. | Disabled mode returns 1. |
Enabled mode compiles returned string and assumes index 0 exists. |
| Guard | Source evidence | Keep it? |
|---|---|---|
| ON/OFF parameter and fallback |
Rsc/Parameters.hpp:546-552, Common/Init/Init_CommonConstants.sqf:170-171
|
Yes. It gives admins a controlled performance/reliability switch. |
| Loop start disabled gate | Server/Init/Init_Server.sqf:597-608 |
Yes. Scheduled loops should stay dormant when disabled. |
| Direct loop guards |
countPlayerScores.sqf:3-5, mainLoop.sqf:8-10, flushLoop.sqf:10-12, updateScoreInternal.sqf:8-10, skillDiffCompensation.sqf:3-5
|
Yes. These protect against direct execVM or stale calls. |
| Wrapper disabled no-ops | Seven callDatabase*.sqf files each check WFBE_C_ANTISTACK_ENABLED near the top. |
Yes, but keep return shapes aligned with caller expectations. |
| Team-swap remains active when AntiStack disabled | RequestJoin.sqf:49-53 |
Yes. Do not accidentally turn off team-swap protection while disabling skill balancing. |
| Final/disconnect DB skip when disabled |
Server_OnPlayerDisconnected.sqf:151-153, server_victory_threeway.sqf:51-53
|
Yes. Score sampling is not running when disabled, so DB persistence would be misleading. |
| Priority | Work | Patch shape |
|---|---|---|
| P1 | Replace raw call compile return handling with a small parser/validator wrapper. |
Centralize DB response handling in one SQF helper that checks non-empty string, expected array form, expected count, scalar response code and scalar/string payload types before returning a safe fallback. Do not use Arma 3-only parseSimpleArray. |
| P1 | Add missing/slow extension circuit breaker. | After repeated malformed or timeout responses, set a missionNamespace degraded flag, log once per interval and fall back to disabled-mode behavior for join skill checks and compensation while keeping team-swap protection. |
| P1 | Fix timeout return-shape mismatch in callDatabaseRequestSideTotalSkill.sqf. |
If callers expect scalar skill, timeout fallback should be scalar 0 or the caller should explicitly handle array fallback. Do not feed [1,1] into skill-difference math. |
| P2 | Bound player-list payload size and validate GUID/side entries. | Keep only known player UIDs and west/east side codes; log skipped malformed entries. |
| P2 | Validate launch-connect raw PV payloads. |
clientHasConnectedAtLaunch.sqf records a client-pushed player object and owner-targets an ACK. Confirm the object/UID/side match the sender before storing WFBE_PLAYER_%UID_CONNECTED_AT_LAUNCH. |
| P2 | Check and retry disconnect database persistence. |
Server_OnPlayerDisconnected.sqf:151-176 calls store-side and store-score paths but does not act on return codes. Log failures and consider one bounded retry before clearing durable state. |
| P2 | Replace stale all-units snapshots in skill balancing. |
flushLoop.sqf and score-monitor helpers can operate on stale allUnits/fallback snapshots. Prefer confirmed session records keyed by UID where practical. |
| P2 | Add performance audit fields for DB degraded state. | Existing antistack_main, antistack_flush, antistack_update_score and antistack_state records are good anchors; add malformed/timeout counters if hardening is implemented. |
- Keep gameplay edits in
Missions/[55-2hc]warfarev2_073v48co.chernarusfirst. - Do not hand-edit
Missions_Vanillauntil LoadoutManager propagation runs from a correctly nameda2waspwarfarecheckout. - Do not assume the in-repo
Extensionproject implements AntiStack. It implementsa2waspwarfare_Extension/GLOBALGAMESTATS; AntiStack uses separateA2WaspDatabase. - Do not replace
call compilewith Arma 3 APIs. This mission targets Arma 2 OA 1.64. - Treat disabled AntiStack as a supported operating mode, not a failed state.
- Preserve team-swap protection when disabling or degrading only the skill-balancing database path.
| Scenario | Expected result |
|---|---|
| AntiStack disabled at mission parameter | Server logs disabled state, scheduled loops do not start, first join skips skill DB checks, team-swap protection still works, disconnect/victory DB persistence is skipped cleanly. |
| AntiStack enabled with valid DB extension | First join retrieves side skill, allowed/denied logic still works, score sampling/storage and player-list flush produce no RPT errors. |
| DB extension missing or returns empty/malformed string | No raw compile crash, one clear degraded-state log, join skill check falls back safely, team-swap protection remains active. |
| DB response delayed beyond poll attempts | Retrieve/side-skill paths time out to documented safe scalar/array shapes and do not poison compensation math. |
| Skill compensation active |
SUPPLY_COMPENSATION_AMOUNT_WEST/EAST updates, side supply changes are bounded by the economy authority rules, and RHUD shows compensation without client-side authority assumptions. |
| Match end with AntiStack enabled | Final score store and player-list flush run or degrade gracefully before failMission "END1". |
| Launch-side spoof attempt | A client-pushed launch-connect player object that does not match sender/UID/side is ignored and logged compactly. |
| Disconnect DB write failure | Store-side and score-diff failures are visible in RPT/performance state and do not silently masquerade as successful persistence. |
Previous: Integration trust boundary audit | Next: Feature status
Main map: Home | Runtime: Server gameplay runtime atlas | Agent file: agent-hardening-backlog.jsonl
Home | Agent Guide | Current live state | Release 1.2.2 (B91) | Quickstart | Progress | Lifecycle wait-chain | Join/disconnect | Parameters/build | Assets/config | SQF atlas | PV index | Modules | Support/specials | Commander/HQ | Commander vote/reassign | Construction/CoIn | Construction cleanup | WDDM compositions | Factory/purchase | Upgrades/research | Towns/camps/capture | Victory/endgame | Markers/cleanup | Server runtime | AI runtime/HC | AI commander audit | HC delegation | Town AI safety | Commander reassignment | Resistance supply | Player UI workflow | UI atlas | Respawn/death | Gear template filter | Vehicle cargo loop | Service guards | UI IDD repair | UI design inspiration | WASP overlay | Feature status | Source propagation | release readiness | Tooling readiness | Integration trust | AntiStack DB | Owner decisions | Shelved registry | Abandoned feature revival | Hardening roadmap | PVF dispatch | Server authority | ICBM authority | Attack-wave authority | Telemetry families | AICOM V2 cutover | Consumer port map | Testing workflow | Server ops | Web tools | Ecosystem repos | Arma 2 OA refs | A2 traps | OA compatibility audit | Coverage ledger | Navigation inventory | Pruning ledger | Knowledge roadmap | Agent context | Collab protocol | Worklog | Audit archive 2026-07 | Briefing reference | Utes invasion concept
- Shelved AICOM concepts - revivable someday ideas (owner-shelved 2026-07-03)
Docs rule: source-backed claims only; Arma 2 OA scripting docs only; gameplay edits start in Missions/[55-2hc]warfarev2_073v48co.chernarus.
- Getting started
- Status and coordination
- Agent context
- Agent collaboration protocol
- Agent worklog
- Agent worklog archive
- Progress dashboard
- PR cleanup and integration lab
- Shelved PR #169: gear price double-count
- Shelved PR #194: Chernarus no-trees
- Coordination board
- Codebase coverage ledger
- Bottleneck removal queue
- Current source status
- Wiki mirror reconciliation
- Navigation inventory
- Registers
- Agent orchestration
- Architecture
- Architecture overview
- Mission entrypoints and lifecycle
- Lifecycle wait chain
- Player join/disconnect and AntiStack lifecycle
- Mission parameters/localization/build inputs
- Stringtable localization key-family catalog
- Source inventory
- Content structure and maps
- Assets/config/localization/parameters
- Mission start parameters index
- Code and networking
- Gameplay systems
- Core systems index
- Gameplay systems atlas
- Commander/HQ lifecycle atlas
- Economy, towns and supply
- Economy system reference
- Balance asymmetries
- Anti-stack skill-balance mechanic
- Empty-side supply income stagnation
- Towns, camps and capture atlas
- Victory and endgame atlas
- Victory conditions reference
- Territorial victory reference
- Marker cleanup and restoration
- Marker loop engine and registries
- Map marker families content catalog
- Marker subsystem function reference
- Client marker FSM updater map
- Support specials and tactical modules
- SCUD TEL tactical munitions
- Naval HVT objectives (carriers/SCUD)
- SCUD saturation strike mechanic
- Takistan airfield FPV drone design
- Construction and CoIn systems
- Structure damage reduction & friendly-fire
- Construction logic list cleanup
- Flak tower & WDDM anchor compositions
- Resistance supply scaffold
- GUER Insurgents faction overview
- GUER Insurgents branch audit
- GUER insurgent player economy
- GUER air-defense loop (Ka-137/Mi-24)
- Upgrades and research atlas
- Supply mission architecture
- Supply mission authority cleanup
- Current supply helicopters PR1
- Respawn and death-loop lifecycle
- Vehicle theft economy pitch
- GUER tunnel network pitch
- Content, reference and catalogs
- Faction unit/vehicle roster catalog
- Auxiliary/SF/civilian unit catalog
- Gear store loadout route catalog
- Upgrade research (cross-faction)
- Gear store price and upgrade catalog
- Gear store catalog (complete, per faction)
- Defense structures catalog
- Artillery reference per faction
- AI squad team templates catalog
- Town AI lifecycle reference
- Town AI group composition catalog
- Class-skill system reference
- Player skill abilities reference
- Default gear template content catalog
- Chernarus map content reference
- Takistan map content reference
- Takistan features
- Takistan parity reference
- Takistan oilfields objective reference
- IRS IR-smoke countermeasure
- Arty module special munitions
- Zeta cargo sling-load reference
- Spawn primitive function reference
- Kill and score pipeline
- Waypoint helper function reference
- Position and proximity function reference
- Side/team state function reference
- Player AI watchdog and recovery
- AICOM stuck-recovery v2
- LoadoutManager data-model contributor guide
- Discord status bot setup and reference
- GLOBALGAMESTATS extension reference
- New player quickstart (player guide)
- Optional client mods (player guide)
- Earning funds and score (player guide)
- Vehicle service and logistics (player guide)
- Commander's handbook (player guide)
- Tactical support menu
- Paradrop player experience
- Supply missions (player guide)
- In-game briefing & Diary field manual
- Playable maps catalog
- Faction root variables reference
- Faction base structures catalog
- Counter-battery radar system
- Bank, Reserve and Artillery Radar structures
- Map ruleset model and object config
- Countermeasures module reference
- Vehicle countermeasure (flares/spoofing)
- UAV terminal and spotter system
- Artillery firing function reference
- Service Point pricing model
- Medic redeployment truck (forward spawn)
- Side-patrol runtime and convoy mechanics
- Day/night cycle and weather system
- Config lookup helper reference
- CIPHER sort utilities reference
- Modded maps status and content
- BattlEye filter setup and OA taxonomy
- Player squad/group join protocol
- AutoFlip vehicle recovery
- Engine stealth fuel toggle
- Valhalla vehicle climbing-assist
- Missile and ordnance Fired-EH reference
- Vehicle equip and rearm reference
- Array and collection utilities
- Server composition spawner reference
- Upgrade queue server loop
- Map boundaries and off-map enforcement
- Namespace/profile/diagnostic utilities
- Group bool getVariable A2-OA trap
- Vehicle weapon balance init
- View distance auto-throttle
- Camp & respawn-camp getters
- Performance audit writer
- Site clearance (bulldozer)
- Factory queue cancel & refund
- AI commander tunable constants
- Experimental feature-flag constants
- Flag system quick reference
- Mission tunable constants catalog
- Gear parsing & cargo capacity
- Structure dressing function
- Paradrop delivery functions
- ICBM nuke client VFX & radiation
- Server HandleSpecial router
- LocalizeMessage chat router
- Gear buy-menu render & price functions
- Server broadcast & telemetry loops
- Per-unit client init pipeline
- Vehicle marking & texture pipeline
- Defense category & budget
- Legacy AI order primitives
- Commander-team driver
- AICOM command verbs
- AICOM behavior fix taxonomy
- AI commander wildcard deck reference
- AICOM aircraft and airfield system
- Static-defense manning
- End-of-game stats screen
- AI commander execution loop
- Deployable bipod / weapon resting
- Town-economy getters
- Server-init deadspawn & airfield probe
- GUER VBIED detonate action
- Resource income-tick engine
- AI commander treasury accessors
- PVF send-helper contracts
- AICOM logging & AICOMSTAT telemetry
- AICOMSTAT v2 event census
- WASPSCALE v2 telemetry
- WASPSCALE v2-ext coverage audit
- Telemetry families reference
- Group lifecycle & entity reaping
- Batch AI spawner orchestrator
- Client funds/income HUD readout
- Server group GC & cap warning
- Town runtime tuning constants
- Client input/hotkey handler
- WASP base-repair system
- WASP DropRPG launcher/ordnance
- CoIn construction-interface client engine
- Town-capture garrison & airfield rebuild
- Map-control & minimap templates
- Client FPS & state telemetry
- Client service-proximity getters
- Airfield-exclusive roster & unit hints
- Unit-camera spectator system
- Town-garrison patrol/defense worker
- RequestTeamUpdate squad-discipline
- Arma2Warfare GPT assistant
- LoadoutManager build configs & defines
- GLOBALGAMESTATS extension logging
- Discord bot instrumented logging
- Eden/Everon & Taviana map content
- Cruise missile strike asset
- AI / HC
- AI headless and performance
- AI mods and pathfinding reference
- Headless client scaling and topology
- AI runtime/HC loop map
- Headless client init and stat loop
- HC delegation target selection
- Player AI caps and role balance
- Old WarfareBE FPS comparison
- AI commander autonomy audit
- Upstream BE 2073 AICOM delta
- Parent 2.073 divergence audit
- AI commander capture & fun plan
- AI commander B69 improvement roadmap
- AI commander B69 implementation sketches
- AICOM V2 cutover status
- Headless delegation and failover
- Commander reassignment call shape
- GUER Director living-resistance pitch
- Quality and operations
- Foundation perf findings & Tier-3 dead-ends
- Dead/stale code register
- Commander vote/reassignment
- Attack-wave authority
- Server runtime and operations
- Server ops runbook
- JIP enrollment & client data delivery (b74.2 lessons)
- Server gameplay runtime atlas
- PerformanceAuditAnalyzer
- Performance opportunity sweep
- Documentation plan
- Knowledge platform roadmap
- Wiki quality audit
- Wiki pruning and relevance ledger
- Audit findings queue (2026-06-03)
- Deep review findings
- Client UI / server-loop perf findings
- Performance gain simulation
- Self-host testing field notes
- Cleanup and work lanes
- Hardening and authority
- UI / player workflows
- Client UI, HUD and menus
- UI HUD and dialogs
- Player UI workflow map
- Client UI systems atlas
- UI IDD collision repair
- UI control class library reference
- UI theme palette and style macros
- UI design inspiration 2026-07
- Available-actions client gate FSM
- Gear/loadout/EASA atlas
- Gear template profile filter
- Vehicle cargo equip loop bounds
- Factory and purchase systems atlas
- Service menu affordability guards
- WASP overlay
- Class-skill system reference
- Skin selector and class swap
- Earplugs audio toggle
- Mission audio catalog
- HQ radio knowledge-base catalog
- QoL trio player hints
- Player vehicle/travel actions
- Tooling / release / integrations
- Tools and build workflow
- Warfare web tools
- Ecosystem & companion repos
- Zargabad tooling parity
- July 2026 release readiness
- Operator monitor and CPU affinity tools
- Tooling release readiness audit
- Source fix propagation queue
- Agent release readiness ledger
- Release source intake map
- Testing/debugging/release workflow
- Current RPT release gate
- RPT telemetry consumer port map
- External integrations
- Integration trust boundary audit
- AntiStack database extension audit
- Community & Dev
- Community & Dev
- Miksuu upstream wiki import / archive index
- Upstream changelog feature leads
- Developer history and upstream lessons
- Upstream Miksuu commit intel
- Upstream mining ledger
- Archive script mining v2
- Upstream BE 2073 AICOM delta
- Parent 2.073 divergence audit
- PR8 and Drone upstream lesson match
- Development lessons learned
- External research reports
- Audit archive 2026-07
- Briefing reference
- Utes invasion concept
- Miksuu archive: Home
- Miksuu archive: Welcome
- Miksuu archive: Big announcements
- Miksuu archive: Changelog
- Miksuu archive: Development process
- Miksuu archive: Discord bot
- Miksuu archive: Gameplay videos
- Miksuu archive: LoadoutManager
- Miksuu archive: Chernarus script architecture
- Base-game visual catalogs
- Compatibility and references
- HC upstream history and lessons
- Player stats branch audit
- BuyMenu EASA QoL branch audit
- Perf quick wins branch audit
- Commander positions branch audit
- Zargabad branch audit
- Quad AI Commander concept
- Arma 2 OA external reference guide
- Base-game config & image reference
- Arma 2 OA compatibility audit
- Arma 2 OA agent traps reference
- Arma 2 OA command versions
- Wiki source consistency
- External Arma 2 OA reference index