org.mega.gasp.server
Class GASPServer

java.lang.Object
  extended byorg.mega.gasp.server.GASPServer
All Implemented Interfaces:
OnDataEvent, OnEndEvent, OnEvent, OnJoinEvent, OnQuitEvent, OnStartEvent

public abstract class GASPServer
extends java.lang.Object
implements OnDataEvent, OnEndEvent, OnJoinEvent, OnQuitEvent, OnStartEvent

A game server logic running on GASP must implement this class GASPServer.

Author:
PELLERIN Romain (pellerin@cnam.fr) - MEGA Project

Field Summary
protected  ApplicationInstance appIns
           
 
Constructor Summary
GASPServer()
           
 
Method Summary
abstract  void onDataEvent(DataEvent de)
          Method called when a DataEvent is received from the platform.
abstract  void onEndEvent(EndEvent ee)
          Method called when a EndEvent is received from the platform.
abstract  void onJoinEvent(JoinEvent je)
          Method called when a JoinEvent is received from the platform.
abstract  void onQuitEvent(QuitEvent qe)
          Method called when a QuitEvent is received from the platform.
abstract  void onStartEvent(StartEvent se)
          Method called when a StartEvent is received from the platform.
protected  int retrieveActorID(int actorSessionID)
          Retrieve the actor ID linked to the actor session ID.
protected  int retrieveApplicationID()
          Retrieve the application ID.
protected  void sendDataTo(int actorSessionID, DataEvent dataEvent)
          Send to the linked applicationInstance a DataEvent for a specific actorSession.
 void setOwnerAI(ApplicationInstance applicationInstance)
          Link the application instance to the game server logic.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

appIns

protected ApplicationInstance appIns
Constructor Detail

GASPServer

public GASPServer()
Method Detail

setOwnerAI

public void setOwnerAI(ApplicationInstance applicationInstance)
Link the application instance to the game server logic.

Parameters:
applicationInstance -

sendDataTo

protected void sendDataTo(int actorSessionID,
                          DataEvent dataEvent)
Send to the linked applicationInstance a DataEvent for a specific actorSession.

Parameters:
actorSessionID -
dataEvent - the DataEvent to send

retrieveActorID

protected int retrieveActorID(int actorSessionID)
Retrieve the actor ID linked to the actor session ID. (persistency) Provide the storage of player game informations.

Parameters:
actorSessionID -

retrieveApplicationID

protected int retrieveApplicationID()
Retrieve the application ID. (persistency) Provide the storage of player game informations.


onJoinEvent

public abstract void onJoinEvent(JoinEvent je)
Method called when a JoinEvent is received from the platform.

Specified by:
onJoinEvent in interface OnJoinEvent
Parameters:
je - a JoinEvent

onStartEvent

public abstract void onStartEvent(StartEvent se)
Method called when a StartEvent is received from the platform.

Specified by:
onStartEvent in interface OnStartEvent
Parameters:
se - a StartEvent

onEndEvent

public abstract void onEndEvent(EndEvent ee)
Method called when a EndEvent is received from the platform.

Specified by:
onEndEvent in interface OnEndEvent
Parameters:
ee - a EndEvent

onQuitEvent

public abstract void onQuitEvent(QuitEvent qe)
Method called when a QuitEvent is received from the platform.

Specified by:
onQuitEvent in interface OnQuitEvent
Parameters:
qe - a QuitEvent

onDataEvent

public abstract void onDataEvent(DataEvent de)
Method called when a DataEvent is received from the platform.

Specified by:
onDataEvent in interface OnDataEvent
Parameters:
de - a DataEvent