Package | com.whirled.avrg |
Class | public class RoomSubControlServer |
Inheritance | RoomSubControlServer ![]() ![]() ![]() ![]() ![]() |
Implements | MessageSubControl |
See also
Property | Defined by | ||
---|---|---|---|
props : PropertySubControl
[read-only]
Accesses the properties for this room.
| RoomSubControlServer |
Method | Defined by | ||
---|---|---|---|
![]() |
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener.
| AbstractControl | |
despawnMob(id:String):void
Destroys a previosuly spawned MOB in this room.
| RoomSubControlServer | ||
![]() |
doBatch(fn:Function, ... args):void
Execute the specified function as a batch of commands that will be sent to the server
together.
| AbstractSubControl | |
![]() |
getAvatarInfo(playerId:int):AVRGameAvatar
Gets all available information on the avatar of a player with the given id.
| RoomSubControlBase | |
getMobSubControl(id:String):MobSubControlServer
Gets a MOB previously spawned in this room with the given id.
| RoomSubControlServer | ||
![]() |
getMusicOwnerId():int
Get the playerId of the owner of the currently playing music, aka the player who added it
to the playlist, or 0 if there is no music currently playing.
| RoomSubControlBase | |
![]() |
getOccupantIds():Array
Gets an array of the ids of all the occupants in this room.
| RoomSubControlBase | |
![]() |
getOccupantName(playerId:int):String
Get the name of the specified occupant, who may be a player, or null if not found.
| RoomSubControlBase | |
![]() |
getPlayerIds():Array
Gets an array of the ids of all the players in this room.
| RoomSubControlBase | |
![]() |
getRoomBounds():Rectangle
Get the room's bounds in pixel coordinates.
| RoomSubControlBase | |
getRoomId():int
Gets the id of this room.
| RoomSubControlServer | ||
![]() |
getRoomName():String
Returns the name of this room.
| RoomSubControlBase | |
![]() |
getSpawnedMobs():Array
Returns an array of
String s corresponding to the ids of all the MOBs in this
room. | RoomSubControlBase | |
![]() |
getTargetId():int
Get the targetId on which this control operates.
| TargetedSubControl | |
![]() |
isConnected():Boolean
Are we connected and running inside the whirled environment, or has someone just
loaded up our SWF by itself?
| AbstractSubControl | |
![]() |
isPlayerHere(id:int):Boolean
Tests if a player of a given id is in this room.
| RoomSubControlBase | |
![]() |
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 the players that are in the room.
| RoomSubControlServer | ||
sendSignal(name:String, value:Object = null):void
Sends a signal to all instances of all entities in the room.
| RoomSubControlServer | ||
spawnMob(id:String, name:String, x:Number, y:Number, z:Number):void
Creates a new MOB in this room.
| RoomSubControlServer |
Event | Summary | Defined by | ||
---|---|---|---|---|
![]() | Dispatched when something has changed about a player's avatar in this room. | RoomSubControlBase | ||
![]() | Dispatched when a MOB has been created. | RoomSubControlBase | ||
![]() | Dispatched when music starts playing in the room. | RoomSubControlBase | ||
![]() | Dispatched when music stops playing in the room. | RoomSubControlBase | ||
![]() | Dispatched either when somebody in this room entered our current game, or somebody playing the game entered this room. | RoomSubControlBase | ||
![]() | Dispatched either when somebody in this room left our current game, or somebody playing the game left this room. | RoomSubControlBase | ||
![]() | Dispatched when a player in this room takes up a new location. | RoomSubControlBase | ||
Dispatched when a room has unloaded and is no longer accessible. | RoomSubControlServer | |||
![]() | Dispatched when a signal has been received in this room. | RoomSubControlBase | ||
![]() | Event.UNLOAD Dispatched when the SWF using this control has been unloaded. | AbstractControl |
props | property |
props:PropertySubControl
[read-only]Accesses the properties for this room. Room properties marked as such will be persisted and restored whenever the room is occupied anew.
Implementation public function get props():PropertySubControl
See also
despawnMob | () | method |
public function despawnMob(id:String):void
Destroys a previosuly spawned MOB in this room.
Parametersid:String |
See also
getMobSubControl | () | method |
public function getMobSubControl(id:String):MobSubControlServer
Gets a MOB previously spawned in this room with the given id. Null is returned if there is no MOB with that id.
Parametersid:String |
MobSubControlServer |
getRoomId | () | method |
public override function getRoomId():int
Gets the id of this room. Room ids are the same as scene ids and are the same each time the room is visited. They may also be used directly to access a scene (www.whirled.com/#world-s{sceneId}).
Returnsint |
sendMessage | () | method |
public function sendMessage(name:String, value:Object = null):void
Sends a message to all the players that are in the room. Clients receive the message by
listening for MESSAGE_RECEIVED
on RoomSubControlClient
.
name:String |
|
value:Object (default = null )
|
See also
sendSignal | () | method |
public function sendSignal(name:String, value:Object = null):void
Sends a signal to all instances of all entities in the room. The same size restrictions as EntityControl.sendSignal() apply here too.
Parametersname:String |
|
value:Object (default = null )
|
See also
spawnMob | () | method |
public function spawnMob(id:String, name:String, x:Number, y:Number, z:Number):void
Creates a new MOB in this room. The id identifies the instance of the MOB and the name specifies the type. The call will do nothing if a MOB already exists in this room with the given id. The coordinates specify the initial location of the MOB in room coordinates. The visual representation of the MOB is created on the clients using the client's sprite exporter callback.
Parametersid:String |
|
name:String |
|
x:Number |
|
y:Number |
|
z:Number |
See also
roomUnloaded | event |
com.whirled.avrg.AVRGameRoomEvent
com.whirled.avrg.AVRGameRoomEvent.ROOM_UNLOADED
Dispatched when a room has unloaded and is no longer accessible. Note that once this has happened, any further API methods called (except getRoomId()) will throw errors and no further events will be dispatched on it. The purpose of this event is for local cleanup, deregistration of event listeners, clearing out data structures and the like.