Packagecom.whirled.avrg
Classpublic class GameSubControlServer
InheritanceGameSubControlServer Inheritance GameSubControlBase Inheritance AbstractSubControl Inheritance AbstractControl Inheritance flash.events.EventDispatcher
ImplementsMessageSubControl

Provides services for AVR game server agents.

See also

AVRServerGameControl.game


Public Properties
 PropertyDefined by
  props : PropertySubControl
[read-only] Accesses the global properties for this game.
GameSubControlServer
Public Methods
 MethodDefined by
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener.
AbstractControl
 Inherited
doBatch(fn:Function, ... args):void
Execute the specified function as a batch of commands that will be sent to the server together.
AbstractSubControl
 Inherited
getItemPacks():Array
Returns the set of all item packs available to this game as an array of objects with the following properties:
     ident - string identifier of item pack
     name - human readable name of item pack
     mediaURL - URL for item pack content
     
GameSubControlBase
 Inherited
getLevelPacks():Array
Returns the set of all level packs available to this game as an array of objects with the following properties:
     ident - string identifier of item pack
     name - human readable name of item pack
     mediaURL - URL for item pack content
     premium - boolean indicating that content is premium or not
     
GameSubControlBase
 Inherited
getOccupantName(playerId:int):String
Get the name of an occupant of the game, or null if not found.
GameSubControlBase
 Inherited
getParty(partyId:int):PartySubControl
Get the party control for the specified party.
GameSubControlBase
 Inherited
getPartyIds():Array
Return the ids of all parties presently in this game.
GameSubControlBase
 Inherited
getPlayerIds():Array
Returns an array of the ids of all players who have joined and not yet quit the game.
GameSubControlBase
 Inherited
isConnected():Boolean
Are we connected and running inside the whirled environment, or has someone just loaded up our SWF by itself?
AbstractSubControl
 Inherited
loadItemPackData(ident:String, onLoaded:Function, onFailure:Function):void
Loads the binary data for the item pack with the specified ident.
GameSubControlBase
 Inherited
loadLevelPackData(ident:String, onLoaded:Function, onFailure:Function):void
Loads the binary data for the level pack with the specified ident.
GameSubControlBase
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Unregisters an event listener.
AbstractControl
  
sendMessage(name:String, value:Object = null):void
Sends a message to all players in this game.
GameSubControlServer
Events
 EventSummaryDefined by
 Inherited Dispatched when a message arrives with information that is not part of the shared game state.GameSubControlBase
 Inherited Dispatched when a party arrives in the game.GameSubControlBase
 Inherited Dispatched when a party leaves the game.GameSubControlBase
   Dispatched when a new player joins the game.GameSubControlServer
   Dispatched when a player leaves the game.GameSubControlServer
 Inherited Event.UNLOAD Dispatched when the SWF using this control has been unloaded.AbstractControl
Property detail
propsproperty
props:PropertySubControl  [read-only]

Accesses the global properties for this game. Game properties marked as such will be persisted and restored whenever the server agent starts. Persistent properties should only be used when genuinely necessary.

Implementation
    public function get props():PropertySubControl

See also

Method detail
sendMessage()method
public function sendMessage(name:String, value:Object = null):void

Sends a message to all players in this game. Use carefully since the resulting outgoing message load could be significant. Games that overload the server are subject to discretionary action. Players receive game messages by adding a listener to the GameSubControlClient.

Parameters
name:String
 
value:Object (default = null)

See also

Event detail
playerJoinedGameevent 
Event object type: com.whirled.avrg.AVRGameControlEvent
AVRGameControlEvent.type property = com.whirled.avrg.AVRGameControlEvent.PLAYER_JOINED_GAME

Dispatched when a new player joins the game. This event is guaranteed to be the first event concerning a particular player during that player's session. It will normally be followed immediately by a ENTERED_ROOM event.

An event type dispatched when somebody joined the AVRG.
name - not used
value :int - the id of the player who has joined

See also

playerQuitGameevent  
Event object type: com.whirled.avrg.AVRGameControlEvent
AVRGameControlEvent.type property = com.whirled.avrg.AVRGameControlEvent.PLAYER_QUIT_GAME

Dispatched when a player leaves the game. This event is guaranteed to be the last event concerning a particular player during that player's session. Any requests related to the player will fail after the player has quit. The event will normally be immediately preceded by a LEFT_ROOM event.

An event type dispatched when somebody is leaving the AVRG.
name - not used
value :int - the memberId of the player

See also