Create a JSP with jQuery which contains a table view to monitor the status of users playing an interactive game. Implement server-side classes to provide data.
The page should have:
A table listing each player in a separate row (columns show player info as specified below).
A 'Chat' button.
A 'Notify' button.
A Status text bar.
(more details below).
Each player's information should be displayed in a row in the table.
The columns will be:
- Player Name: The name and an ID of the player (e.g. Jane Doe - 8881)
- Start Time: The time that the player last started playing (e.g. 4:12:15 PM)
- Playing Time: The amount of time that the player has been playing since the last join (e.g. 00:14:15) (which means 14 minutes & 15 seconds).
- Score: The current score of the player.
The user should be able to select one or more players (by clicking on their row in the table).
To select multiple players, the user should do Ctrl-click.
The table should get updated every few seconds (e.g. 5) from a Java class on the server (e.g. [url removed, login to view]) via Ajax:
- The manager (GameManager) will provide a list of all current players and their information.
- The manager class (GameManager) must get the data for each player from another class called [url removed, login to view], which will have the members: id, name, startTime, score.
- For testing, you can just make GameManager increase each player's score by some amount.
- For testing, you should also make GameManager add one or two new players after a minute or so, and then remove a player after another minute or so.
When exactly 1 player is selected, the 'Chat' button should be enabled (otherwise it should get disabled).
When the user clicks the Chat button, a url will be invoked. The Status text bar should show the current time + " Requested chat with " + playerName.
When 1 or more players are selected, the 'Notify' button should be enabled.
When the user clicks on the Notify button, a url will be invoked. The Status text bar should show the current time + " N players notified".