Feature/game - #47
Merged
Merged
Conversation
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.
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
previously approved these changes
Jan 4, 2026
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.
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.
Hazem-0
approved these changes
Jan 10, 2026
SherifAshraf2020
approved these changes
Jan 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.