Conversation
tasneem-hakeem
approved these changes
Jan 11, 2026
ZeiadT
approved these changes
Jan 11, 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.
This PR improves the robustness of the authentication system. It prevents users from logging in from multiple devices simultaneously, handles database connection failures gracefully during auth, and fixes the response flow for user registration.
Key Changes:
Concurrent Login Prevention: Added isPlayerOnline check in GameServerManager and AuthenticationService. If a user is already online, the server now returns a USER_IS_ONLINE error action instead of allowing a second session.
Database Error Handling: Updated PlayerDAO and AuthenticationService to properly catch SQLException and handle null database connections. The server now returns an INTERNAL_SERVER_ERROR message to the client if the DB is down, rather than crashing or hanging.
Registration Flow: Fixed MessageRouter to correctly send the registration response message back to the client.
Refactoring:
Improved thread safety and logic in getAvailablePlayersMessage (GameServerManager).
Added logic to ensure the requesting player is not included in their own "Available Players" list.