| Package | com.whirled.contrib.avrg.probe |
| Class | public class ServerModule |
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
| Property | Defined by | ||
|---|---|---|---|
| _active : Boolean | ServerModule | ||
| _ctrl : AVRServerGameControl | ServerModule | ||
| _defs : ServerDefinitions | ServerModule | ||
| _playerRooms : Dictionary | ServerModule | ||
| _roomOccupantCounts : Dictionary | ServerModule | ||
| Method | Defined by | ||
|---|---|---|---|
|
ServerModule(ctrl:AVRServerGameControl)
Creates a new server module, targeting a given game control.
| ServerModule | ||
|
activate():void
| ServerModule | ||
|
deactivate():void
| ServerModule | ||
| Method | Defined 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 | ||
| Constant | Defined 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 | ||
| _active | property |
protected var _active:Boolean
| _ctrl | property |
protected var _ctrl:AVRServerGameControl
| _defs | property |
protected var _defs:ServerDefinitions
| _playerRooms | property |
protected var _playerRooms:Dictionary
| _roomOccupantCounts | property |
protected var _roomOccupantCounts:Dictionary
| ServerModule | () | constructor |
public function ServerModule(ctrl:AVRServerGameControl)Creates a new server module, targeting a given game control.
Parametersctrl:AVRServerGameControl |
| 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 |
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 |
| BACKEND_CALL_RESULT | constant |
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_INVOKED | constant |
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_CALL | constant |
public static const REQUEST_BACKEND_CALL:String = "request.backend.call"Message name for invoking a server agent API method.