Custom Login Questions

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

dromos
Posts: 7
Joined: 07 Oct 2009, 19:45

Custom Login Questions

Postby dromos » 07 Oct 2009, 20:01

I've just started working with SFS. I'm currently writing a custom login handler in a Java extension and had a few questions.

1. What does SFS consider a "guest user" and what can they do? How does a "guest user" become a "real" user?

2. If my custom handler doesn't approve the login attempt, is the user's connection to the server immediately severed or otherwise closed in some way?

3. Does a user have to be joined into a room?

4. I don't necessarily need a username passed in from the client but since zones require each user have a unique nick, is there any reason my handler couldn't just call the helper.getGuestName() method to generate one? Can we count on this method to create a unique nick within the zone each time it's called?

Thanks!
User avatar
mistermind
Posts: 131
Joined: 15 Sep 2007, 01:33
Contact:

Postby mistermind » 08 Oct 2009, 22:02

Sorry for not answering all your questions. I'm not sure how to answer the others without making a fool of myself so I'll just answer what I know :D

2 - They stay connected. Custom login pretty much removes every "automatic" event handler and properties from the regular client login. It is up to you to disconnect that user from the extension.

3 - No they can't. In order to call a custom login you must have a loginRequest somewhere in any of your active extensions to be triggered by sfs.login() . What custom login does, in few words, is replace the methods from sfs.login() with whatever you write on loginRequest in your handleInternalEvent plus it does not trigger the onLogin (client). A good example can be found here:
http://www.smartfoxserver.com/docs/docP ... /index.htm
SELECT * FROM users WHERE clue > 0
0 rows returned.

Return to “Server Side Extension Development”

Who is online

Users browsing this forum: No registered users and 17 guests