This is a Java version os SKUNK Game using Java servlets and SSE (Server-Side Events) technology to enable clients (web and mobile) to receive automatic updates from a server via HTTP connection. All clients can interact with the app (select/change tokens' properties/positions, roll dices, etc.). Every interaction will be intercepted by the server, broadcasted to the whole group of clients, and reflected/updated on each individual client browser.
The app (SkunkGame) has the following components:
- SkunkGame.java: class that controls the main components/rules of the game and also handles all connections and messages between the server and its multiple clients (browsers);
- Player.java: class that represents each individual player with methods to perform the player/tokens movements in the game;
- Dice.java: class that simulates all the necessary dice for the game;
- DiceRotation: class that controls all the possible dice rotations/results;
- Score.java: class that handles the individual and total scores of the game;
- index.jsp: a unique JSP to receive the movements/instructions from the Player.java class and render the graphic interface presentation accordingly.
The application is a "many clients to server" configuration, hosted in a Heroku.com dyno, and It is using SSE (Server Sent Events) to be able to perform a "broadcasting transaction", making all the clients(browsers) be simultaneously updated in real time.
To access the app: https://skunkgame.herokuapp.com/
Please, it has to be "http" ok? If you try https it will not work for this prototype version (I a not accepting SSL connections also to avoid the overhead of encryption).
I didn't have time to insert instructions during the game (sorry), but it is resembling the game like performed in class, so it is very intuitive.
Any questions/suggestions will be always welcome. Thank you, Cheers!
sh target/bin/webapp
lsof -i :8080
kill -9 <PID>