- Il gioco
- Funzionalità implementate
- Installazione
- Server
- Client
- Come giocare
- Tools
- Test e Documentazione
Questo repo contiene una versione Java del gioco Maestri del rinascimento. Il progetto è stato sviluppato durante l'anno 2020/21 per il corso di Ingegneria del Software al Politecnico di Milano, come parte finale di valutazione per il conseguimento della laurea triennale in Ingegneria Informatica. Gli sviluppatori sono stati:
Funzionalità | Stato |
---|---|
Regole Semplificate | |
Regole Complete | |
Socket | |
CLI | |
GUI | |
Partite Multiple | |
Resilienza | |
Partita Locale | |
Persistenza | |
Editor dei parametri |
Non Implementato
Implementazione in corso
Implementato
Per avviare il gioco è necessario scaricare JavaSE 15 (o versioni superiori). Il giocatore che creerà la partita, per poter hostare il server, può decidere di installare ngrok, sebbene siano disponibili altre modalità che la guida non coprirà.
Scaricare in locale il repository come segue
git clone https://github.com/williamzeni99/Maestri-del-Rinascimento.git
su linux. Per windows potrebbe essere necessario scaricare il repo in formato zip ed estrarlo.
I file eseguibili per il gioco sono contenuti nella cartella /shade
.
Entrare nella cartella con l'eseguibile di ngrok e aprire una connessione TCP alla porta 12345
. Sia dalla bash Linux, sia dalla PowerShell di Windows, è possibile farlo attraverso il comando (la bash deve essere aperta nella stessa dir di ngrok)
./ngrok tcp 12345
Il numero della porta deve essere necessariamente quella indicata. Se si volesse modificare la porta, sarà necessario modificare l'attributo nella classe Server
e ricompilare i file .jar .
Successivamente aprire la PowerShelf Windows o la bash linux all'interno della cartella \shade
e digitare
java -jar SERVERG_C39.jar
Ora il server è attivo e può essere lasciato acceso fino a quando non si vuole smettere di giocare, anche se si vogliono disputare più partite.
Per poter collegare il client al server sarà necessario aprire la PowerShelf Windows o la bash linux all'interno della cartella \shade
e digitare
java -jar CLIENT_C39.jar ADDRESS PORT
dove ADDRESS
e PORT
sono rispettivamente l'indirizzo e la porta del server. Nel caso di ngrok il messaggio potrebbe essere
Session Status: online
Account: YOURACCOUNT (Plan: Free)
Version: 2.3.40
Region: United States (us)
Web Interface: http://127.0.0.1:4040
Forwarding: tcp://4.tcp.ngrok.io:11387 -> localhost:12345
Di conseguenza, 4.tcp.ngrok.io sarà l'indirizzo mentre 11387 sarà la porta.
Di default il client aprirà la parte grafica, tuttavia è possibile giocare via linea di comando attraverso l'aggiunta del parametro cli
java -jar CLIENT_C39.jar ADDRESS PORT cli
Le modalità di inizio partita possono essere tre: la prima consiste in una partita privata nella quale un utente può creare una stanza e tutti gli altri giocatori possono connettersi (si noti che il creatore della stanza deve comunicare il nome della stanza agli altri giocatori per poter accerdere) ; la seconda consiste nel poter giocare online con qualsiasi utente connesso al server (questa modalità avrebbe senso se le coordinate del server fossero pubbliche), basterà difatto solo identificarsi con un nome e inserirsi in una partia da un massimo di 4 giocatori; la terza non necessità di un server, ma si può giocare solo da soli.
Le regole del gioco italiane si trovano all'interno del repository qui
Nota bene: è sempre possibile riconettersi ad una partita in corso se si memorizzano il proprio nickname
e il nome della room
.
Per la realizzazione del progetto sono stati utilizzati :
La documentazione è disponibile qui.
I test hanno raggiunta la seguente copertura.
This repo contains a Java version of the game Masters of renaissance. The project has been developed for the course Software Engineering at Politecnico di Milano as a final part of examination for the Bachelor in Computer Engineering. The contributors were:
Functionalities | Status |
---|---|
Basic Rules | |
Complete Rules | |
Socket | |
CLI | |
GUI | |
Multiple Games | |
Resilience | |
Local Game | |
Persistence | |
Parameter Editor |
Not Implemented
Implementing
Implemented
To start the game you need to download JavaSE 15 (or updated versions). The player that will start the match can install ngrok to host the game. Other options are available but will not be covered in this guide.
Download the repo as it follow
git clone https://github.com/williamzeni99/Maestri-del-Rinascimento.git
on linux. For Windows should be necessary download the repo in zip format and then unzip it.
The executable files are stored in the /shade
directory.
Open the ngrok directory with the terminal (linux or windows) and open a TCP connection at port 12345
, as it follow
./ngrok tcp 12345
The port number has to be 12345
. If it should be necessary to modify the port, open the project class Server
and edit the attribute, then rebuild the .jar file.
Open the terminal at dir \shade
and copy
java -jar SERVERG_C39.jar
Now the server has started and can be leaved powered on even a match ends.
To connect the client will be necessary open the terminal at the \shade
dir and copy
java -jar CLIENT_C39.jar ADDRESS PORT
where ADDRESS
and PORT
are the server address and port. In our case, the ngrok app will print a text as it follow
Session Status: online
Account: YOURACCOUNT (Plan: Free)
Version: 2.3.40
Region: United States (us)
Web Interface: http://127.0.0.1:4040
Forwarding: tcp://4.tcp.ngrok.io:11387 -> localhost:12345
4.tcp.ngrok.io will be the address and 11387 the port.
On default the client will open the GUI, but if you add the parameter cli
at the end of the command it will be possible start the game from command-line.
java -jar CLIENT_C39.jar ADDRESS PORT cli
A game can be started in three different ways: I can create a room where my friends can join me (a room can be joined through its name); I can join an online public multiplayer filling the infos with my personal nickname and with how many players I want play with; I can play alone offline.
You can find the english rules here
Ps. It is alway possible rejoin an alredy started match if I have my nickname
and the room
name.
In this project were used the following tools:
You can find the documentation here.
The tests have reached the following coverage.