Force Login
-
- Posts: 61
- Joined: 16 Jan 2009, 14:48
Force Login
Is there a way to "Force Login" with the current Unity/SFS system? Sometimes I get booted and when I try to log back in, it tells me my username is already in use. My only recourse is to wait for the timeout (currently set to 1 hour) or restart SFS.
Lapo mentions something about it here http://www.smartfoxserver.com/forums/viewtopic.php?t=5841&highlight= but could never find the docs for it.
Lapo mentions something about it here http://www.smartfoxserver.com/forums/viewtopic.php?t=5841&highlight= but could never find the docs for it.
-
- Posts: 1297
- Joined: 14 Mar 2008, 07:52
- Location: Sweden
-
- Posts: 61
- Joined: 16 Jan 2009, 14:48
Luck
Any luck on this front?
- mistermind
- Posts: 131
- Joined: 15 Sep 2007, 01:33
- Contact:
Custom Login can handle that.
Set your zone's custom login to true:
And use an extension to handle login using the loginRequest event on handleInternalEvent. From there you can use the loginUser method:
Witch allows you to force a login. You can read more about custom login here:
http://www.smartfoxserver.com/docs/docP ... /index.htm
Set your zone's custom login to true:
Code: Select all
<Zone name="Server" uCountUpdate="false" maxUsers="1000" customLogin="true">
And use an extension to handle login using the loginRequest event on handleInternalEvent. From there you can use the loginUser method:
Code: Select all
_server.loginUser(nick, pass, channel, forceLogin)
Witch allows you to force a login. You can read more about custom login here:
http://www.smartfoxserver.com/docs/docP ... /index.htm
SELECT * FROM users WHERE clue > 0
0 rows returned.
0 rows returned.
-
- Posts: 61
- Joined: 16 Jan 2009, 14:48
Exactly
Looks exactly like what I needed, thanks!
mistermind wrote:Custom Login can handle that.
Set your zone's custom login to true:Code: Select all
<Zone name="Server" uCountUpdate="false" maxUsers="1000" customLogin="true">
And use an extension to handle login using the loginRequest event on handleInternalEvent. From there you can use the loginUser method:Code: Select all
_server.loginUser(nick, pass, channel, forceLogin)
Witch allows you to force a login. You can read more about custom login here:
http://www.smartfoxserver.com/docs/docP ... /index.htm
Please friend, how can I active this? I tried here and returns me nothing, I just can't connect (and SFS say its an error in code).
-
- Posts: 1297
- Joined: 14 Mar 2008, 07:52
- Location: Sweden
-
- Posts: 1297
- Joined: 14 Mar 2008, 07:52
- Location: Sweden
Hi kaligus.
Just use the following statement server side:
forceLogin is a boolean variable.
Just use the following statement server side:
Code: Select all
_server.loginUser(nick, pass, channel, true)
forceLogin is a boolean variable.
-
- Posts: 61
- Joined: 16 Jan 2009, 14:48
Follow Up
Ok, I got my Extention calling the database, verifying that the user exist and is correct, and now I am returning to the client application.
OnEntentionResponse now fires. I can get the result.
Now what do I need to call in the client application? OnLogin?
Thanks for any and all help!
[EDIT]
I reread the directions located at http://www.smartfoxserver.com/docs/index.htm?http://www.smartfoxserver.com/docs/docPages/tutorials_pro/05_loginExt/index.htm so let me try calling the smartfox.getRoomList() and see if that gets my program to move along. I will post what I find soon.
[EDIT] Follow Up
Yes, calling smartfox.GetRoomList() in the UnityAPI continues you to login to your application. Hope this helps someone!
OnEntentionResponse now fires. I can get the result.
Now what do I need to call in the client application? OnLogin?
Thanks for any and all help!
[EDIT]
I reread the directions located at http://www.smartfoxserver.com/docs/index.htm?http://www.smartfoxserver.com/docs/docPages/tutorials_pro/05_loginExt/index.htm so let me try calling the smartfox.getRoomList() and see if that gets my program to move along. I will post what I find soon.
[EDIT] Follow Up
Yes, calling smartfox.GetRoomList() in the UnityAPI continues you to login to your application. Hope this helps someone!
You can read more about custom login here:
http://www.smartfoxserver.com/docs/docP ... /index.htm
According to the above link:
Also the myUserName and myUserId properties ARE NOT populated auto-magically, so you will need to do it manually, if you need them.
Can someone give me some guidance on how to do this on the server?
I think I can get the user name from the string passed to the server from the smartfox.login client's call. How/where can I get the userID, though?
Once I get these values, can I attach them directly to the SmartFoxClient object, or will I have to attach them to another object? For example, I would like to still be able to access the user ID with smartFox.myUserId, rather than something like myObj.myUserId = myUserIdPassedFromServer.
Return to “.Net / Unity3D API”
Who is online
Users browsing this forum: No registered users and 29 guests