com.asdf.plugins.hello
Class HelloGame

java.lang.Object
  extended by com.asdf.common.GameController
      extended by com.asdf.plugins.hello.HelloGame
All Implemented Interfaces:
MessageHandler

public class HelloGame
extends GameController

An example game framework provided by the ASDF group to get you a quick start on creating your own great games in our game server system. Intended to function as a first tutorial to working with our server software, not as a tutorial in game programming.


Constructor Summary
HelloGame()
           
 
Method Summary
 void handleRequest(Request req)
          Game logics requests something of you, if you want to do something about it, write some code here.
 void handleResponse(Response rsp)
          Game logics has sent a response.
 void handleStateUpdate(StateUpdate stateUp)
          Game logics has sent a state update message, informing you of the new state of the game world.
 void init(GameResponse arg0, java.lang.String arg1, AccountType arg2)
          When the client is joining the game for the first time, if he wants to something special about it, this is the place.
static void main(java.lang.String[] args)
          Nothing important.
 void start()
          When the game is started, this method is called.
 
Methods inherited from class com.asdf.common.GameController
getConnectionHandler, getGameID, getID, setConnectionHandler, setGameID, setID
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HelloGame

public HelloGame()
Method Detail

start

public void start()
When the game is started, this method is called. Gives you the chance to do what ever initializing you might wish to do.

Specified by:
start in class GameController

handleResponse

public void handleResponse(Response rsp)
Game logics has sent a response. If you wish to react in some way, write some code here.

Parameters:
rsp - Response sent by server. Response is an object generated from XML message using JAXB.

handleRequest

public void handleRequest(Request req)
Game logics requests something of you, if you want to do something about it, write some code here.

Parameters:
req - Request sent by server. Request is an object generated from XML message using JAXB.

handleStateUpdate

public void handleStateUpdate(StateUpdate stateUp)
Game logics has sent a state update message, informing you of the new state of the game world. If you wish to react in some way, for example store the information somewhere, or process your own game world model, this would be a good time to do so.

Parameters:
stateUp - StateUpdate sent by server. StateUpdate is an object generated from XML message using JAXB.

init

public void init(GameResponse arg0,
                 java.lang.String arg1,
                 AccountType arg2)
When the client is joining the game for the first time, if he wants to something special about it, this is the place.

Specified by:
init in class GameController
Parameters:
arg0 - Parameters received from server required to initialize this
arg1 - Account name of the user who is associated with this GameController.
arg2 - Type of the user account. Some users might have more privileges than others. GameController

main

public static void main(java.lang.String[] args)
Nothing important.

Parameters:
args -