Skip to content

Commit 5ed8c64

Browse files
committed
vibe-debugged allowing players to connect to room during role selection screen.
1 parent ad9c09e commit 5ed8c64

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

pnkfelix/pagelets/demo-botc-pubnub.html

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2669,6 +2669,12 @@ <h3 id="removeReminderTitle">Remove Reminder</h3>
26692669

26702670
document.getElementById('roleSelectionScript').textContent = currentScript.name;
26712671
document.getElementById('roleSelectionPlayerCount').textContent = players.length;
2672+
2673+
// Initialize PubNub connection and send game setup so players can join during role selection
2674+
currentUser = 'Storyteller';
2675+
initializePlayerRoles();
2676+
initializePubNub();
2677+
mostRecentSetupTimestamp = Date.now();
26722678

26732679
// Show target distribution
26742680
updateDistributionDisplay();
@@ -2881,10 +2887,6 @@ <h3 id="removeReminderTitle">Remove Reminder</h3>
28812887
// Hide the role selection screen
28822888
document.getElementById('roleSelectionScreen').classList.add('hidden');
28832889

2884-
// Now continue with the normal game setup flow
2885-
currentUser = 'Storyteller';
2886-
initializePlayerRoles();
2887-
28882890
// Automatically distribute the selected roles to players
28892891
distributeSelectedRolesToPlayers();
28902892

@@ -2903,9 +2905,6 @@ <h3 id="removeReminderTitle">Remove Reminder</h3>
29032905
targetSelect.appendChild(option);
29042906
});
29052907

2906-
initializePubNub();
2907-
// If storyteller starting new game, mark current time to ignore older setups
2908-
mostRecentSetupTimestamp = Date.now();
29092908
switchToGameScreen();
29102909

29112910
// Broadcast the role assignments
@@ -3482,6 +3481,8 @@ <h3 id="removeReminderTitle">Remove Reminder</h3>
34823481
34833482
F: is there another instance of the same problem in createResponseUI ?
34843483
3484+
F: Look at this code. Pay attention to the instructions for CLAUDE at the top. Immediate task: The players are currently not able to join the room until after the roles have been distributed. But there is no real reason for that limitation that I can see; after the storyteller has created the room and is in the process of selecting roles, we should let the players go ahead and join the room concurrently.
34853485
3486+
F: I don't think that's the fix; my players still cannot join the room while I am on the role selection screen. Is there something important from the "Continue to Game" button that we need to do as soon as we get to the Role Selection screen?
34863487
34873488
-->

0 commit comments

Comments
 (0)