Forum QuickConnect How best to handle deferred sign-up?

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

How best to handle deferred sign-up?

Postby wildbunny » April 14th, 2011, 2:44 pm

Hi guys,

My game uses a deferred sign-up, so there is as little user friction as possible with trying the game out...

So, client side everyone starts out being connected via PlayerIO.connect() as a 'Guest' user, and I then call client.multiplayer.createJoinRoom( ) using the 'client' field which is tied to the guest user returned from PlayerIO.connect().

But then in game I allow users to register by calling PlayerIO.quickConnect.simpleRegister(), which returns *another* client field, representing a different connection to the server than the one I'm already using...

The question is, how do I unify these two connections? Do I need to completely sign out of the 'Guest' user connection and call client.multiplayer.joinRoom() using the new client, along with all the associated message handler re-attachment, or is there some magic neater way of doing this? :)

Cheers, Paul.
wildbunny
 
Posts: 217
Joined: March 9th, 2011, 10:35 am

Re: How best to handle deferred sign-up?

Postby Benjaminsen » April 14th, 2011, 2:57 pm

There is no magic, you will have to reconnect to the room with the new user.
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark

Re: How best to handle deferred sign-up?

Postby wildbunny » April 14th, 2011, 3:08 pm

Ok, fair enough :)

Just a quick follow-up question - obviously in order to re-connect, I will need to persist the data in BigDB - is everything stored room-local in BigDb, or do I manually need to associate a roomId with everything that I save?

Cheers, Paul.
wildbunny
 
Posts: 217
Joined: March 9th, 2011, 10:35 am

Re: How best to handle deferred sign-up?

Postby Benjaminsen » April 14th, 2011, 3:19 pm

Players have PlayerObjects which are associated with a specific player. If you need data associated to a room you will have to code that yourself. IE do a BigDB.load etc.

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

Re: How best to handle deferred sign-up?

Postby wildbunny » April 14th, 2011, 4:15 pm

Benjaminsen wrote:Players have PlayerObjects which are associated with a specific player. If you need data associated to a room you will have to code that yourself. IE do a BigDB.load etc.

/Chris


Whats the best way to associate objects in BigDB with a specific room? Do I need to store the roomId string along with every single object? How did you do it on everybody edits?

Cheers, Paul.
wildbunny
 
Posts: 217
Joined: March 9th, 2011, 10:35 am

Re: How best to handle deferred sign-up?

Postby Benjaminsen » April 14th, 2011, 8:09 pm

wildbunny wrote:
Benjaminsen wrote:Players have PlayerObjects which are associated with a specific player. If you need data associated to a room you will have to code that yourself. IE do a BigDB.load etc.

/Chris


Whats the best way to associate objects in BigDB with a specific room? Do I need to store the roomId string along with every single object? How did you do it on everybody edits?

Cheers, Paul.


I suggest simply using the room ID is the key of the BigDB Object
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark


Return to QuickConnect



cron