- SFML
- sudo apt-get install libsfml-dev
- For server, go to server folder and run make command;
- For client, go to client folder and run make command.
- Make sure that the server is running. Go to server folder and run ./server.bin command. To start the client, go to client folder and run ./client.bin 127.0.0.1 2906 command.
- When the client is launched, a window of fixed 1600x900 resolution will appear on the screen, displaying the Main Menu of the Shogi Net Client. Two buttons are displayed: Start and Exit;
- When the Start button is pressed, the client is redirected to the Login screen. If the server is not running, the game window closes, prompting a message in the console;
- The client is promted to login, providing their username and password, then clicking the Login button. If he or she does not have an account, they will have to register first.
- If the client wish to register, then the Register button must be pressed. The Register screen will be displayed. The client is now prompted to provide a username of maximum 16 characters, with only upper and/or lower letters and numbers, and a password between 8-20 characters (same character restrictions from above), followed by a confirm password field. If the provided credentials are correct, if the username was not being used by another account and if both password and confirm password are matched, the registration is considered successful. After registration, the client is redirected to the Lobby screen.
- Note 1: please make sure not to move the mouse while writing your credentials. Double click these fields before writing.
- Note 2: there are 2 users in the system that can be used for testing: (admin,1234) and (asd,123).
- After the user logs in, the Lobby screen is displayed. The client is now able to see a list of games in which can join, each game having displayed the host name, his or her number of wins and total matches. A Host button is also displayed, along with a Refresh button, Join button and a status bar that prompts messages from server.
- By clicking the Refresh button, the list of available games in which the user can join is updated and displayed on the screen.
- If the Host is pressed, the client enters in a wait hold state, awaiting for another player to join his or her game. The game is now displayed in the lobby and anyone can join. If someone joins the hosted game, the match will start. It is recommended not to close the client while waiting for someone to join.
- If a user wishes to join the game hosted by another player, he or she can do so by typing that player name in the status bar, then pressing the Join button. This triggers the start of the match.
- When the match starts, the game screen is displayed. Both players can see whether is their turn or not, as a message will always be displayed on the screen above the player hand (a wooden rectangle at the left of the board) in a status bar. Both players will see the game table bottom-up, from their own perspective. A Forfeit button is also displayed in the upper-left corner.
- If the current player right-clicks on a piece from the table or from the captured pieces zone, the corresponding squares in which the piece can be moved or placed will be highlighted in green. Afterwards if the player clicks a highlighted square.
- If the movement has brought the piece in the promotion zone, the client will be requested to confirm promotion or not. Left-clicking the status bar confirms the promotion, while left-clicking anywhere on the board declines it. Wether the promotion occurs or not, a move will be registered and sent to the server.
- After the move is sent to the server, the current player is now waiting for their opponent to make a move.
- The opponent is waiting all this time until the server sends him or her a command to update the board state. The opponent is now able to make a move.
- The game continues until an end game signal is received from the server. A game can end in several ways:
- one of the players press the Forfeit button. That player is disconnected from the server and redirected to Main Menu. Its opponent is declared winner;
- one of the players checkmate the other player. The first one is declared winner, while the other one is declared defeated;
- one of the players is in check, but its current move keep the king in check. This player is declared defeated and its opponent wins the game.
- When the game is over, an appropiate message will be displayed on the status bar. The Forfeit button becomes a Back button now. When pressed, the client is disconnected from the server and redirected to Main Menu.
- The server does not save information about new users or user progress if killed.
- Server C code starting point. Retrieved from here;
- Client C code starting point. Retrieved from here;
- Shogi rules and terminology. Retrieved from here;
- LNCS format and document template. Retrieved from here;
- Information about TCP. Retrieved from here;
- A portion of the server diagram (slide 47). Retrieved from here;
- Multithreading tutorial. Retrieved from here;
- SFML tutorials. Retrieved from here;
- SFML documentation. Retrieved from here;
- How to get dimensions of text in SFML. Retrieved from here;
- How to center text into button in SFML. Inspired from here;
- C++ documentation pages for String, Vector, Unordered Set, Thread
- Conversion from string to char array. Retrieved from here;
- Conversion from int to string. Retrived from here;
- How to use C++ ternary operator ?. Retrieved from here;
- How to install SFML with CodeBlocks. Revrieved from here;
- Wooden textures for board, buttons and captured pieces zones. Retrieved from here;
- Merge font. Retrieved from here;
- Mistuki font used to write Main menu title. Retrieved from here;
- How to create arrowheads in Illustrator. Retrieved from here;
- Markdown tutorial. Retrieved from here