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.
login in java server extension
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-_
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-_
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-_
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-_
Return to “Server Side Extension Development”
Who is online
Users browsing this forum: No registered users and 44 guests