Skip to content

fulcus/ing-sw-2020-gonzales-latino-fabris

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Software Engineering Final Project

Run the game

You can download the server and client jars. They can run on linux, macos and windows and include all the needed dependecies for all platforms.

Requirements: Tested and developed with the Oracle JDK 14.

Server

Run the jar with the command java -jar santorini-server.jar

Client

Run the client jar with the command java -jar santorini-client.jar for each player you wish to create


Technologies

  • Java SE 14
  • Maven
  • JavaFX
  • JUnit
  • mockito
  • IntelliJ IDEA

Compile

To run the tests and compile the software:

  1. Install Java SE 14
  2. Install Maven
  3. Clone this repo
  4. In the cloned repo folder, run:
mvn clean compile assembly:single
  1. The compiled artifact will be inside the target folder.

To compile the server you must change the mainClass property of the maven-assembly-plugin in the pom.xml and set it to it.polimi.ingsw.server.Server

Implemented features

  • Complete rules

  • Socket connection

  • Command Line Interface

  • Graphical User Interface using JavaFX

    Advanced features

    • Advanced gods

    • Multiple games

UML

Documentation

Here you can find the javadoc documentation.

Here you can find the rules of the game.

Testing

The model and the controller have been tested using mockito.

Here you can find the coverage report.

Software Design

  • MVC

    The implementation of the chosen MVC pattern is the "hybrid" one in which input controls are also done on the client side to minimize network usage and server load. The controller takes care of managing turns, updating the model and managing events, requests and responses with the Client. On the server there is a Virtual View , on which the Controller calls methods and submits game requests. Virtual View will forward the methods to the client using the output stream.

    • Model

      It represent the status of the game. In particular, there is the information of the single Game, the Players, the Board and all the related information regarding workers and buildings.

    • View

      Provides the user with a representation of the model by saving and updating locally a partial copy of the state of the game. In particular a copy of the Board is saved with all the related information.

    • Controller

    It has the application logic and makes changes to the model, by using user inputs.

  • Observers

    An observer pattern has been used to implement the notification mechanism. In particular, the model and the view represent the observed and the observer respectively. Each cell in the game is observed, and as soon as there is a change in the state of that cell, clients are notified.

    Given the presence of the network, it was necessary to duplicate the observer pattern also on the client. In fact, the client class receives an update from the Network Handler class.

  • Network

    We decided to design the communication between server and client in order to make communication independent from the type of graphical interface chosen by the user. Therefore, the server always sends the same messages regardless of whether the client has chosen to play with CLI or GUI. Furthermore, two types of information are shared: those relating to the game and those useful for monitoring and managing the connection status of clients (PING).

    Inside the server, there is a class that represents the virtual view associated with each client, on which the controller calls the methods which are then forwarded to the physical clients through the network.

    Messages have been divided into: Request (server -> client) and Response (client -> server).

    • Disconnection

      A mechanism has been implemented for detecting disconnections of the client due to network errors or application closing.

      Disconnections caused by voluntary closure of the client are detected by the server through the management of network exceptions (SocketException).

Screenshots

Here are some screenshots from the game

Lobby

picture

God selection

picture

Lobby

picture

Victory

picture

Authors

Francesco Fulco Gonzales

Alberto Latino

Vittorio Fabris

About

Client-Server implementation of the board game "Santorini"

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •