• No results found

B.2.1 Servlet

Since SIP messages are used for communication, losing connection causes no problems for the servlet; the game keeps on waiting until the client ends the game, the servlet is restarted or if the game is removed manually from the web interface.

If the servlet is restarted while playing the game, all games are aborted and cannot be resumed. All information about the running games, such as score and progress is destroyed.

Most needed functionality for maintaining the servlet is available through the web interface. That includes monitoring games being played, editing the database and handling the game core itself.

10http://developer.imsinnovation.com/tikiwiki/tiki-view forum thread.php?

comments parentId=438&forumId=6&highlight=restart

B.2.2 Web Interface

Using the web interface for the servlet you can administer the currently running servlet.

Other than the regular web interface, there are a few administrative com-mands you can enter under the admincommand section.

The commands available for MiniGamesCore

Arguments are enclosed in tags (<>), example <minigame>

Optional arguments are enclosed in brackets ([]), example [<minigame>]

help [<minigame>]

If no argument is given, a help message is displayed.

If <minigame> is camgame, it shows the help for camgame.

clear [<log>]

Clears all the log messages in log <log>

There are at the moment two logs, a message log and a core log. These are represented by ’mes’ and ’core’

Example: ’clear core’ or ’clear mes’

echo <string>

Echoes the string <string> to the message log.

version [<minigame>]

Shows the version of MiniGamesCore if no argument is given.

Shows the version of the CamGame if camgame is passed as

<minigame>.

The commands available for CamGameCore

Arguments are enclosed in tags (<>), example <minigame>.

Optional arguments are enclosed in brackets ([]), example [<minigame>].

version

Shows the version number of MiniGamesCore.

camgame end all

Ends all running games.

camgame end <number>

Ends the game with id <number>.

camgame g <number> <command>

sends command <command> to the game instance with id <number>.

camgame list

lists all games running.

version

Shows the version number of MiniGamesCore.

song list

Lists all songs available.

song modify song <id> <melody>

<melody> is the new song. It should be of the form:

<tone>,<len>,<tone>,<len>,...,<tone>,<len>, For example:

song modify 1 67,10,65,10,

It sets the melody of song with id <id> to <melody>.

song modify addedby <id> <user>

<id> is the id of the song to modify.

<user> is the new user that added the song.

Set the user that added the song with id <id> to <user>.

song modify title <id> <title>

<id> is the id of the song to modify.

<title> is the new title.

Set the title of song with id <id> to <title>.

song add <title> [<melody> | <addedby> <melody>]

<title> the title of the song.

<melody> is the melody of the song itself.

<addedby> is the id of the user that added this song.

the form of the melody should be:

<tone>,<len>,<tone>,<len>,...,<tone>,<len>,

Adds a new song with title <title>, melody <melody> and it’s added by the user <addedby>, if specified.

song delete <id>

Deletes the song that has id <id>.

user list

Lists all users.

user add <sip> [<nick>]

Adds the user with sip address <sip> to the database.

If <nick> is given, the nickname of user will be <nick>.

user delete <id>

Deletes the user with id <id>.

user modify nick <id> <attrib> <newvalue>

<id> the users id

<nick> the users nickname

<newnick> the new nickname the user will be referred as.

highscore get <userid> <songid> <difficulty>

Shows the result of the user with id <userid> regarding song with title <song> at difficulty <difficulty>.

highscore list

lists all high scores.

player <id>

Show all players that’s playing the game.

The commands available for CamGameInstance addtime <time>

Adds <time> minutes to the game.

B.2.3 Client

The Client may break in some cases with an out of memory error. Often this occurs because of other running application at the time or even applications

that have been running, before starting the CamGame. Even after closing some applications they still occupy some memory in the phone and it may cause CamGame to run out of memory while playing. To workaround these problem, restart the phone which will in turn clear out the memory.

If for some reason during the game IMS network or the servlet application restarts, then the game state on the servlet will be lost and this will cause the client to fail. The only solution is to restart the game.

It is possible that the phone can lose connection while playing the game. If a message delivery failure occurs, the client will keep trying to send the message until it eventually succeeds. There are still situation where the delivery failure will not be known to the client (this is due to lack of callbacks from the MJCF libraries), resulting in losing the message, and thereby losing information. The solution in this case is to try to redo the last action.

Note that the client relies heavily on the game servlet, so make sure the game servlet, and in extension the IMS network, is stable before you try to run the client.

In document Project Green Fox - Product Report (Page 94-97)

Related documents