Randomize decoy usernames and which rapports carry coded messages

Decoy names in /var/home and verifyCodes.txt were a hardcoded 4-name
list (Luke, Charles, William, Peter), so a real player registering
under one of those names would collide with it. Now each session
picks 6 decoys from a pool of 10, excluding any name already taken by
a real player, and stores the pick as a session setting.

Likewise the 3 "special report" rapports that get coded messages were
always Doyle, Vega and Lennox. Each session now randomly assigns 3 of
the 20 rapports to that role, and the win screen / mainframe-help
message reference whichever agents were actually picked instead of
the hardcoded names.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Frank
2026-08-22 17:09:52 +02:00
co-authored by Claude Sonnet 5
parent 02780d8f04
commit 6b1436dfe7
6 changed files with 155 additions and 30 deletions
+14 -8
View File
@@ -121,9 +121,10 @@ class GameDashboardServiceTest extends TestCase
// SessionSetting (verification progress)
// Total = 2 * 6 = 12
// PLUS Session (persist)
// Total = 13
// PLUS SessionSetting (decoy usernames) + SessionSetting (special report assignments)
// Total = 15
$this->entityManager->expects($this->exactly(13))
$this->entityManager->expects($this->exactly(15))
->method('persist');
$result = $this->service->startSession($session);
@@ -155,9 +156,10 @@ class GameDashboardServiceTest extends TestCase
// Player (persist) + 5 Settings = 6 persists
// Total = 4 * 6 = 24
// PLUS Session (persist)
// Total = 25
// PLUS SessionSetting (decoy usernames) + SessionSetting (special report assignments)
// Total = 27
$this->entityManager->expects($this->exactly(25))
$this->entityManager->expects($this->exactly(27))
->method('persist');
$result = $this->service->startSession($session);
@@ -360,8 +362,10 @@ class GameDashboardServiceTest extends TestCase
// 4. Persist Session status update
// 5. 5 Settings for Player 1
// 6. 5 Settings for Player 2
// Total = 1 + 1 + 1 + 1 + 5 + 5 = 14 persists
$this->entityManager->expects($this->exactly(14))
// 7. SessionSetting (decoy usernames)
// 8. SessionSetting (special report assignments)
// Total = 1 + 1 + 1 + 1 + 5 + 5 + 1 + 1 = 16 persists
$this->entityManager->expects($this->exactly(16))
->method('persist');
$result = $this->service->joinSession('abc-123', $user);
@@ -415,8 +419,10 @@ class GameDashboardServiceTest extends TestCase
// 3. Player screen persist (during startSession)
// 4. Session status persist (during startSession)
// 5. 5 Settings for Player (during startSession)
// Total = 1 + 1 + 1 + 1 + 5 = 9 persists
$this->entityManager->expects($this->exactly(9))
// 6. SessionSetting (decoy usernames)
// 7. SessionSetting (special report assignments)
// Total = 1 + 1 + 1 + 1 + 5 + 1 + 1 = 11 persists
$this->entityManager->expects($this->exactly(11))
->method('persist');
$session = $this->service->createSession($game, $user, false);