| Package | com.whirled.contrib.avrg.oneroom |
| Class | public class OneRoomGameServer |
| Inheritance | OneRoomGameServer com.whirled.ServerObject |
import com.whirled.contrib.avrg.oneroom.OneRoomGameServer;
public class Server extends OneRoomGameServer { roomType = MyRoomType; }
MyRoomType in the example must be a subclass of OneRoomGameRoom.
Instances of this type will be created as needed and those instances will effectively handle
all game activity.
See also
| Property | Defined by | ||
|---|---|---|---|
| gameCtrl : AVRServerGameControl [read-only]
Accesses the game control for this server agent.
| OneRoomGameServer | ||
| log : Log [static] The log sink associated with this agent.
| OneRoomGameServer | ||
| roomType : Class [static] The type of room objects to create.
| OneRoomGameServer | ||
| Property | Defined by | ||
|---|---|---|---|
| _gameCtrl : AVRServerGameControl The game control for this server agent.
| OneRoomGameServer | ||
| _rooms : Dictionary Mapping of room ids to OneRoomGameRoom instances.
| OneRoomGameServer | ||
| Method | Defined by | ||
|---|---|---|---|
|
Creates a new server agent for a game that takes place in exactly one room.
| OneRoomGameServer | ||
| Method | Defined by | ||
|---|---|---|---|
|
createRoom(roomId:int):OneRoomGameRoom
Creates a new room.
| OneRoomGameServer | ||
|
enteredRoom(evt:AVRGamePlayerEvent):void
Tells the agent that a player has entered a room.
| OneRoomGameServer | ||
|
leftRoom(evt:AVRGamePlayerEvent):void
Tells the agent that a player has left a room.
| OneRoomGameServer | ||
|
playerJoinedGame(evt:AVRGameControlEvent):void
Tells the agent that a player has joined the game.
| OneRoomGameServer | ||
|
playerQuitGame(evt:AVRGameControlEvent):void
Tells the agent that a player has quit the game.
| OneRoomGameServer | ||
| _gameCtrl | property |
protected var _gameCtrl:AVRServerGameControlThe game control for this server agent.
| gameCtrl | property |
gameCtrl:AVRServerGameControl [read-only]Accesses the game control for this server agent.
Implementation public function get gameCtrl():AVRServerGameControl
| log | property |
public static var log:LogThe log sink associated with this agent.
| _rooms | property |
protected var _rooms:DictionaryMapping of room ids to OneRoomGameRoom instances.
| roomType | property |
public static var roomType:Class The type of room objects to create. The caller must set this type when the server agent is
instantiated. The set value must be a subclass of OneRoomGameRoom.
See also
| OneRoomGameServer | () | constructor |
public function OneRoomGameServer()Creates a new server agent for a game that takes place in exactly one room.
| createRoom | () | method |
protected function createRoom(roomId:int):OneRoomGameRoomCreates a new room. Subclasses should not normally need to override this.
ParametersroomId:int |
OneRoomGameRoom |
| enteredRoom | () | method |
protected function enteredRoom(evt:AVRGamePlayerEvent):voidTells the agent that a player has entered a room. Takes care of creating a new room object if one does not already exist. This is called by whirled and subclasses should not normally need to override it.
Parametersevt:AVRGamePlayerEvent |
See also
| leftRoom | () | method |
protected function leftRoom(evt:AVRGamePlayerEvent):void
Tells the agent that a player has left a room. If this is the last player in the room, then
calls OneRoomGameRoom.shutdown. This is called by whirled and subclasses should
not normally need to override it.
evt:AVRGamePlayerEvent |
See also
| playerJoinedGame | () | method |
protected function playerJoinedGame(evt:AVRGameControlEvent):voidTells the agent that a player has joined the game. This is called by whirled and subclasses should not normally need to override it.
Parametersevt:AVRGameControlEvent |
| playerQuitGame | () | method |
protected function playerQuitGame(evt:AVRGameControlEvent):voidTells the agent that a player has quit the game. This is called by whirled and subclasses should not normally need to override it.
Parametersevt:AVRGameControlEvent |