Packageplayerio
Classpublic class QuickConnect
InheritanceQuickConnect Inheritance Object

Used to authenticate users towards 3rd party user bases. This class must be accessed via PlayerIO.quickConnect



Public Methods
 MethodDefined By
  
facebookConnect(stage:Stage, gameId:String, uid:String, sessionKey:String, partnerId:String, callback:Function = null, errorHandler:Function = null):void
Authenticate a user towards Facebook
QuickConnect
  
facebookConnectPopup(stage:Stage, gameId:String, window:String, permissions:Array, partnerId:String, callback:Function = null, errorHandler:Function = null):void
Connects the user to Player.IO via Facebook, by opening a Facebook login window where the user can enter his Facebook credentials to login to your game.
QuickConnect
  
facebookOAuthConnect(stage:Stage, gameId:String, accessToken:String, partnerId:String, callback:Function = null, errorHandler:Function = null):void
QuickConnect
  
facebookOAuthConnectPopup(stage:Stage, gameId:String, window:String, permissions:Array, partnerId:String, callback:Function = null, errorHandler:Function = null):void
QuickConnect
  
kongregateConnect(stage:Stage, gameid:String, userid:String, gameauthtoken:String, callback:Function = null, errorhandler:Function = null):void
Authenticate a user towards Kongreate
QuickConnect
  
simpleConnect(stage:Stage, gameid:String, usernameOrEmail:String, password:String, callback:Function = null, errorhandler:Function = null):void
Authenticate a user towards the Player.IO simple user database
QuickConnect
  
simpleGetCaptcha(gameId:String, width:int, height:int, callback:Function = null, errorHandler:Function = null):void
QuickConnect
  
simpleRecoverPassword(gameId:String, usernameOrEmail:String, callback:Function = null, errorHandler:Function = null):void
Sends an recover password email to a user stored using the Player.IO simple user database.
QuickConnect
  
simpleRegister(stage:Stage, gameid:String, username:String, password:String, email:String, captchaKey:String, captchaValue:String, extraData:Object = null, partnerId:String, callback:Function = null, errorhandler:Function = null):void
Creates a user in the Player.IO simple user database
QuickConnect
Method Detail
facebookConnect()method
public function facebookConnect(stage:Stage, gameId:String, uid:String, sessionKey:String, partnerId:String, callback:Function = null, errorHandler:Function = null):void

Authenticate a user towards Facebook

Parameters

stage:Stage — A reference to the base stage of your project.
 
gameId:String — Unique ID that identifies which game the client will try to connect to
 
uid:String — Faceboook userid of the user you wish to authenticate.
 
sessionKey:String — Session key of the user you wish to authenticate
 
partnerId:String — String that identifies a possible affiliate partner.
 
callback:Function (default = null) — Function executed on successful connect: function(client:Client):void{...}
 
errorHandler:Function (default = null) — Function executed if the request failed: function(error:PlayerIOError):void{...}

See also

facebookConnectPopup()method 
public function facebookConnectPopup(stage:Stage, gameId:String, window:String, permissions:Array, partnerId:String, callback:Function = null, errorHandler:Function = null):void

Connects the user to Player.IO via Facebook, by opening a Facebook login window where the user can enter his Facebook credentials to login to your game.

Parameters

stage:Stage — A reference to the base stage of your project.
 
gameId:String — Unique ID that identifies which game the client will try to connect to
 
window:String — The browser window or HTML frame in which to display the document indicated by the request parameter. You can enter the name of a specific window or use one of the following values: _self, _blank, _parent, _top
 
permissions:Array — What extended facebook permissions do you want access to? see: http://developers.facebook.com/docs/authentication/permissions for more info
 
partnerId:String — String that identifies a possible affiliate partner.
 
callback:Function (default = null) — Function executed on successful connect: function(client:Client, api_key:String, uid:String, session_key:String, secret:String):void{...}
 
errorHandler:Function (default = null) — Function executed if the request failed: function(error:PlayerIOError):void{...}

facebookOAuthConnect()method 
public function facebookOAuthConnect(stage:Stage, gameId:String, accessToken:String, partnerId:String, callback:Function = null, errorHandler:Function = null):void

Parameters

stage:Stage — A reference to the base stage of your project.
 
gameId:String — Unique ID that identifies which game the client will try to connect to
 
accessToken:String — Facebook OAuth access token
 
partnerId:String — Function executed on successful connect: function(client:Client, facebookuserid:String):void{...}
 
callback:Function (default = null) — Function executed if the request failed: function(error:PlayerIOError):void{...}
 
errorHandler:Function (default = null)

facebookOAuthConnectPopup()method 
public function facebookOAuthConnectPopup(stage:Stage, gameId:String, window:String, permissions:Array, partnerId:String, callback:Function = null, errorHandler:Function = null):void

Parameters

stage:Stage — A reference to the base stage of your project.
 
gameId:String — Unique ID that identifies which game the client will try to connect to
 
window:String — The browser window or HTML frame in which to display the document indicated by the request parameter. You can enter the name of a specific window or use one of the following values: _self, _blank, _parent, _top
 
permissions:Array — What extended facebook permissions do you want access to? see: http://developers.facebook.com/docs/authentication/permissions for more info
 
partnerId:String — String that identifies a possible affiliate partner.
 
callback:Function (default = null) — Function executed on successful connect: function(client:Client, access_token:String, facebookuserid:String):void{...}
 
errorHandler:Function (default = null) — Function executed if the request failed: function(error:PlayerIOError):void{...}


Example
Using facebookOAuthConnectPopup to connect to Player.IO
         PlayerIO.quickConnect.facebookOAuthConnectPopup(stage, "[YOUR-GAME-ID]", "_blank", [], function(client:Client, access_token:String, facebookuserid:String):void{
                 trace("Connected", client, access_token, facebookuserid);                                                                                      
         },function(e:PlayerIOError):void{
                 trace("Got", e)
         });
         
kongregateConnect()method 
public function kongregateConnect(stage:Stage, gameid:String, userid:String, gameauthtoken:String, callback:Function = null, errorhandler:Function = null):void

Authenticate a user towards Kongreate

Parameters

stage:Stage — A reference to the base stage of your project.
 
gameid:String — Unique ID that identifies which game the client will try to connect to
 
userid:String — Kongregate userid
 
gameauthtoken:String — Kongreate gameauthtoken
 
callback:Function (default = null) — Function executed on successful connect: function(client:Client):void{...}
 
errorhandler:Function (default = null) — Function executed if the request failed: function(error:PlayerIOError):void{...}

See also

simpleConnect()method 
public function simpleConnect(stage:Stage, gameid:String, usernameOrEmail:String, password:String, callback:Function = null, errorhandler:Function = null):void

Authenticate a user towards the Player.IO simple user database

Parameters

stage:Stage — A reference to the base stage of your project.
 
gameid:String — Unique ID that identifies which game the client will try to connect to
 
usernameOrEmail:String — Username or email of the user you wish to authenticate
 
password:String — Password of the user you wish to authenticate
 
callback:Function (default = null) — Function executed on successful connect: function(client:Client):void{...}
 
errorhandler:Function (default = null) — Function executed if the request failed: function(error:PlayerIOError):void{...}


Example
Example of how to connect to Player.IO using simpleConnect
         PlayerIO.quickConnect.simpleConnect(stage, "[game-id]", "Username", "Password", function(client:Client):void{
                 trace("Connected", client);                                                                                      
         },function(e:PlayerIOError):void{
                 trace("Got", e)
         });
         
simpleGetCaptcha()method 
public function simpleGetCaptcha(gameId:String, width:int, height:int, callback:Function = null, errorHandler:Function = null):void

Parameters

gameId:String — Unique ID that identifies which game the client will try to connect to
 
width:int — the width of the generated CAPTCHA
 
height:int — the height of the generated CAPTCHA
 
callback:Function (default = null) — Function executed when a CAPTCHA has been successfully generated: function(captchaKey:String, captchaImageUrl:String):void{...}
 
errorHandler:Function (default = null) — Function executed if the request failed: function(error:PlayerIORegistrationError):void{...}

simpleRecoverPassword()method 
public function simpleRecoverPassword(gameId:String, usernameOrEmail:String, callback:Function = null, errorHandler:Function = null):void

Sends an recover password email to a user stored using the Player.IO simple user database.

Parameters

gameId:String — Unique ID that identifies which game the client will try to connect to
 
usernameOrEmail:String — Username or email of the user that wishes to recover their passsword
 
callback:Function (default = null) — Function executed on successful sending of recover email: function():void{...}
 
errorHandler:Function (default = null) — Function executed if the request failed: function(error:PlayerIOError):void{...}

simpleRegister()method 
public function simpleRegister(stage:Stage, gameid:String, username:String, password:String, email:String, captchaKey:String, captchaValue:String, extraData:Object = null, partnerId:String, callback:Function = null, errorhandler:Function = null):void

Creates a user in the Player.IO simple user database

Parameters

stage:Stage — A reference to the base stage of your project.
 
gameid:String — Unique ID that identifies which game the client will try to connect to
 
username:String — Username of the user you wish to create
 
password:String — Password of the user you wish to create
 
email:String — Email of the user you wish to create (This field can be optional)(
 
captchaKey:String — Used if CAPTCHA is enabled. This value is the key returned from simpleGetCaptcha
 
captchaValue:String — Used if CAPTCHA is enabled. Should be what the users sees on the CAPTCHA image.
 
extraData:Object (default = null) — Extra data attached to the user on creation
 
partnerId:String — String that identifies a possible affiliate partner.
 
callback:Function (default = null) — Function executed on successful connect: function(client:Client):void{...}
 
errorhandler:Function (default = null) — Function executed if the request failed: function(error:PlayerIORegistrationError):void{...}