-
Notifications
You must be signed in to change notification settings - Fork 1
Room limit #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Room limit #40
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request implements a room player limit feature for the Deep Sea Stories application. The implementation adds a maximum capacity of 4 players per room, with proper error handling when attempting to join a full room, and a UI indicator showing current player count against the limit.
Key Changes
- Introduces a
ROOM_PLAYERS_LIMITconstant (set to 4) shared across backend and frontend - Implements server-side validation that prevents additional players from joining full rooms
- Adds a visual player count indicator component showing "X/4" players in the game view
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
packages/common/src/constants.ts |
Defines the new ROOM_PLAYERS_LIMIT constant (4 players) |
packages/common/src/index.ts |
Exports the room limit constant for cross-package usage |
packages/backend/src/domain/errors.ts |
Adds GameRoomFullError class and removes unused error definitions |
packages/backend/src/game/room.ts |
Implements player limit check in addPlayer method before peer creation |
packages/backend/src/controllers/peers.ts |
Catches room full errors and converts them to user-facing TRPC errors |
packages/backend/src/controllers/stories.ts |
Removes unused FailedToStartStoryError import and usage |
packages/web/src/components/PlayerCountIndicator.tsx |
New component displaying current player count vs limit with icon |
packages/web/src/views/GameView.tsx |
Calculates player count and renders the indicator component in the UI |
packages/web/src/views/JoinView.tsx |
Adds error handling to display user-friendly messages for room capacity errors |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
AHGIJMKLKKZNPJKQR
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When someone leaves (e.g. by closing their browser tab), they don't release their slot, effectively making the room limit 3
No description provided.