Native smoke test (isolated test servers only)
=============================================

elo_smoke.gsc uses eight synthetic GUIDs and writes test match results. Never
deploy it to a production server or point its bridge at a production service.

Use a fresh, isolated game/scriptdata directory and a fresh central database.
Install the complete repository scripts and the Bot Warfare dependency described
in docs/RATINGS.txt. Configure a private test service and bridge as described
there, start both, then copy this test script into that game's scripts/mp folder.
Set comp_elo_backend to service and comp_qa to 1 before loading a map.
The test service needs an isolated account database containing the eight
ee00000000000001..08 fixture accounts, server registration and valid admissions.
The test bridge switches that isolated server registration to Unranked before
the second B2 begin and refreshes admissions. Never use production credentials.

The native log must contain:
  [ELO_QA] PASS native math and service integration

The expected unknown-match rejection is deliberate. Inspect the test database:
eight accounts should have one game each, four rated 1532 and four rated 1468,
with a total rating of 12000. Use a new empty database for another run.
The following Unranked result must leave those ratings/games unchanged. All
eight wallets must have exactly 5 Coins (4+1 for Allies, 3+2 for Axis), with
two result receipts and 16 match-credit ledger rows across the fixture.

This tests GSC execution, math and real service I/O. It does not exercise an
eight-human match, halftime, reconnects, visible match HUDs or live lobby joins.
See docs/QA.txt for recorded platform runs and the remaining multiplayer checks.

Eight independent clients
-------------------------
eight_clients.gsc is a separate observer, enabled only by comp_qa_eight 1.
It writes snapshots/events under scriptdata/qa_eight with actual connected
GUIDs, team/session state, performance points, weapon and health. It does not
spawn bots, mark synthetic players ready, assign points or settle ratings.
Use separate game/player data and Wine prefixes or Windows installations for
eight independent authenticated clients. Install the normal class presets.
Join two duos and four solos through the frontend, stop at seven to check the
start gate, then search with the eighth. Select classes through the real UI.

Optional control.txt lines position actual players after the eight-player
gate succeeds, for reproducible native gameplay events:
  uniqueSequence|flag|guid|flagIndex
  uniqueSequence|lineup|attackerGuid|victimGuid
Flags must be captured by the game and shots fired by the actual client.
The observer never fabricates these events. Keep this script off play servers.

The engine-independent controller chord can also be checked with:
  g++ -std=c++20 tests/native/shortcut_test.cpp -o /tmp/ranked-shortcut-test
  /tmp/ranked-shortcut-test
This covers hold/release sequencing, not physical controller compatibility.

Stock menu flow
---------------
Ranked must first open the installed menu_xboxlive party layout, with Invite,
Create a Class, Callsign & Killstreaks, Barracks and Find Match. Opening Ranked
alone must not search. Check solo and duo parties; the name text must stay
inside the original player-card backgrounds at both 4:3 and widescreen sizes.
Find Match must open the installed menu_xboxlive_lobby layout with eight slots,
gold Searching... placeholders and the selected pool map/mode. The native
extension retains frontend UI assets while connected and rebuilds its menu
clones after engine UI reloads.

While queued, open Create a Class, return, toggle warmup both ways and cancel
from a class submenu. Verify party membership survives submenus/view changes,
and cancellation returns both duo members to their original party pre-lobby.
Observe server presence, not just displayed slots. Check client logs for
repeated PlayerCards_GetPartyMemberData errors from stale stock expressions.
Steam friend invites require a separate Steam-enabled client test.
Restricted class fixture (2026-10-12): restricted_loadout.gsc is TEST ONLY.
It requires comp_qa_eight=1 and qa_eight/loadout.request, and accepts only the
designated NativeQA-8 GUID in DM. It saves/restores all fields it changes,
injects prohibited attachments, secondary, grenades, perks and deathstreaks,
then invokes the installed stock giveLoadout for all 15 custom and five default
classes. It verifies weapon inventory, both base/Pro perk sets, and absence of
other perks with the deathstreak counter at 20. It never touches the visible
player or rating settlement. Native evidence: docs/qa/restricted-loadout-native.txt.

Lootbox reveal
--------------
g++ -std=c++20 -Wall -Wextra -Werror tests/native/loot_motion_test.cpp -o /tmp/zeal-loot-motion-test
/tmp/zeal-loot-motion-test
Checks versioned/legacy purchase intents, all five carousel destinations,
open-frame clamps, invisible prizes before the lid opens,
monotonic rise/fade, preserved 1:1 / 4:1 / 5:1 aspect ratios and reopening.
In a QA game without an authenticated Ranked session, zeal_loot_preview
<box-id> <drop-index> [lootbox|enhanced_lootbox] plays a labelled preview without sending requests or spending
Coins. zeal_loot_check verifies every registered calling card against the
actual title/challenge/unlock tables and playerdata stat enums loaded by the engine.
The expanded collection has 21 drops per crate (indices 0..20).

zeal_loot_shop <lootbox|enhanced_lootbox> previews either purchase tier.

Loot camo state regression
-------------------------
g++ -std=c++20 -Wall -Wextra -Werror tests/native/loot_camo_state_test.cpp -o /tmp/zeal-loot-camo-state-test
/tmp/zeal-loot-camo-state-test
Covers all catalog camo selections (currently 42) arriving before the first active snapshot,
spectator targets, weapon/model guards, invalid packets and disconnect reset.

g++ -std=c++20 -Wall -Wextra -Werror tests/native/loot_class_choice_test.cpp -o /tmp/zeal-loot-class-choice-test
/tmp/zeal-loot-class-choice-test
Checks the 15-slot camo selection, migration from a legacy single camo, explicit
stock selection, out-of-range rejection and all current loot camo numbers.

loot_camo_render.gsc is an offline visual fixture, never a public-server script.
It runs only with zeal_qa_loot_camo=1, sv_maxclients=1, sv_lanOnly=1,
comp_ranked_auto=0 and player CamoRenderQA.
Copy into a QA install's userraw/scripts/mp, start a local DM map, spawn, and
set zeal_qa_camo_id to a catalog camo ID. It equips woodland's Intervention
model and sends the real reliable camo command. It never changes account
ownership or Coins. Remove the fixture after testing.

Cosmetic grants
---------------
glove_grants.gsc is an offline regression fixture. Install alongside the
current server scripts in an isolated QA game and load a local map with
zeal_qa_glove_grants=1 and sv_lanOnly=1. It checks the actual GSC earn/progress
functions for every catalog reward, including the six challenge gloves:
individual private flags unlock only their reward, counters stay zero,
unrelated rewards remain locked and every loot reward still requires ownership.
Expect [GLOVE_GRANT_QA] PASS. It uses an in-memory struct, never an account or
real player, and must not be installed on a public game server.

Glove rendering and connected reward refresh
--------------------------------------------
glove_render.gsc runs only in an isolated local game: zeal_qa_glove_render=1,
sv_lanOnly=1, sv_maxclients=1, comp_ranked_auto=0 and player GloveRenderQA.
Install the production scripts plus this fixture and devmap mp_killhouse.
Join a team/class and choose PLAY. The fixture grants its local test player
all catalog gloves in memory (currently 27) and forces the stock black_kit hands that exposed the bug.
Follow each [GLOVE_RENDER_QA] SELECT line by setting zeal_glove through the
client console or menu (server setClientDvar cannot change protected saved
dvars). It verifies the actual server viewmodel for every choice, rejects
an unowned choice and restores the original hands when zeal_glove is empty.
Expect [GLOVE_RENDER_QA] PASS. Remove this fixture after testing; never deploy
it on public servers. Inspect the rendered hands as well as the server log.

zeal_glove_check prints the chosen glove and, on a one-player local server,
the server's glove choice without logging identity or authentication fields.
zeal_reward_sync_check exercises 16 bulk refresh requests only on an active
one-player loopback connection. Expect stats writes 0 and reliable delta 0.
Open Create a Class and Gloves while connected; disconnect and run the check
again. The pending refresh must clear once the frontend is ready. Outside
that local test condition the command only reports counters.

Warmup Leave Game
-----------------
g++ -std=c++20 -Wall -Wextra -Werror tests/native/warmup_pause_test.cpp -o /tmp/zeal-warmup-pause-test
/tmp/zeal-warmup-pause-test
Exercises the actual menu-action patch with engine-shaped fixtures: queued
Leave Game and confirmation return to search, ordinary match exits restore the
stock actions, both UI contexts deduplicate pointers, reload retains original
actions, and allocator release restores engine ownership before free/copy.

Native validation must cover F6 -> Leave Game -> search without disconnect,
then a warmup-to-match transition while a class submenu is open. The real
server replaces the warmup map/mode on its existing connection; there is no
second game process to close. Offline fixture testing does not establish a
live eight-player matchmaking result.
