Commit Graph

191 Commits

Author SHA1 Message Date
Anduin Xue d37df1970a Improve game visibility and adjust search depth
Added several logging options to increase visibility of the game's internal operations. Also limited the chess engine's iterative deepening depth-first search (IDDFS) to a depth of 10 to improve performance efficiency. Additionally, changed the representation of '0' to 'O' due to notation issues in the GamesController.
2024-07-02 12:23:26 +00:00
dvorak chen d70961f31d Merge branch chessserver:master into refactor-dv 2024-07-02 12:14:48 +00:00
Anduin Xue 1c36398f38 Update script reference in _Layout.cshtml
The script reference to layout.js in the _Layout.cshtml file was updated by adding an "asp-append-version" attribute. This will ensure a fresh copy of the script is loaded by appending a version query parameter to the URL, useful for cache busting.
2024-07-02 11:58:15 +00:00
Anduin Xue 8143eea15f Refactor PveController in ChessServer module
Unused 'System.Drawing' import is removed and unnecessary variable creations are eliminated in PveController. Especially, the acceptedChallenge variable and the board variable within fen changes subscription logic are omitted to make the code cleaner and more efficient.
2024-07-02 11:56:33 +00:00
Anduin Xue 7be9d758d1 Reduce search depth and fix turn-checking method
The search depth for the iterative deepening depth-first search (IDDFS) in the ChessEngine has been reduced for performance reasons. In addition, the method for checking whose turn it is in the PveController has been altered. This now checks the color of the pieces, rather than looking up the player's ID, yielding more accurate results.
2024-07-02 11:55:26 +00:00
Anduin Xue 8047201b4b Add computer player interaction in PveController
A new section for adding a computer player has been implemented in PveController. This enhancement includes creating a challenge, letting the computer accept the challenge, and allowing the computer to respond to the player's move. Additionally, the delay for the UI update has been increased and a redirect to the game page is included.
2024-07-02 11:43:44 +00:00
Anduin Xue 264f64c21b Integrate AI chess engine and player vs AI functionality
Added new ChessEngine service as a singleton and integrated "LynxChess.Lynx" package. A new "Against AI" button is included in the layout. Player's ID is now appened to the "Against AI" button link. Created a new controllers, PveController, to handle interactions in Player versus AI mode.
2024-07-02 11:39:05 +00:00
dvorakchen 8961cd2dce chore: remove unnecessary 2024-07-02 16:45:21 +08:00
dvorakchen 206ce92ed5 refactor: chessboard.js 2024-07-02 16:37:30 +08:00
dvorak chen e95e0585a5 Merge branch chessserver:master into master 2024-07-01 12:44:49 +00:00
Nuget Ninja 7f9aeed42d Auto csproj fix and update by bot. 2024-06-30 05:01:16 +00:00
dvorakchen 2f8c7994b3 feat: add track 2024-06-26 16:29:48 +08:00
dvorakchen 8fa8544d7b feat: display name who sent message 2024-06-23 21:11:23 +08:00
Anduin 1e6eaea80f Update navbar brand URL
The navbar brand URL in _Layout.cshtml was updated. The previous link pointed to "https://home.aiursoft.cn". This has been changed to point to "https://www.aiursoft.cn" instead.
2024-06-23 10:52:45 +00:00
Anduin d8a67cb9b0 Add icons to navbar links and player name
Added two font awesome icons to the navbar links 'Rooms' and 'Watch'. Icon for player name also added in the layout.js file. This gives a more visual and interactive touch to the action links and personalizes the player name link.
2024-06-23 10:37:42 +00:00
Anduin 987a969e29 Add Font Awesome package to ChessServer
A new package '@fortawesome/fontawesome-free' has been added to Aiursoft.ChessServer's package.json. This inclusion will allow for more extensive use of icons and improve the overall user interface experience.
2024-06-23 10:28:59 +00:00
dvorakchen c61c500427 feat: change scroll behavior 2024-06-23 14:11:14 +08:00
dvorakchen 56b3d218e6 fix: scroll problem on mobile 2024-06-23 14:00:51 +08:00
Anduin 7ad82ab2ad Merge remote-tracking branch 'origin/master' 2024-06-22 09:17:29 +00:00
Anduin c03f9d484e Add Font Awesome CSS to layout
A link to the Font Awesome CSS library has been added to the layout. This update will make Font Awesome icons available across the application views, improving the user interface design options.
2024-06-22 09:17:26 +00:00
dvorakchen 4d698616e8 fix: chat color 2024-06-21 23:27:32 +08:00
Anduin dc33989ef7 Refactor drag-start logic in chessboard.js
The drag-start logic in the chessboard.js file was changed for simplification. The onMouseoverSquare function was removed and its functionality was moved into the onDragStart function. In addition to that, variable and argument names were also modified to increase readability.
2024-06-21 14:46:57 +00:00
Anduin e50b551260 Add game over check to chessboard script
An additional check has been added to the chessboard.js script in the ChessServer application. This check ensures that if the game is over, no further moves are allowed to be made, improving the game flow and overall user experience.
2024-06-21 14:41:17 +00:00
Anduin e0a8a833f2 Limit onMouseoverSquare function to the current player's turn
This code change ensures that mouseover triggers on chess pieces only work for the player whose turn it is currently. The function onMouseoverSquare now has a condition that returns nothing if the game's turn does not match the player's color.
2024-06-21 14:30:48 +00:00
Anduin f8b37c1fcb Update Send button styling in chat component
A change has been made to the styling of the "Send" button in the chat component to include rounded corners. The update provides a softer aesthetic to the button, improving the visual appearance and user experience.
2024-06-21 14:29:50 +00:00
Anduin 98f5a412be Refactor classes into separate files
Moved AcceptedChallenge, ChatMessage, and ChatMessageResponse classes to individual files from Challenge.cs. This change enhances the organization and readability of the code, allowing each class definition to reside in its own dedicated file.
2024-06-21 14:01:05 +00:00
Anduin 8001031a22 Refactor chat feature and add websockets support
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.
2024-06-21 14:00:18 +00:00
dvorakchen c6df42d12d ffix: lint error 2024-06-21 18:00:31 +08:00
dvorak chen 8de10e3526 Merge branch chessserver:master into chat-dv 2024-06-21 09:48:02 +00:00
dvorakchen 971aad6e63 feat: chat
it just static now
2024-06-21 17:46:11 +08:00
Aimer Neige 743c8df063 Highlight Legal Moves 2024-06-20 16:40:23 +00:00
dvorak chen 150f0b2bd7 Merge branch chessserver:master into master 2024-06-20 09:08:22 +00:00
dvorakchen 47a62085e0 feat: disable overscroll-behavior 2024-06-20 17:07:41 +08:00
xuef 1f04695351 Merge branch 'master' of ssh://gitlab.aiursoft.cn:2202/aiursoft/chessserver 2024-06-20 07:57:31 +00:00
xuef 194009b86e Update navbar brand link in _Layout.cshtml 2024-06-20 07:57:27 +00:00
Anduin d89809a1f9 Remove unused namespaces in HomeController
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.
2024-06-18 16:10:43 +00:00
Anduin 064ac98785 Refactor challenge creation and joining logic
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'.
2024-06-18 16:02:57 +00:00
Anduin 67b4d6546d Refactor ChessServer test methods and cleanup unused imports
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.
2024-06-18 08:13:35 +00:00
Anduin 24804d3e52 Refactor and enhance chess game functionality
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
2024-06-18 07:56:44 +00:00
Anduin 47b6fbee57 Refactor test initialization and redirect actions
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.
2024-06-18 05:55:17 +00:00
Nuget Ninja 1bb568628e Auto csproj fix and update by bot. 2024-06-08 05:00:49 +00:00
Nuget Ninja 186677f5b6 Auto csproj fix and update by bot. 2024-06-05 05:00:52 +00:00
Anduin 038124e7db Update default initialization and script import paths
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.
2024-05-19 16:28:52 +00:00
Anduin ab1fbea2c7 Add functionality to accept a challenge in chess game
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.
2024-05-19 16:18:02 +00:00
Nuget Ninja 202a157f14 Auto csproj fix and update by bot. 2024-03-31 03:31:18 +00:00
Nuget Ninja e286939cbc Auto csproj fix and update by bot. 2024-03-25 03:22:31 +00:00
Nuget Ninja 3088c02a32 Auto csproj fix and update by bot. 2024-03-22 03:22:14 +00:00
Nuget Ninja eb4fe921b8 Auto csproj fix and update by bot. 2024-03-20 03:22:10 +00:00
Nuget Ninja 6d709b36e9 Auto csproj fix and update by bot. 2024-03-17 19:02:52 +00:00
Nuget Ninja b767083eb4 Auto csproj fix and update by bot. 2024-03-17 15:53:08 +00:00