Final Project of Software Engineering, Polytechnic University of Milan, A.Y. 2020/2021. Prof. Alessandro Margara.
Grade: 30 with Honors.
- Damiano Amatruda ([email protected])
- Alessandro Atanassov ([email protected])
- Marco Ciarrocca ([email protected])
The project consists in developing a digital version of the board game Masters of Renaissance (Maestri del Rinascimento), using the Java programming language.
The game needs to be implemented as a distributed system, with a single server and multiple clients that connect to it.
The system must be based on the MVC architecture.
Feature | Implemented |
---|---|
Complete game rules | ✔️ 1+ players supported (see Configuration Files) |
CLI-based client | ✔️ |
GUI-based client | ✔️ |
Communication protocol ("Socket") | ✔️ |
Advanced functionality 1 | ✔️ Multiple games |
Advanced functionality 2 | ✔️ Local game |
Advanced functionality 3 | ✔️ Resilience to disconnections |
To compile the software:
- Install Java SE 16 (earlier versions will not work)
- Install Maven
- Clone this repository
- In the cloned repository folder, run:
mvn package -DskipTests
- The compiled packages (
-server
and-client
JAR files) will be inside the/target
folder.
Usage: java -jar AM49-1.2-client.jar [--cli]
Options:
--cli run in text mode (if omitted the GUI will start instead)
(Windows) The CLI uses colored text, therefore for the CLI the default Windows terminal is not supported and WSL is necessary.
Usage: java -jar AM49-1.2-server.jar [--port PORT] [--config FILE]
Options:
--port PORT network listening port (default 51015)
--config FILE path of the custom configuration file
A Dockerfile
and a docker-compose.yml
are available to build and deploy a
docker container running the server.
To build the container:
- Place the server JAR in the same folder as the Dockerfile
- Rename the JAR file to
server.jar
- Run
docker build -t ingsw-server .
To deploy the container, run docker-compose up -d
in the same folder as the docker-compose.yml
file.
The default configuration file can be found at src/main/resources/config/config.json
.
This file contains all the necessary parameters and the game data needed for the game model to work.
Custom configuration files can be specified from within the clients for Offline games, by going to the Options menu. The custom configuration files loaded in the Options menu will work only for local games, as during Online games clients automatically download the configuration file loaded in the server. To know more about how the game data is synchronized when a client joins an Online game, see the specification of the Communication Protocol.
(Disclaimer) As stated above, the configuration file contains all the game data. The model is completely parameterized, therefore all parameters are necessary and must be specified. Since custom configurations were not a requirement for the project, this functionality has been implemented but not fully tested in all possible configurations.
This project is developed in collaboration with Politecnico di Milano and Cranio Creations.