Package | com.whirled.avrg |
Class | public class PlayerSubControlClient |
Inheritance | PlayerSubControlClient ![]() ![]() ![]() ![]() ![]() |
See also
Method | Defined by | ||
---|---|---|---|
![]() |
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener.
| AbstractControl | |
![]() |
completeTask(taskId:String, payout:Number):void
This method calculates and awards a coin payout for the player.
| PlayerSubControlBase | |
![]() |
deactivateGame():void
Quits the game for this player.
| PlayerSubControlBase | |
![]() |
doBatch(fn:Function, ... args):void
Execute the specified function as a batch of commands that will be sent to the server
together.
| AbstractSubControl | |
getAvatarMasterItemId():int
Returns the master item id of the avatar being worn by the player, or zero for
guests (ghosts) or people wearing the default tofu.
| PlayerSubControlClient | ||
![]() |
getBars():int
Returns this player's current bar balance.
| PlayerSubControlBase | |
![]() |
getCoins():int
Returns this player's current coin balance.
| PlayerSubControlBase | |
getFacebookInfo():Array
Returns the player's Facebook info in a two element array.
| PlayerSubControlClient | ||
![]() |
getPartyId():int
Get the party id of this player.
| PlayerSubControlBase | |
getPlayerId():int
Returns the id of this player.
| PlayerSubControlClient | ||
![]() |
getPlayerItemPacks():Array
Returns all item packs owned by this client's player (the default) or a specified player.
| PlayerSubControlBase | |
![]() |
getPlayerLevelPacks():Array
Returns all level packs owned by this client's player (the default) or a specified player.
| PlayerSubControlBase | |
getPlayerName():String
Returns the name of this player.
| PlayerSubControlClient | ||
![]() |
getRoomId():int
Accesses the id of the room that this player is in.
| PlayerSubControlBase | |
![]() |
getTargetId():int
Get the targetId on which this control operates.
| TargetedSubControl | |
![]() |
holdsTrophy(ident:String):Boolean
Returns true if this client's player (the default) or a specified player has the trophy
with the specified identifier.
| PlayerSubControlBase | |
![]() |
isConnected():Boolean
Are we connected and running inside the whirled environment, or has someone just
loaded up our SWF by itself?
| AbstractSubControl | |
![]() |
moveToRoom(roomId:int, exitCoords:Array = null):void
Instructs this player's client to move to the specified room, or pass 0 to put the player
in no room.
| PlayerSubControlBase | |
![]() |
playAvatarAction(action:String):void
Plays an action on this players avatar.
| PlayerSubControlBase | |
![]() |
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Unregisters an event listener.
| AbstractControl | |
requestConsumeItemPack(ident:String, msg:String):Boolean
Requests to consume the specified item pack.
| PlayerSubControlClient | ||
![]() |
setAvatarLocation(x:Number, y:Number, z:Number, orient:Number):void
Sets the location and orientation of this player's avatar in room coordinates.
| PlayerSubControlBase | |
![]() |
setAvatarState(state:String):void
Sets the stats of this player's avatar.
| PlayerSubControlBase |
Event | Summary | Defined by | ||
---|---|---|---|---|
![]() | Dispatched when this player has just entered a room (or was already in the room and just started playing the game). | PlayerSubControlBase | ||
![]() | Dispatched when this player has left a room (or has chosen to leave the game). | PlayerSubControlBase | ||
Dispatched when a message arrives with information that is not part of the shared game state. | PlayerSubControlClient | |||
![]() | Dispatched when this player has purchased new game content. | PlayerSubControlBase | ||
![]() | Dispatched when this player has consumed an item pack. | PlayerSubControlBase | ||
![]() | Dispatched when this player completes a task and receives a coin payout. | PlayerSubControlBase | ||
![]() | Event.UNLOAD Dispatched when the SWF using this control has been unloaded. | AbstractControl |
getAvatarMasterItemId | () | method |
public function getAvatarMasterItemId():int
Returns the master item id of the avatar being worn by the player, or zero for guests (ghosts) or people wearing the default tofu. The master id will be the same for all purchased copies of a particular catalog avatar and will be a unique value for every original (non-catalog purchased) avatar item.
Returnsint |
getFacebookInfo | () | method |
public function getFacebookInfo():Array
Returns the player's Facebook info in a two element array. The first element is the player's Facebook id the second is their current Facebook session token (or the empty string if we have no session token information for the player). The return value will be null if the player is not currently playing the game through the game's Facebook app.
The Facebook id is only available to games that have specified a Facebook app configuration for their game and only when the player is playing the game through the Facebook app.
ReturnsArray |
getPlayerId | () | method |
public override function getPlayerId():int
Returns the id of this player. This id is the member id and can be used to view the member's profile (www.whirled.com/#people-{id}).
Returnsint |
getPlayerName | () | method |
public override function getPlayerName():String
Returns the name of this player.
ReturnsString |
requestConsumeItemPack | () | method |
public function requestConsumeItemPack(ident:String, msg:String):Boolean
Requests to consume the specified item pack. The player must currently own at least one copy of the item pack. This will display a standard dialog asking the player if they wish to consume the pack.
If the player accepts the request to consume the item pack, a GameContentEvent.PLAYER_CONTENT_CONSUMED event will be dispatched on this control (on both the client and server).
Parametersident:String — the identifier of the item pack to be consumed.
|
|
msg:String — a message to display in the dialog to help the player understand what's going on.
|
Boolean — true if the dialog was shown, false if the dialog was not shown because the player
is known not to own at least one copy of the item pack.
|
MsgReceived | event |
com.whirled.net.MessageReceivedEvent
com.whirled.net.MessageReceivedEvent.MESSAGE_RECEIVED
Dispatched when a message arrives with information that is not part of the shared game state.
The type of all MessageReceivedEvents.
See also