Forum Multiplayer How to tell if user is registered?

Discussion and help relating to the PlayerIO Multiplayer API.

How to tell if user is registered?

Postby Vania » August 9th, 2010, 9:55 pm

Hello, I was browsing the documentation for this but couldnt find it.
How can you tell if a user is a guest or a registered user? (in AS3 and in the server)

I also have a doubt about PlayerObjects:
-If a player is not registered does he have a PlayerObject?
-If the answer is yes, is that object removed when the guest disconnects?

Thank you.
Vania
 
Posts: 198
Joined: March 24th, 2010, 9:01 pm

Re: How to tell if user is registered?

Postby Oliver » August 10th, 2010, 12:07 pm

Hello Vania,

There is no concept of guest and registered user in Player.IO. That's up to you to build on top (you can use QuickConnect for the user-registration/login part)

You supply a user-id in the connect() method, and we bind everything up to that. For instance, every unique user-id will get an associated PlayerObject, that we never delete.

Best,
Oliver
User avatar
Oliver
.IO
 
Posts: 1159
Joined: January 12th, 2010, 8:29 am

Re: How to tell if user is registered?

Postby Vania » August 10th, 2010, 10:51 pm

Hi Oliver, thank you for answering so quick.

1)
I am using QuickConnect already, already made the registration, login forms, etc... and its working.
For the time being I just keep a global variable 'isGuest' to know wheter the user has logged-in with quickconnect or without authentication, and I pass that to the server when joining a room. So, if thats the best way to do it thats cool.

2)
The other thing that is not clear to me is this:
-'guest' users (users that didnt connect with quickconnect) dont have a PlayerObject right?
-so if I try to access the PlayerObject for one of these users do I get an error?
Vania
 
Posts: 198
Joined: March 24th, 2010, 9:01 pm

Re: How to tell if user is registered?

Postby Benjaminsen » August 10th, 2010, 11:07 pm

All users connected to Player.IO are real users, no matter how you connect them, including the non QuickConnect method. Thus all users including "guests" have PlayerObjects.

A simple way to handle guests would be to just connect all guest users with the same UserID.

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

Re: How to tell if user is registered?

Postby Vania » August 10th, 2010, 11:30 pm

Ahh, ok.
No conflict in connecting multiple users with the same account then.
And I can check if they're guests just by looking at the userid.

Thats clever. Thanks.
Vania
 
Posts: 198
Joined: March 24th, 2010, 9:01 pm


Return to Multiplayer