Commit Graph

419 Commits

Author SHA1 Message Date
Anduin Xue b7a1caa5a5 Update difficulty levels in ChessEngine
Added a new difficulty level and adjusted the ranking of the "Unbeatable" level. Changes also include a minor adjustment in the calculation of the depth variable for the GetBestMove function. Comments with the old difficulty levels have been removed from both the ChessEngine service and the _Layout view.
2024-07-03 15:39:15 +00:00
Anduin Xue 9bc235a984 Add difficulty levels to "Against AI" game mode
Multiple difficulty levels have been implemented for the "Against AI" mode. This involved changes in the user interface to allow players to select the difficulty and corresponding adjustments in the game logic. Also, Artificial Intelligence behavior has been adapted according to these difficulty levels.
2024-07-03 15:22:11 +00:00
Anduin Xue d35e0989f9 chore: Update LynxChess.Lynx package reference to LynxChess.Lynx.Internal 2024-07-03 14:48:00 +00:00
dvorakchen 7b6000e2d7 feat: track highlight 2024-07-03 21:40:09 +08:00
dvorak chen 4b407ca9c4 Merge branch chessserver:master into master 2024-07-03 02:38:09 +00:00
Anduin Xue e21ea7ee88 Improve move validation in ChessEngine
The chess move validation process has been updated in ChessEngine. Now the code uses the ChessBoard class to load from FEN and validate each move, before picking the best one. This change provides stronger error-checking on generated moves.
2024-07-02 13:33:26 +00:00
Anduin Xue ae4502a263 Add statusControl and roleControl to ChessBuilder
In ChessServer, the ChessBuilder function and instantiation now take parameters for the statusControl and roleControl elements. This change improves flexibility by allowing these controls to be passed in from the invoking context, rather than being statically defined within the ChessBuilder function.
2024-07-02 12:41:27 +00:00
dvorak chen a891e8a4d6 Merge branch chessserver:master into master 2024-07-02 12:35:55 +00:00
Anduin Xue 0fffb18029 Merge branch 'refactor-dv' into 'master'
Refactor chessBoard.js

See merge request aiursoft/chessserver!64
2024-07-02 12:24:11 +00:00
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
dvorak chen 54ed2c2b27 Merge branch chessserver:master into master 2024-07-02 12:14:39 +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
dvorak chen dc63112dde Merge branch chessserver:master into refactor-dv 2024-07-02 08:42:19 +00:00
dvorakchen 206ce92ed5 refactor: chessboard.js 2024-07-02 16:37:30 +08:00
dvorak chen 6bb879c52a Merge branch chessserver:master into master 2024-07-02 03:20:42 +00:00
Anduin Xue db02d640e8 Use sudo to run docker because rootless docker may be provided by docker desktop and runs in VM, which has problem of pass through devices. 2024-07-01 17:08:02 +00:00
dvorak chen e95e0585a5 Merge branch chessserver:master into master 2024-07-01 12:44:49 +00:00
Anduin Xue e97924cf15 Merge branch 'users/nugetninja/evergreen' into 'master'
Auto dependencies upgrade by bot.

See merge request aiursoft/chessserver!63
2024-06-30 06:01:16 +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
Anduin Xue 292bec5004 Update README.md 2024-06-23 16:29:05 +00:00
Anduin b2a4a7a788 Merge branch 'master' of ssh://gitlab.aiursoft.cn:2202/aiursoft/chessserver 2024-06-23 16:10:20 +00:00
Anduin 54ed8c4fce Update navbar brand URL 2024-06-23 16:10:19 +00:00
Anduin Xue 9bc8fb4701 Merge branch 'master' into 'master'
feat: display name who sent message

See merge request aiursoft/chessserver!60
2024-06-23 14:17:27 +00: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
Anduin Xue 0ccb5a50cd Merge branch 'master' into 'master'
fix: scroll behavior

See merge request aiursoft/chessserver!59
2024-06-23 07:31:42 +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
Anduin Xue 831c3adac2 Merge branch 'master' into 'master'
fix: chat message text color

See merge request aiursoft/chessserver!58
2024-06-21 15:36:18 +00:00
dvorak chen 568ef64cfc Merge branch chessserver:master into master 2024-06-21 15:28:04 +00:00
dvorakchen 4d698616e8 fix: chat color 2024-06-21 23:27:32 +08:00
Anduin Xue e15b2e7f99 Update README.md 2024-06-21 15:20:39 +00: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
Anduin Xue 06d748814b Merge branch 'chat-dv' into 'master'
feat: chat

See merge request aiursoft/chessserver!57
2024-06-21 10:03:29 +00:00