The image above is property of hutter-trade.
This project consists in the digitalization of a board game using the java language, previously introduced in the course of Ingegneria del Software (Software Engineering).
Check out the latest release and download the files (preferably all in the same folder).
Navigate to the folder where you downloaded your files and follow the instructions:
Warning: the
Server.jarandFatJar.jarhave to be run with different commands! For correct compatibility, stick with eitherServer.jar <-> Client.jarconfiguration orFatJar.jarconfiguration
Run the command:
java -jar Server.jar <RMI port> <TCP port> [Server IP]
(the order of the arguments is important)
The IP can be omitted: the app will list the local machine IPs and prompt the user to select one of them (other than
localhost)
Run:
java -cp FatJar.jar it.polimi.ingsw.network.Server <RMI port> <TCP port> [Server IP]
Run the command:
java -jar Client.jar <Server port> <RMI | TCP> [Server IP] [myIP=<Client IP>]
(arguments can be in any order).
- The IPs are optional: if omitted, localhost will be used;
- The
myIP=<IP>argument is also optional, as it is only used by RMI. It must be an IP reachable by the server.
Replace Client.jar with FatJar.jar in the command right above👆:
java -jar FatJar.jar <Server port> <RMI | TCP> [Server IP] [myIP=<Client IP>]
Please note that compiling the project using Maven creates a FatJar.
- The IP arguments can be hostnames instead of IP addresses (a.b.c.d)
- All arguments other than IPs/Hostnames are validated on launch and the app will quit if an argument is invalid.
- If the IP/Hostname argument is invalid, the app will instead list all available IPs on the local machine and prompt the user to input a valid IP address.
- If a machine only has one IP (other than localhost) then that IP will be used automatically.
The first thing that should appear when looking should be a message that asks which kind of UI to use.
The options are:
The TUI (Text User Interface) is an interactive terminal that lets the user control the program through a set of commands.
The command syntax is the following:
command value|other value|<player_id>
- command is the command keyword (it is always the first word). Commands are listed below👇;
<description>indicates a command argument ;valueindicates an argument that must be the given value;value|<description>|other valueindicates multiple alternatives for that argument (only use one);
A list of TUI commands:
| Command | Description |
|---|---|
| help | list all available commands |
| view | change screen to view other play areas or the main board |
| place | play one of the cards into your hand |
| draw | draw a card from the specified deck |
| flip | filp one of your cards upside down |
| move | on play area view move your view in the specified direction |
| send | send a message to another player |
More information about TUI commands in the MANUAL.
It is advisable to run the TUI in fullscreen (press Ctrl+Enter in the terminal) or in a large enough window to allow the proper visualization of all scenes. If any scene does not display properly, enlarge the window and press Enter to refresh.
The TUI uses ANSI color codes. They should show correctly on Mac/Linux consoles, but they are disabled on Windows CMD by default.
You can enable them by following the instruction below:
- Press
Win+R - Type
regeditand press enter or click on ok - Navigate to
HKEY_CURRENT_USER\Console - Check if the
VirtualTerminalLevelvalue is present:- If not present then right-click on the
Consoledirectory and pressNew -> DWORDto add it with value1 - Otherwise change its value to
1
- If not present then right-click on the
The GUI (Graphical User Interface) is what you'll be more accustomed since most of modern applications usually have one.
When prompted as the first screen, insert a nickname and press enter to attempt connecting to the server.
After this screen if you are the first player to connect you will be prompted to select the number of players in the lobby:
If ever in doubt check the MANUAL
The integral version of project requirements can be found here.
| Requirements | Max Reachable Grade | Implemented |
|---|---|---|
| Simplified Rules + TUI + RMI or Socket | 18 | ✅ |
| Complete Rules + TUI + RMI or Socket | 20 | ✅ |
| Complete Rules + TUI + RMI or Socket + 1 AF | 22 | ✅ |
| Complete Rules + TUI + GUI + RMI or Socket + 1 AF | 24 | ✅ |
| Complete Rules + TUI + GUI + RMI + Socket + 1 AF | 27 | ✅ |
| Complete Rules + TUI + GUI + RMI + Socket + 2 AF | 30 | ✅ |
| Complete Rules + TUI + GUI + RMI + Socket + 3 AF | 30L | ❌ |
| Advanced functionalities | Description | Implemented |
|---|---|---|
| Multiple matches | Handle more matches simultaneously | ❌ |
| Persistance | Set up periodic saves so that a match can be restored even if a server crash occurs | ❌ |
| Disconnection resilience | Reconnect disconnected or crashed users | ✅ |
| Chat | Let players send messages via chat | ✅ |
For a thorough description of the rules check the RULE-BOOK
Codex Naturalis is a board game developed and published by Cranio Creations SRL.
The graphic content of this project related to the board game is used with the prior approval of Cranio Creations SRL solely for educational purposes. Distribution, copying, or reproduction of the content and images in any form outside the project is prohibited, as is the redistribution and publication of the content and images for purposes other than those mentioned above. The commercial use of the aforementioned content is also prohibited.


