7.1 KiB
Mesos — Software Engineering 2026
Group GC14 — Pirrera · Radice · Pagani · Pellegrino
Implemented Features
| Feature | Status |
|---|---|
| Full game rules | ✅ |
| TUI (Text User Interface) | ✅ |
| GUI (JavaFX) | ✅ |
| Network — RMI | ✅ |
| Network — Socket/TCP | ✅ |
| AF1 — Persistence | ✅ |
| AF2 — Disconnection resilience | ✅ |
Notes on advanced features
AF1 — Persistence
The server automatically saves the game state to disk (GameSaves/save.dat) after every game event. If the server is restarted, the saved game is automatically restored and clients can reconnect. The save is discarded only if, at the time of the crash, all players except at most one were disconnected.
AF2 — Disconnection resilience A client that loses connection is marked as disconnected but the game does not end. The game continues with the remaining players. The disconnected player can reconnect at any time with the same username and find the game in its current state.
System Requirements
- Java 25 or higher
- JARs are fat-jars (all dependencies included), no external libraries need to be installed
Launch — Server
java -jar Server.jar
On startup the server lists the active IPv4 network interfaces and asks the operator to choose one (required for correct RMI operation on a local network). If only one interface is present, it is selected automatically.
Example output:
[0] eth0 -> 192.168.1.10
[1] eth1 -> 192.168.95.7
Choose interface: 0
192.168.1.10
Server RMI: 192.168.1.10
Ports used by the server (must not be blocked by the firewall):
| Protocol | Port |
|---|---|
| RMI registry | 1099 |
| TCP game | 8080 |
| TCP heartbeat | 8081 |
Launch — TUI Client
java -jar ClientTUI.jar
On startup the client interactively asks:
| Field | Accepted values |
|---|---|
Username |
free string, max 10 characters |
Number of players [2-5] |
integer between 2 and 5 |
Network [rmi/tcp] |
rmi or tcp |
Server IP [localhost] |
server IP address; empty enter uses localhost |
Available in-game commands (TUI)
| Command | Description |
|---|---|
slot <pos> |
Moves the totem to the slot at position <pos> |
draw upper tribe <pos> |
Draws the tribe card at position <pos> from the upper row |
draw upper building <pos> |
Draws the building card at position <pos> from the upper row |
draw lower tribe <pos> |
Draws the tribe card at position <pos> from the lower row |
draw lower building <pos> |
Draws the building card at position <pos> from the lower row |
totem <pos> |
Chooses the totem at position <pos> (totem selection phase) |
skip |
Skips the turn (if no other actions can be performed) |
clear |
Redraws the board on screen |
details buildings |
Shows the description of all buildings |
details events |
Shows the description of all events |
details characters |
Shows the description of all characters |
rematch |
Returns to the login screen (end of game only) |
quit |
Disconnects and closes the client |
The TUI supports Tab autocomplete for all commands.
Launch — GUI Client
java -jar ClientGUI.jar
The graphical window opens directly. Fill in the fields on the login screen:
- Username — player name
- N. players — number of players (2–5)
- Protocol — RMI / TCP toggle (click to switch)
- Server IP — server IP address
Press Login to connect. The GUI starts in fullscreen mode; press ESC to exit fullscreen and F11 to re-enter it.
Local Testing (all on localhost)
-
Open a terminal and start the server:
java -jar Server.jar -
Open N terminals (one per client) and start the clients:
# TUI java -jar ClientTUI.jar # or GUI java -jar ClientGUI.jar -
As soon as the configured number of players has connected, the game starts automatically.
LAN Testing
- The server runs on the machine with IP e.g.
192.168.1.10. - Start the server and choose the
192.168.1.10interface. - Clients on other machines enter that IP as
Server IP. - Make sure ports 1099, 8080, 8081 are reachable from the network.
Project Structure
src/main/java/it/polimi/ingsw/gc14/
├── Controller/ # GameController (server) and ClientController (client)
├── Model/ # Game entities: Player, Game, Board, Card, Slot, ...
│ ├── Cards/ # BuildingCard, TribeCard, EventCard, Character
│ ├── GamePackage/ # Board, CurrentState, GameStages
│ └── Orders/ # Player ordering logic
├── Network/ # Network protocols
│ ├── RMI/ # RMI client and server
│ ├── TCP/ # TCP client and server
│ └── NetworkEvents/ # All serializable network events
├── View/
│ ├── GUI/ # JavaFX screens (Login, Totem, Main, Leaderboard)
│ └── TUI/ # Text renderer with JLine
├── ServerLauncher.java
├── ClientLauncherGUI.java
└── ClientLauncherTUI.java
Deliverables
All deliverables are located in the deliverables/ folder and organized as follows:
Coverage
Contains code-coverage reports. The folder includes screenshot summaries (.JPG) and the full HTML report under htmReport/ — open htmReport/index.html in a browser for the interactive view.
JAR
Executable fat-JARs for all three components of the application:
| File | Role |
|---|---|
Server.jar |
Game server |
ClientTUI.jar |
Text-based client |
ClientGUI.jar |
JavaFX graphical client |
See the Launch sections above for usage instructions.
Javadoc
Auto-generated API documentation for the entire project. Open deliverables/JAVADOC/index.html in a browser to browse packages and classes.
UML Diagrams
Static UML class diagrams describing the project architecture:
| File | Content |
|---|---|
Model_UML.pdf |
Full model layer class diagram |
MiniModel_UML.pdf |
Simplified model overview |
Server_UML_detail.pdf |
Server-side component detail |
Client_UML_detail.pdf |
Client-side component detail |
Sequence Diagrams
deliverables/Sequence_Diagrams/
UML sequence diagrams covering the main network flows:
| File | Scenario |
|---|---|
SEQ_RMI_Connection.png |
RMI client connection handshake |
SEQ_RMI_FULL.png |
Full RMI game flow |
SEQ_TCP_Connection.png |
TCP client connection handshake |
SEQ_TCP_FULL.png |
Full TCP game flow |
SEQ_TCP_Reconnection.png |
TCP client reconnection after disconnect |
Persistence — Technical Details
The save file is created in the directory from which the server JAR is launched:
./GameSaves/save.dat
To force a new game (ignoring the save) simply delete this file before starting the server.