Forum QuickConnect I lose my development console after login

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

I lose my development console after login

Postby lightbeam » January 14th, 2012, 8:51 am

Hello, I seem to have run into slight confusion. When I login a user using simpleuser connect. The connectID remains unchanged unless I did.

[flash=]public function sendLogin(u:String,p:String) {
PlayerIO.quickConnect.simpleConnect(
stage,
"mygameid",
u,
p,
function(c:Client):void{
username = u; //The one I use for the game.
client = c //This is where I want you to look
chatConnection.send("logged",username);
client.bigDB.loadMyPlayerObject(function(userLogged:DatabaseObject):void{
trace(userLogged.username);
})
},
function(e:PlayerIOError):void{
//
});
}[/flash]
Is this the right way to do things? I don't connect users like the tictactoe example which is before they enter the game. You always enter as a guest with the connectID as "GuestUser" and there is a login button that you can use whenever you want.
The connectID being a read-only value can never be changed until I specified that the client that was used for login should be equal to my main client.

Now after I do that, and enter a game, I can't debug in the development server anymore. Am I doing something wrong? Let me know if you need any more info.
lightbeam
 
Posts: 23
Joined: November 4th, 2011, 5:57 pm

Re: I lose my development console after login

Postby Benjaminsen » January 14th, 2012, 4:24 pm

Not 100% sure what is going on in your code. However it sounds like your trying to simply override the client object, this will not work.

Said in another way client objects are totally separate objects. What this means is that you must set the client.multiplayer.developmentServer, event listeners etc individually for each client object.

Say you have already connected to a room with a guest user, the user now chooses to login. In that case you must disconnect your guest user from the room and connect with the authenticated user. Likewise you must set ...multiplayer.developmentServer for each instance of a client.

/Chris
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark

Re: I lose my development console after login

Postby lightbeam » January 14th, 2012, 4:52 pm

Ohh thank you Chris. I was forgetting to set the development server after I login.
lightbeam
 
Posts: 23
Joined: November 4th, 2011, 5:57 pm


Return to QuickConnect



cron