login in java server extension

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

Moderators: Lapo, Bax

endryha
Posts: 8
Joined: 07 Aug 2008, 09:40

login in java server extension

Postby endryha » 07 Aug 2008, 09:48

Hi! I am want to create own custom login logic. I am read the tutorial but is on action script and i not found the method loginUser(...) in java api. Please tell me how i can manual login user in my java extension.
thx.
Menser
Posts: 111
Joined: 13 Nov 2007, 18:32

Postby Menser » 07 Aug 2008, 10:33

Heya-


You are right, i glanced over the docs for the java extensions as well, and could not readily find where loginUser was.
However, due to my large cranial region having a high retention span for random tidbits of knowledge, i think i know where it is.

If i remember correctly you login a user using the ExtensionHelper.
Looking at the java docs for that class as well also lead me to think this since the methods for logging out a user and such are there, though i fond no mention of the loginUser method.


Hope that helps some, and maybe someone with a more definitive answer could chime in.

_-Menser-_
endryha
Posts: 8
Joined: 07 Aug 2008, 09:40

Postby endryha » 07 Aug 2008, 11:02

Thanks for replay, but i am allready look on ExtensionHelper and not found this method too.
Menser
Posts: 111
Joined: 13 Nov 2007, 18:32

Postby Menser » 07 Aug 2008, 11:03

Heya-


Yeah it hink the extension helper documentation is just missing the entry for it, im"fairly" certain the method actually exists within it even if not documented there.

_-menser-_
endryha
Posts: 8
Joined: 07 Aug 2008, 09:40

Postby endryha » 07 Aug 2008, 11:10

Men i check for real exist this method in ExtensionHelper and SmartFoxServer class, i would not wrote on the forum if it is not checked
Menser
Posts: 111
Joined: 13 Nov 2007, 18:32

Postby Menser » 07 Aug 2008, 11:29

Hey-

Ok, so i found the answer to your problem

The canLogin method in the ExtensionHelper class returns a Users object (that is already added to the zone) if they can successfully login.

http://www.smartfoxserver.com/docs/docPages/javadoc/it/gotoandplay/smartfoxserver/extensions/ExtensionHelper.html#canLogin(java.lang.String,%20java.lang.String,%20java.nio.channels.SocketChannel,%20java.lang.String)

Hope that helps.

_-Menser-_
endryha
Posts: 8
Joined: 07 Aug 2008, 09:40

Postby endryha » 07 Aug 2008, 11:39

Thank you! Now i try it :D

Return to “Server Side Extension Development”

Who is online

Users browsing this forum: No registered users and 44 guests