Skip to content

Java based SKUNK Game applying SSE (Server-Side Events) technology to enable clients to receive automatic updates from a server via HTTP connection.

Notifications You must be signed in to change notification settings

paulonegrao/skunk-game

Repository files navigation

SKUNK Game

Description

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.

skunkgame

Main components

The app (SkunkGame) has the following components:

  1. 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);
  2. Player.java: class that represents each individual player with methods to perform the player/tokens movements in the game;
  3. Dice.java: class that simulates all the necessary dice for the game;
  4. DiceRotation: class that controls all the possible dice rotations/results;
  5. Score.java: class that handles the individual and total scores of the game;
  6. index.jsp: a unique JSP to receive the movements/instructions from the Player.java class and render the graphic interface presentation accordingly.

SSE technology

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.

Accessing a Heroku Demo of the game

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!

To start the SKUNKGAME app on tomcat:

sh target/bin/webapp

To run the app on localhost

https://localhost:8080

To Check PID running on port 8080

lsof -i :8080

To kill process

kill -9 <PID>

About

Java based SKUNK Game applying SSE (Server-Side Events) technology to enable clients to receive automatic updates from a server via HTTP connection.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published