Forum QuickConnect All my simple user names start with simple

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

All my simple user names start with simple

Postby azuanagames » August 16th, 2010, 3:34 am

Is this intended? Seems so, but the question is should I just chop off the simple or is there an API call to get the username that was used to register?

I'm currently using the connectUserId.

I guess I can add {username:username} to the SimpleRegister extraData field. Is this the "right" thing to do?

Does this then go into the PlayerObject?

Thanks
azuanagames
 
Posts: 149
Joined: April 29th, 2010, 10:59 pm

Re: All my simple user names start with simple

Postby Henrik » August 16th, 2010, 11:20 am

Yes, the connectuserid has to be unique across different user databases, that is how we ensure it won't collide with Kongregate or Facebook users.

Currently there is no API for retrieving the registration data, it is only displayed in the admin panel. Saving something in the extradata field doesn't put it in the BigDB PlayerObject, it's also something that's just displayed in the admin panel, and appears when you export your player data.

We could possibly add an API for retrieving this data, I'm trying to remember why we didn't, I vaguely remember there being a good reason. :-)

On the other hand, since you need the username to call connect, you have the data in the client already, so you could keep it instead of looking it up again.
Henrik
.IO
 
Posts: 1840
Joined: January 4th, 2010, 1:53 pm

Re: All my simple user names start with simple

Postby azuanagames » August 16th, 2010, 1:08 pm

Henrik wrote:Yes, the connectuserid has to be unique across different user databases, that is how we ensure it won't collide with Kongregate or Facebook users.

Right, that makes perfect sense.
Henrik wrote:Currently there is no API for retrieving the registration data, it is only displayed in the admin panel. Saving something in the extradata field doesn't put it in the BigDB PlayerObject, it's also something that's just displayed in the admin panel, and appears when you export your player data.

We could possibly add an API for retrieving this data, I'm trying to remember why we didn't, I vaguely remember there being a good reason. :-)

Should be fine, though someday it maybe nice to access the data.
Henrik wrote:On the other hand, since you need the username to call connect, you have the data in the client already, so you could keep it instead of looking it up again.

So I should just add my fields to the joinData? That should work just fine. I want the usernames on the server to let OTHER clients know the usernames.

Thanks again
azuanagames
 
Posts: 149
Joined: April 29th, 2010, 10:59 pm

Re: All my simple user names start with simple

Postby Benjaminsen » August 16th, 2010, 1:14 pm

I suggest that you store the data in the Player.IO BigDB PlayerObject as it's made specifically to store this type of data.

ConnectedUserID is basically just an id. The fact that the UserID and UserName fields sometimes overlaps is just a result of how we integrated QuickConnect. IE If you connect with Facebook, you get ids formated as such: fbxxxxxxxx
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark

Re: All my simple user names start with simple

Postby azuanagames » August 16th, 2010, 4:06 pm

Benjaminsen wrote:I suggest that you store the data in the Player.IO BigDB PlayerObject as it's made specifically to store this type of data.


I'm not sure I understand the workflow for this.

When do I have access to a user's PlayerObject on the client? (loadMyPlayerObject doesn' seem to exist? At least it's not documented in the BigDB docs.)

I assume I get access to my PlayerObject once I actually connect? At that point I have a access to BigDB. So do I set my username into BigDB at this point? After my first connection?

I know that I have access to the PlayerObjects on the server. No issues there.

Though I'm not sure that using the PlayerObject buys me anything? At least not for the username. I mean I can simply use the joinData to let the server know the users name (I have to store the username anyway, either by saving it to BigDB or supplying it in joinData). After that, I can just keep the username on the Player object. No need to involve the DB. I do have other data that I would want to store in the DB.

Set me straight please! :)
azuanagames
 
Posts: 149
Joined: April 29th, 2010, 10:59 pm

Re: All my simple user names start with simple

Postby Benjaminsen » August 16th, 2010, 4:35 pm

The client side loadMyPlayerObject documentation is right here

Using the player object allows you to trust the data given to the server. I could simply impersonate you, by sending in your username in joinData. Depending on your game, this might be more or less important.
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark

Re: All my simple user names start with simple

Postby azuanagames » August 16th, 2010, 7:45 pm

Benjaminsen wrote:The client side loadMyPlayerObject documentation is right here

Using the player object allows you to trust the data given to the server. I could simply impersonate you, by sending in your username in joinData. Depending on your game, this might be more or less important.


Ah the link off of: http://playerio.com/documentation/bigdb/playerobject does not work, points to: http://localhost/documentation/referenc ... ayerObject (note: localhost)

I'll give it a shot. I'm not sure that I see it as any more secure, though I guess I can set the PlayerObject only during the registration process, minimizing any security issues. (Not that this is a big concern of mine. It's not THAT important.)
azuanagames
 
Posts: 149
Joined: April 29th, 2010, 10:59 pm

Re: All my simple user names start with simple

Postby Henrik » August 16th, 2010, 8:47 pm

Oh wow, that's an embarassingly bad link. Thanks for pointing it out, we'll fix it immediately. :-)
Henrik
.IO
 
Posts: 1840
Joined: January 4th, 2010, 1:53 pm

Re: All my simple user names start with simple

Postby azuanagames » August 17th, 2010, 6:55 am

Ok,

So I implemented as you specified. Once I thought about it it makes sense, this is because of the security model you have for BigDB. When I create the PlayerObject initially I am the owner, so no one else can ever change the values there? Is this correct?

I do have additional questions :) Of many more to come, I'm sure!

How should I handle guests? I thought about creating a dummy account with the username guest. The big question is do each guest get there own PlayerObject? They are all simpleguest accounts.

Along with that question, how can I enforce only 1 connection per user? I was thinking that I can tag the PlayerObject with the connection state then I disconnect the previous player if the user re-logs in? If it was a real disconnect they'll automatically be removed from the room, correct?
azuanagames
 
Posts: 149
Joined: April 29th, 2010, 10:59 pm

Re: All my simple user names start with simple

Postby Benjaminsen » August 17th, 2010, 10:31 am

If you set the access rights for PlayerObjects as seen in the image below. Only the Player themselves will be able to edit their player object.
Image
If you want others to be able to load the objects from the client use
Image
The server always have full rights so if you remove Full Creator Rights, only the Server will be able to edit the level.

Regarding guests I suggest you make a separate guest connection type and connect guests to that without Auth.
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark

Re: All my simple user names start with simple

Postby azuanagames » August 17th, 2010, 5:22 pm

Am I allowed to use 2 connections while developing? Or do I need to upgrade to a paid account now?
azuanagames
 
Posts: 149
Joined: April 29th, 2010, 10:59 pm

Re: All my simple user names start with simple

Postby Benjaminsen » August 17th, 2010, 5:24 pm

There is no need to have separate connections while developing, but if you really want them now, feel free to add it, I do not believe that we enforce connections yet.
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark


Return to QuickConnect



cron