Hi, I am sorry if I am asking something that is already answered, but I didn't found any information about this. I planing to create a game using smartfoxserver on server side. So then user opens game for the first time it will see menu with text fields for the new login and password. After that he will press, Register and game should create a record in db with entered login-pass. And login user to the Zone. After that he will directed to the first Room of the game zone... The question is how to create new users? Because client can't send any request to extension until he is not logged to it?
Or maybe this kind of functionality implemented in some other ways?
Thanks.
Create new user with custom login
Re: Create new user with custom login
Hello,
Yes, you can only send custom ExtensionRequests to an extension after a successful login, so you have 2 options:
1. Use 2 different zones, one for registration and the other for the game. On the registration you can send a login request with empty username and password and the registration data on the extra parameters object (the 4th parameter of the LoginRequest).
2. Another way is to use a single zone, and then the server-side extension decides whether to login or register the user with the provided info. This option is great for applications that use a login from an outside service, like facebook, where the user is already authenticated and just needs to enter the app.
Hope this helps
Yes, you can only send custom ExtensionRequests to an extension after a successful login, so you have 2 options:
1. Use 2 different zones, one for registration and the other for the game. On the registration you can send a login request with empty username and password and the registration data on the extra parameters object (the 4th parameter of the LoginRequest).
2. Another way is to use a single zone, and then the server-side extension decides whether to login or register the user with the provided info. This option is great for applications that use a login from an outside service, like facebook, where the user is already authenticated and just needs to enter the app.
Hope this helps
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Re: Create new user with custom login
There is another way to do this.
Allow the client to login as a guest user (temp name, no password), and apply to this user a specific user profile (e.g. the default Guest profile), let the user register his new account, logout the client and login him again with his new credentials (you can do this automatically) and voilà.
Guests and registered users will use different User privileges, therefore you can make sure that guests can only access a limited portion of the application (e.g. the register screen).
More on User privileges:
http://docs2x.smartfoxserver.com/Advanc ... ge-manager
Cheers
Allow the client to login as a guest user (temp name, no password), and apply to this user a specific user profile (e.g. the default Guest profile), let the user register his new account, logout the client and login him again with his new credentials (you can do this automatically) and voilà.
Guests and registered users will use different User privileges, therefore you can make sure that guests can only access a limited portion of the application (e.g. the register screen).
More on User privileges:
http://docs2x.smartfoxserver.com/Advanc ... ge-manager
Cheers
Re: Create new user with custom login
Thank you you, for answers. As for me I started to think about first way by rjgtav with two different zones. But now I will study the way by Lapo and make decide. Thank You, guys.
-
- Posts: 25
- Joined: 20 Nov 2012, 10:49
Re: Create new user with custom login
I'm doing something very similar to what you want to do. I use PHP scripts on my server that will handle the entire registration/login process and just login to the zone after the result of the authentication is obtained.
This lets me deal with 3 different methods of logging into the game.
Simple and straight forward. At least on the SFS side.
I still want to hear about what Lapo has to say about this method.
This lets me deal with 3 different methods of logging into the game.
- Facebook based
- Website based(for browsers)
- Guest login
Simple and straight forward. At least on the SFS side.
I still want to hear about what Lapo has to say about this method.
Re: Create new user with custom login
Hi,
I think it makes sense, especially because this way you catch three birds with a stone
I think it makes sense, especially because this way you catch three birds with a stone
-
- Posts: 25
- Joined: 20 Nov 2012, 10:49
Re: Create new user with custom login
Lapo wrote:Hi,
I think it makes sense, especially because this way you catch three birds with a stone
That I do.
Who is online
Users browsing this forum: Google [Bot] and 18 guests