Implementation of My Shelfie, a board game created by Cranio Creations (Rulebook).
The project task is to implement in Java a distributed system composed of a single server and multiple clients (one per player) that simulates the board game My Shelfie.
Clients can interact with the server both via CLI and GUI, JavaFX is used for the latter. The network layer is implemented both using sockets and Java RMI.
Inside the deliverables folder there are UML diagrams and pdf documents to show the structure of the code and explain each design choice. Classes, interfaces and methods are well described using javadoc. Each aspect of the software was tested using the framework JUnit, the test coverage report is also provided.
Feature | Status | Description |
---|---|---|
Complete game | 🟢 | |
RMI | 🟢 | Network layer using RMI |
Socket | 🟢 | Network layer using sockets |
CLI | 🟢 | Command line interface, on clients |
GUI | 🟢 | JavaFX on clients |
Multiple matches | 🟢 | The server supports multiple matches at the same time |
Persistence | 🟢 | The status of each match is saved on the server and can be restored |
Disconnection handling | 🟢 | If a client crashes, the match continues skipping its turns; clients can reconnect |
Chat | 🟢 | Messages between players during the match |
Download the jar archive AM09-MyShelfie from assets related to the latest release, you need to have java 11 installed (or newer). The application has to be started in a terminal with the following command, an interactive cli menu will guide you through the configuration process:
java -jar AM09-MyShelfie.jar
If you prefer to specify (some or all) options as command line arguments, you can use the following syntax.
To start the server:
java -jar AM09-MyShelfie.jar --server --ip <server_ip> --tcp <socket_port> --rmi <rmi_port>
To start the client:
java -jar AM09-MyShelfie.jar --client --ip <server_ip>
then you can choose between CLI and GUI with --cli
and --gui
options, between RMI and Socket with --rmi <port>
and --tcp <port>
.
RMI should be able to choose the correct network interface automatically with its relative IP, but if you encounter problems connecting to a server with an RMI client you can set the environment variable RMI_LOCAL_IP
to the correct IP address.
Use export RMI_LOCAL_IP=<ip_address>
on Linux and MacOS, set RMI_LOCAL_IP=<ip_address>
in a Windows cmd terminal, $env:RMI_LOCAL_IP = '<ip_address>'
in PowerShell.
The server saves the status of each game running at the end of every turn, it uses a json file to store the information. The file is located and looked for in the current working directory, please be sure to start the server from a directory containing the files related to the games you intend to restore.
- Adorni Michele @Mik-Ado michele.adorni@mail.polimi.it
- Brunetta Giacomo @giacomo-brunetta giacomo.brunetta@mail.polimi.it
- Cantonetti Gianluca @CantonettiGianluca27 gianluca.cantonetti@mail.polimi.it
- Carlotto Edoardo @Dudoleitor edoardo.carlotto@mail.polimi.it
My Shelfie is property of Cranio Creations and all of the copyrighted graphical assets used in this project were supplied by Politecnico di Milano in collaboration with their rights' holders.