Packagecom.whirled.contrib.avrg.probe
Classpublic class ServerModule

Object to serve the ClientPanel's request to invoke server API calls. Methods and their arguments are sent in messages, the method looked up in ServerDefinitions and called and the result or error sent back to the client in another message. Also does very basic tracking of the game's currently active players and rooms so that all their events can listened for and logged.

See also

com.whirled.contrib.avrg.probe.ServerDefinitions
com.whirled.contrib.avrg.probe.ClientPanel


Protected Properties
 PropertyDefined by
  _active : Boolean
ServerModule
  _ctrl : AVRServerGameControl
ServerModule
  _defs : ServerDefinitions
ServerModule
  _playerRooms : Dictionary
ServerModule
  _roomOccupantCounts : Dictionary
ServerModule
Public Methods
 MethodDefined by
  
ServerModule(ctrl:AVRServerGameControl)
Creates a new server module, targeting a given game control.
ServerModule
  
activate():void
ServerModule
  
deactivate():void
ServerModule
Protected Methods
 MethodDefined by
  
addLogger(ctrl:IEventDispatcher, events:Array):void
ServerModule
  
handleGameMessage(evt:MessageReceivedEvent):void
ServerModule
  
handlePlayerJoin(event:AVRGameControlEvent):void
ServerModule
  
handlePlayerQuit(event:AVRGameControlEvent):void
ServerModule
  
handleRoomEntry(event:AVRGamePlayerEvent):void
ServerModule
  
handleRoomExit(event:AVRGamePlayerEvent):void
ServerModule
  
logEvent(event:Event):void
ServerModule
  
makeGenericCallback(origMessage:Object, senderId:int):Function
ServerModule
  
removeLogger(ctrl:IEventDispatcher, events:Array):void
ServerModule
  
unwatchPlayer(playerId:int):void
ServerModule
  
unwatchRoom(roomId:int):void
ServerModule
  
watchPlayer(playerId:int):void
ServerModule
  
watchRoom(roomId:int):void
ServerModule
Public Constants
 ConstantDefined by
  BACKEND_CALL_RESULT : String = "backend.call.result"
[static] Message name for sending the results of a invoking a server agent API method back to the client.
ServerModule
  CALLBACK_INVOKED : String = "callback.invoked"
[static] Message name for sending the arguments passed to a callback parameter back to the client.
ServerModule
  REQUEST_BACKEND_CALL : String = "request.backend.call"
[static] Message name for invoking a server agent API method.
ServerModule
Property detail
_activeproperty
protected var _active:Boolean
_ctrlproperty 
protected var _ctrl:AVRServerGameControl
_defsproperty 
protected var _defs:ServerDefinitions
_playerRoomsproperty 
protected var _playerRooms:Dictionary
_roomOccupantCountsproperty 
protected var _roomOccupantCounts:Dictionary
Constructor detail
ServerModule()constructor
public function ServerModule(ctrl:AVRServerGameControl)

Creates a new server module, targeting a given game control.

Parameters
ctrl:AVRServerGameControl
Method detail
activate()method
public function activate():void
addLogger()method 
protected function addLogger(ctrl:IEventDispatcher, events:Array):voidParameters
ctrl:IEventDispatcher
 
events:Array
deactivate()method 
public function deactivate():void
handleGameMessage()method 
protected function handleGameMessage(evt:MessageReceivedEvent):voidParameters
evt:MessageReceivedEvent
handlePlayerJoin()method 
protected function handlePlayerJoin(event:AVRGameControlEvent):voidParameters
event:AVRGameControlEvent
handlePlayerQuit()method 
protected function handlePlayerQuit(event:AVRGameControlEvent):voidParameters
event:AVRGameControlEvent
handleRoomEntry()method 
protected function handleRoomEntry(event:AVRGamePlayerEvent):voidParameters
event:AVRGamePlayerEvent
handleRoomExit()method 
protected function handleRoomExit(event:AVRGamePlayerEvent):voidParameters
event:AVRGamePlayerEvent
logEvent()method 
protected function logEvent(event:Event):voidParameters
event:Event
makeGenericCallback()method 
protected function makeGenericCallback(origMessage:Object, senderId:int):FunctionParameters
origMessage:Object
 
senderId:int

Returns
Function
removeLogger()method 
protected function removeLogger(ctrl:IEventDispatcher, events:Array):voidParameters
ctrl:IEventDispatcher
 
events:Array
unwatchPlayer()method 
protected function unwatchPlayer(playerId:int):voidParameters
playerId:int
unwatchRoom()method 
protected function unwatchRoom(roomId:int):voidParameters
roomId:int
watchPlayer()method 
protected function watchPlayer(playerId:int):voidParameters
playerId:int
watchRoom()method 
protected function watchRoom(roomId:int):voidParameters
roomId:int
Constant detail
BACKEND_CALL_RESULTconstant
public static const BACKEND_CALL_RESULT:String = "backend.call.result"

Message name for sending the results of a invoking a server agent API method back to the client.

CALLBACK_INVOKEDconstant 
public static const CALLBACK_INVOKED:String = "callback.invoked"

Message name for sending the arguments passed to a callback parameter back to the client.

REQUEST_BACKEND_CALLconstant 
public static const REQUEST_BACKEND_CALL:String = "request.backend.call"

Message name for invoking a server agent API method.