Package | com.whirled.avrg |
Class | public class AVRServerGameControl |
Inheritance | AVRServerGameControl ![]() ![]() |
AVRGame means: Alternate Virtual Reality Game, and refers to games played within the whirled environment with your avatar.
AVR games can be significantly more complicated than lobbied games. Please consult the whirled wiki section on AVRGs as well as the AVRG discussion forum if you're having any problems.
See also
Property | Defined by | ||
---|---|---|---|
game : GameSubControlServer
[read-only]
Accesses the server agent's game sub control.
| AVRServerGameControl | ||
props : PropertySubControl
[read-only]
Accesses the private properties for the server agent: these are not distributed to any
clients and can thus be updated with greater frequency than the game-global ones.
| AVRServerGameControl |
Method | Defined by | ||
---|---|---|---|
Creates a new game control for a server agent.
| AVRServerGameControl | ||
![]() |
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener.
| AbstractControl | |
![]() |
doBatch(fn:Function, ... args):void
Execute the specified function as a batch of commands that will be sent to the server
together.
| AbstractControl | |
getPlayer(playerId:int):PlayerSubControlServer
Accesses the server agent's player sub control for a player with a given id.
| AVRServerGameControl | ||
getRoom(roomId:int):RoomSubControlServer
Accesses the server agent's room sub control for a given room id.
| AVRServerGameControl | ||
![]() |
isConnected():Boolean
Are we connected and running inside the whirled environment, or has someone just
loaded up our SWF by itself?
| AbstractControl | |
loadOfflinePlayer(playerId:int, success:Function, failure:Function):void
Loads the property space of an offline player and calls your function with it as an
argument.
| AVRServerGameControl | ||
![]() |
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Unregisters an event listener.
| AbstractControl |
game | property |
game:GameSubControlServer
[read-only]Accesses the server agent's game sub control.
Implementation public function get game():GameSubControlServer
props | property |
props:PropertySubControl
[read-only]Accesses the private properties for the server agent: these are not distributed to any clients and can thus be updated with greater frequency than the game-global ones. Properties marked as such will be persisted and restored whenever the server agent starts.
Implementation public function get props():PropertySubControl
See also
AVRServerGameControl | () | constructor |
public function AVRServerGameControl(serv:ServerObject)
Creates a new game control for a server agent.
Parametersserv:ServerObject |
getPlayer | () | method |
public function getPlayer(playerId:int):PlayerSubControlServer
Accesses the server agent's player sub control for a player with a given id. Server agents
are notified when a player joins and quits the game by events. An Error
is
thrown if the requested player has not joined the game or has quit.
playerId:int |
PlayerSubControlServer |
See also
getRoom | () | method |
public function getRoom(roomId:int):RoomSubControlServer
Accesses the server agent's room sub control for a given room id. This method will fail by
throwing an Error
if the room is not currently loaded by the server agent. A
room with at least one player in it is guaranteed to be loaded. Server agents are notified
of player entry and exit by events. A room with no players in it should be considered
unloaded after the event is sent for the last player exiting the room.
roomId:int |
RoomSubControlServer |
See also
loadOfflinePlayer | () | method |
public function loadOfflinePlayer(playerId:int, success:Function, failure:Function):void
Loads the property space of an offline player and calls your function with it as an argument. Within this callback, you may read and write persistent properties as you see fit. Note: To preserve some semblance of sanity, you can only load the properties of a player who has already had at least one persistent property set.
ParametersplayerId:int |
|
success:Function |
|
failure:Function |
_ctrl.loadOfflinePlayer(opponentPlayerId, function (props :PropertySubControl) :void { props.setIn("messages", myPlayerId, myMessage); }, function (failureCause :String) :void { log.warn("Eek! Sending message to offline player failed!", "cause", failureCause); });