474ck

This is an old revision of the document!


474ck

474ck is a very simple client-server game using ContextNet for notifications in real time.

There is a map showing the player's position and a circle showing the area you are observing. Any players that enter this area will appear on the map.

To download the source code, click here. Unpack the zip or rar file in a folder preserving the tree structure as shown:

The standard Java library and two additional libraries are required to compile the application:

The application is divided into two executable modules: StatusJogoServidor is the service that keeps players' positions and scores; and MapaJogador is the client.

To run the application you also need an OpenSplice server. You can use Primstech OpenSplice, an open-source SDDL implementation which can be downloaded from http://www.prismtech.com/dds-community.

First, start the ContextNet server. It requires an installed OpenSplice server and some environment variables. Check installation and running instructions at http://www.lac-rio.com/dokuwiki/doku.php?id=installingdds. By default choose as gateway 127.0.0.1 and port 5500.

  • Starting ContextNet:

java -jar <path to ContextNet>/contextnet-2.5.jar <gateway address> <port> OpenSplice

Now one can start one session of StatusJogoServidor, and any number of MapaJogador clients. When MapaJogador starts it opens a command prompt asking for a player name. Once you give a name it opens the map. It will show the player's last position, or it will be blank if it's the first time this player connects to this session.

Left-click on the map to inform your new position. Your score increases by 1 or 2 points whenever you find 1 or 2 players near the area you chose, each of them loses 1 point. It decreases if you find 3 or more players, their score increases by 1 point and you lose as much points as players you just found. It is a zero sum game. You can choose how large is your search area on the field at the top left corner of the map.

When you move away from a region, circles from players outside your new position will be shadowed, until you return there (and then it disappears if that player is no longer there), or until you find that player again. If you pick a small radius, other players can come close to you without appearing on your map. If you pick a very large radius, it will be harder to find less than 3 players on each move.

This work is a task of Introduction to Mobile Computing course, 2016, second semester. Computer Department, PUC-Rio.

Ranieri Batista: rbcosta@inf.puc-rio.br

  • 474ck.1478059302.txt.gz
  • Last modified: 2017/07/21 02:49
  • (external edit)