org.mgif
Interface ActorSession


public interface ActorSession

An ActorSession object represents a specific user in the context of a particular application instance (game). Each user can be present in multiple applications at the same time, and thus be associated with several ActorSession objects. There is a one-to-many relationship between the user and ActorSession. An ActorSession is created by the Platform and joined to the appropriate Application Instance. ActorSession interface contains ActorSessionID which pared with ApplicationInstanceID and ApplicationID is used to access actor session persistent state. The corresponding ActorSession object in the game handles inputs received from a specific user. Output to the user is sent through the ActorSession object. An ActorSession is the actual representation of a user Session in a game. Application Instance - ActorSession Relations: ? An application instance can manage several actors simultaneously – optional for version 1.0 of MGIF standard platform. ? A user can be represented simultaneously in several application instances (games). A user can simultaneously play in all those game boards (optional for version 1.0 of MGIF standard platform) Note: The decision on whether a user can play simultaneously in several instances of the same game is a commercial production decision of the operator, and the application cannot make any assumptions to that effect.


Method Summary
 MeteringEvent createMeteringEvent(int meteringEventTypeId)
          Creates metering event
 long createTimer(java.util.Date expirationTime, java.util.Map params)
          Creates a new timer for this ActorSession.
 void delete()
          Deletes the ActorSession.
 Actor getActor()
          Returns Actor object related to this ActorSession.
 ApplicationInstance getApplicationInstance()
          Returns the ApplicationInstance related to this ActorSession object.
 Logger getLogger()
          Logger a logger used to log messages to the application log.
 MessageFactory getMessageFactory()
          Return mesage factory to generate push messages for user associated with this ActorSession object.
 java.lang.String getNickName()
          Returns the nickname of the actor session
 ScoreManager getScoreManager()
          Creates and returns the ScoreManager
 void joinToApplicationInstance(long targetApplicationInstance, java.util.Map params)
          Joins the ActorSession related user to some other application instance by sending him joinEvent.
 

Method Detail

createMeteringEvent

public MeteringEvent createMeteringEvent(int meteringEventTypeId)
Creates metering event
Parameters:
meteringEventTypeId - The system tye ID of desired metring event
Returns:
The metering event which can be used to perform any metering operation.

createTimer

public long createTimer(java.util.Date expirationTime,
                        java.util.Map params)
Creates a new timer for this ActorSession. The method onActorSessionTimer on the OnActorSessionTimer interface is called when the timer expires.
Parameters:
expirationTime - the time when this timer is set to expire
params - Timer parameters transferred to handled ActorSessionTimerEvent
Returns:
the ID of the created timer. This ID can be used later to cancel timer or to identify timer when TimerEvent is handled.

delete

public void delete()
Deletes the ActorSession. As a result org.mgif.listener.OnDelete.onDelete() hook is called if the ActorSession impelemnt org.mgif.listener.OnDelete interface.

getActor

public Actor getActor()
Returns Actor object related to this ActorSession.
Returns:
The Actor object related to this ActorSession

getApplicationInstance

public ApplicationInstance getApplicationInstance()
Returns the ApplicationInstance related to this ActorSession object. Each ApplicationInstance can contain 0 or more ActorSessions, and each ActorSession belongs to one and only one ApplicationInstance
Returns:
ApplicationInstance object which contains this ActorSession object

getLogger

public Logger getLogger()
Logger a logger used to log messages to the application log.
Returns:
The application logger

getMessageFactory

public MessageFactory getMessageFactory()
Return mesage factory to generate push messages for user associated with this ActorSession object.
Returns:
MessageFactory object associated with specific user.

getNickName

public java.lang.String getNickName()
Returns the nickname of the actor session
Returns:
Nickname of the actor sesion

getScoreManager

public ScoreManager getScoreManager()
Creates and returns the ScoreManager
Returns:
The ScoreManager object

joinToApplicationInstance

public void joinToApplicationInstance(long targetApplicationInstance,
                                      java.util.Map params)
Joins the ActorSession related user to some other application instance by sending him joinEvent. As a result new ActorSession will be created and connected to target ApplicationInstance object, if this exists.
Parameters:
targetApplicationInstance - System ID of ApplicationInstance object to which new ActorSession will be connected. This ID should be valid at time of execution of join operation.
params - Set of parameters transferred to target application instance and viewed as part of JoinEvent object when join event is handled.


Copyright © 2002 Mobile Games Interoperability Forum. All rights reserved.
This source code is protected by the legal notice posted at http://www.mgif.org/docs/notice.html