The chat feature in the Chess Server web application is now refactored to use WebSockets, allowing real-time communication between players during a game. The message display logic has been moved to a separate script file, and a ChatController handles incoming WebSocket connections. This update has drastically improved chat interactivity and real-time performance.
Cleaned up HomeController in ChessServer by removing unused namespaces. This improves the readability and maintainability of the code, making it less cluttered and easier to understand.
The challenge creation and accepting logic has been refactored into a separate ChallengesController. This includes the addition of several new views, changes to existing ones, and backend logic improvements. Irrelevant 'Home' controller codes have been removed. Also, better error handling has been added to the 'PlayersController'.
Several test methods in the ChessServer module have been refactored for better readability and maintainability. A new method, CreateChallengeForTest, was introduced to reduce redundancy. The use of unnecessary imports in the InMemoryDatabase class has also been tidied up.
This commit adds enhancements and refactors existing logic in the chess game. The modifications convert single-player games into multiplayer, introducing logic for accepting and managing game challenges, and displaying player information. Changes include retrieving a player's color via a new API, switching to represent watch mode visually, and restructuring the challenge acceptance flow
The test initialization method within BasicTests.cs has been simplified for improved code readability. Additionally, redundant playerId argument has been removed from RedirectToAction calls within HomeController.cs, streamlining redirection methods.
Changed the default initialization of Accepter, GameId, and Game properties in Challenge model. Also modified how the 'autodark.js' and 'player.js' scripts are imported in 'layout.js' to use relative paths for better compatibility.
Introduced capability to accept a challenge, updated challenge viewer model to include challenge id, and updated the In-Memory database to handle adding new games. The corresponding endpoint was updated and the front-end scripts were added to handle challenge acceptance and game redirection. Changes were also made to ensure challenges are only seen when not accepted in the public view.