Forum QuickConnect Possible SimpleConnect Issue

Discussion and help relating to PlayerIO's QuickConnect feature, including Facebook Connect and Kongregate Connect.

Possible SimpleConnect Issue

Postby rluck » March 1st, 2013, 2:59 am

Perhaps this is the intended functionality and if that's the case maybe someone can shed some light on why.

If I call simpleconnect and I receive a "wrong password" error the next time that player logs in it actually calls the given callback twice.

If this is intended functionality how do I remove the first callback?
rluck
 
Posts: 10
Joined: February 1st, 2013, 5:17 am

Re: Possible SimpleConnect Issue

Postby Benjaminsen » March 1st, 2013, 12:36 pm

Show us some code :)
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark

Re: Possible SimpleConnect Issue

Postby rluck » March 1st, 2013, 2:43 pm

Usage of simpleconnect
Code: Select all
PlayerIO.quickConnect.simpleConnect(
   stage,
   'mygame',
   login,
   password,
   OnSuccessfulLogin,
   function(e:PlayerIOError):void {
      ShowErrorWindow(e.message);
   }
);


If I enter the wrong password it obviously goes into ShowErrorWindow. If I then enter the correct password it goes into OnSuccessfulLogin twice. I imagine if I enter the incorrect password twice and then the correct password on the third try it would enter OnSuccessfulLogin three times.
rluck
 
Posts: 10
Joined: February 1st, 2013, 5:17 am

Re: Possible SimpleConnect Issue

Postby Benjaminsen » March 13th, 2013, 12:44 pm

I just wrote this test example to verify this claim:

Code: Select all
package{
   import flash.display.Sprite;
   
   import playerio.Client;
   import playerio.PlayerIO;

   public class Main extends Sprite{
      public function Main(){
         
         connect("234", function():void{
            connect("234", function():void{
               connect("password", function():void{})               
            });
         });
         
      }
      
      private function connect(pwd:String, callback:Function):void{
         PlayerIO.quickConnect.simpleConnect(stage, "mytestgame-feiuiys16eesjpspfchuq", "Chris", pwd, function(c:Client):void{
            trace("Connected", c)
            
         }, function(e:Error):void{
            trace(e);
            callback();
         })
      }
   }
}


Which returns the following output:

PlayerIOError: Wrong password
PlayerIOError: Wrong password
Connected [Player.IO Client]


E.g. I seem to be unable to replicate this behaviour. I think you have some other stuff going on in your code :)
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark

Re: Possible SimpleConnect Issue

Postby Benjaminsen » March 13th, 2013, 12:46 pm

... Thinking a bit about it, I think you are re-attaching mouse listeners when you hit your login button. E.g. for every time your login fails, you add yet another listener, making your users trigger an additional login for every failed login.
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark


Return to QuickConnect