Skip to content

Feature/game - #47

Merged
MahmoudRafaat merged 12 commits into
developfrom
feature/game
Jan 10, 2026
Merged

Feature/game#47
MahmoudRafaat merged 12 commits into
developfrom
feature/game

Conversation

@MahmoudRafaat

Copy link
Copy Markdown
Contributor

No description provided.

Introduced GameRequest to represent a game request between two players and GameRoom to manage a game session with unique room IDs and player handling logic.
Replaces the GameManager interface with a singleton class that manages active game rooms and pending game requests. Adds methods for requesting games, handling responses, starting games, and forwarding moves between players, with appropriate error handling and thread safety.
Introduced getPlayerById to GameServerManager for player retrieval by ID. Extended Action enum with GAME_END and GAME_START. Updated MessageRouter to handle REQUEST_GAME by invoking GameManager.requestGame with sender and target.
@MahmoudRafaat MahmoudRafaat self-assigned this Jan 4, 2026
Introduced notifyPlayersGameStarted to inform players when a game starts. Updated Action enum values for consistency, enhanced MessageRouter to handle GAME_RESPONSE and SEND_GAME_UPDATE actions, and added getters for players in GameRoom. Also adjusted message types for game updates.
ZeiadT
ZeiadT previously approved these changes Jan 4, 2026
Hazem-0
Hazem-0 previously approved these changes Jan 4, 2026
Introduced PlayerStatus enum to represent player states. Updated Player model and PlayerDAO to accept player ID from the database instead of generating a new UUID, ensuring consistency with stored data.
Introduces AvailablePlayersInfo class to encapsulate available players. Adds player status management to PlayerConnectionHandler and methods in GameServerManager to retrieve and send available players, excluding the requester. This improves tracking and communication of online players in the server.
Introduced GameRequestInfo, GameResponseInfo, GameStartInfo, and MoveInfo classes to encapsulate game-related data for requests, responses, game start events, and moves. These classes will help structure communication and state management in the tic-tac-toe server domain.
Expanded Action enum with new error and status codes. Refactored GameManager to use new info classes and improved error handling for game requests, responses, and move forwarding. Updated MessageRouter to route new actions and handle responses, improving player status management and communication flow.
@MahmoudRafaat
MahmoudRafaat dismissed stale reviews from Hazem-0 and ZeiadT via 9ac8a00 January 9, 2026 13:50
 updated MessageRouter to send a response back to the sender after processing a game request.
Introduces PlayerEntity with an id field and updates AvailablePlayersInfo to track online, in-game, and pending players separately. GameServerManager now broadcasts player lists on status changes, and AuthenticationService and GameManager trigger these broadcasts on login and game state transitions. MessageRouter and StatisticsService are updated to use the new PlayerEntity structure.
Introduced requesterUserName and responderUserName fields to GameRequestInfo and GameResponseInfo for improved player identification. Updated AuthResponseEntity to consistently use userName instead of username. Also added broadcastPlayerList calls after game request rejection and opened game service package to Gson in module-info.java.
@MahmoudRafaat
MahmoudRafaat merged commit 9fde403 into develop Jan 10, 2026
1 check passed
@MahmoudRafaat
MahmoudRafaat deleted the feature/game branch January 10, 2026 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants