Packagecom.electrotank.electroserver5.api
Classpublic class QuickJoinGameRequest
InheritanceQuickJoinGameRequest Inheritance EsRequest Inheritance EsMessage Inheritance flash.events.Event

This request is used to create a new game on the server, or to join a game that matches the criteria passed in. This server feature is called the Game Manager. In order to use a game with the Game Manager the game must be registered with the server via the Remote Admin. A game is essentially just a room with one or more plugins associated with it. All games that are managed can be searched using the FindGamesReqest. A game can be joined via QuickJoinGameRequest or by using the JoinGameRequest and specifying a specific game id. You can learn of a game id by someone telling you via various server messaging techniques, or by loading a list of games using the FindGamesRequest and looking at the game ids. This example shows how to create a fictional game of poker. If the game was registered with the server as PokerGame, and if the game plugin was set up to receive and interpret the custom EsObject passed in, then this is what the code to create or join such a game would look like.
private var _es:ElectroServer;
private function initialize():void {
        _es.engine.addEventListener(MessageType.CreateOrJoinGameResponse.name, onCreateOrJoinGameResponse);
        _es.engine.addEventListener(MessageType.JoinRoomEvent.name, onJoinRoomEvent);
        //create the request
        var qjr:QuickJoinGameRequest = new QuickJoinGameRequest();
        //gameType is the name of the game as registered on the server
        qjr.gameType = "PokerGame";
        //zone in which to put the game
        qjr.zoneName = "GameZone";
        //should the game show up in the room list
        qjr.hidden = false;
        //if true, the game is automatically locked when you join until unlocked
        qjr.locked = false;
        //if true, then the request won't look for an existing game for you to join, it will only create one
        qjr.createOnly = false;
        //optional EsObject of data to pass into the game
        var esob:EsObject = new EsObject();
        esob.setInteger("potLimit", 2500);
        esob.setInteger("tableSize", 8);
        qjr.gameDetails = esob;
        _es.engine.send(qjr);
}
private function onJoinRoomEvent(e:JoinRoomEvent):void {
        trace("Joined the game room");
}
private function onCreateOrJoinGameResponse(e:CreateOrJoinGameResponse):void {
        trace("Joined game: " + e.successful.toString());
}



Public Properties
 PropertyDefined By
  createOnly : Boolean
If true, then the request doesn't first try to search for an existing game for you to join.
QuickJoinGameRequest
  criteria : SearchCriteria
A search criteria object used for a greater level of matching.
QuickJoinGameRequest
  gameDetails : EsObject
Optional custom EsObject to be passed into the initialization event in the plugin when the game is created.
QuickJoinGameRequest
  gameType : String
The game type as registered with the server via the Remote Admin.
QuickJoinGameRequest
  hidden : Boolean
If true, the room that is the game is hidden from the room list.
QuickJoinGameRequest
  locked : Boolean
If true, then the game is locked as soon as you join it (if you're the one that created it).
QuickJoinGameRequest
 InheritedmessageNumber : int
EsMessage
 InheritedmessageType : MessageType
EsMessage
  password : String
Optional password used when creating or joining a game.
QuickJoinGameRequest
 InheritedrequestId : int
EsMessage
 InheritedserverId : String
EsMessage
  zoneName : String
Name of the zone to create the game in.
QuickJoinGameRequest
Public Methods
 MethodDefined By
  
QuickJoinGameRequest(m:MessageType = null, t:TBase = null)
QuickJoinGameRequest
  
fromThrift(t_:TBase):void
[override]
QuickJoinGameRequest
  
newThrift():TBase
[override]
QuickJoinGameRequest
  
toThrift():TBase
[override]
QuickJoinGameRequest
Property Detail
createOnlyproperty
createOnly:Boolean

If true, then the request doesn't first try to search for an existing game for you to join. It will only create a new game. If false, the server will search for an already open game that meets the criteria specified in this request.


Implementation
    public function get createOnly():Boolean
    public function set createOnly(value:Boolean):void
criteriaproperty 
criteria:SearchCriteria

A search criteria object used for a greater level of matching. This can be used to say, search for only games that are using a specify game map.


Implementation
    public function get criteria():SearchCriteria
    public function set criteria(value:SearchCriteria):void
gameDetailsproperty 
gameDetails:EsObject

Optional custom EsObject to be passed into the initialization event in the plugin when the game is created.


Implementation
    public function get gameDetails():EsObject
    public function set gameDetails(value:EsObject):void
gameTypeproperty 
gameType:String

The game type as registered with the server via the Remote Admin.


Implementation
    public function get gameType():String
    public function set gameType(value:String):void
hiddenproperty 
hidden:Boolean

If true, the room that is the game is hidden from the room list.


Implementation
    public function get hidden():Boolean
    public function set hidden(value:Boolean):void
lockedproperty 
locked:Boolean

If true, then the game is locked as soon as you join it (if you're the one that created it). The game can later be unlocked by the game plugin.


Implementation
    public function get locked():Boolean
    public function set locked(value:Boolean):void
passwordproperty 
password:String

Optional password used when creating or joining a game.


Implementation
    public function get password():String
    public function set password(value:String):void
zoneNameproperty 
zoneName:String

Name of the zone to create the game in.


Implementation
    public function get zoneName():String
    public function set zoneName(value:String):void
Constructor Detail
QuickJoinGameRequest()Constructor
public function QuickJoinGameRequest(m:MessageType = null, t:TBase = null)



Parameters
m:MessageType (default = null)
 
t:TBase (default = null)
Method Detail
fromThrift()method
override public function fromThrift(t_:TBase):void

Parameters

t_:TBase

newThrift()method 
override public function newThrift():TBase

Returns
TBase
toThrift()method 
override public function toThrift():TBase

Returns
TBase