Commit Graph
3 Commits
Author SHA1 Message Date
CydandClaude Opus 4.8 530326b8e4 Parameterize registration.php; atomic player delete
- All staff paths (build, lock, edit, editgame, delete, add, search) and the
  render SELECTs now use db.php helpers with bound params. Removes SQL injection
  via playerid/missionid/callsign/newtype/newmap/buildmissions.
- Delete routes through new pqs_remove_player() (shared lock + transaction,
  resyncs numplayers from real occupancy instead of a raw numplayers-1).
- Drop a stray buggy line ($callsign from an undefined $line) and guard
  $_SERVER['SERVER_ADDR']. build now sets nummercs=0 (strict-mode safe).

Verified on the stack: build/edit/delete/editgame/lock/search all work; delete
resyncs numplayers; no errors.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-01 14:04:04 -05:00
CydandClaude Opus 4.8 c82978776d Route all remaining fill paths through the shared atomic queue
Completes the overfill-race fix (item #1). New queue.php functions, all under
the same GET_LOCK + transaction and self-healing numplayers:
- pqs_add_player_to_mission     (staff 'new' -> registration.php)
- pqs_add_player_to_missions    (staff 'add to N missions' -> registration.php)
- pqs_enqueue_group             (kiosk group leader -> callsign.php)
- pqs_claim_group_slot          (kiosk group member -> callsign.php)
callsign.php and registration.php now call these instead of their own
non-atomic read-check-insert blocks.

Verified on the local stack: scenario test (leader/member/staff paths) and
120 mixed concurrent solo+group writers x3 -> zero overfill, zero drift;
HTTP smoke of leader/member/new paths all seat correctly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-01 13:49:10 -05:00
CydandClaude Opus 4.8 df04ab4eb7 Atomic mission-fill for kiosk registration (fixes overfill race)
- dev/migrations/001-innodb.sql: convert pqs_queue + pqs_mission to InnoDB.
- includes/queue.php: pqs_enqueue_player() seats a player in the next open
  mission (creating one if needed), serialized with GET_LOCK and wrapped in a
  transaction; capacity judged by real COUNT(*), numplayers rewritten from it
  so the counter self-heals and can't drift.
- callsign.php: normal registration path now calls pqs_enqueue_player instead
  of the non-atomic read-check-insert.

Verified on the local stack: 140 concurrent registrations -> 24 missions,
zero overfill, zero counter drift.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-01 13:40:44 -05:00