Delayed Connection and Login
-
lordzardeck
- Posts: 14
- Joined: 03 Sep 2011, 13:39
Delayed Connection and Login
What if I don't want a user to connect till they are ready to login? That way I don't get people just bringing up the game and using one of my limited connection slots? Is there anyway to delay connecting until logging in? I know I could add a onConnection Event listener that logs you in, but how would I remove that event listener so that if I get disconnected and try to re-connect that it doesn't call the login listener again?
hi. Well, i think that the limit is the number of logged users, not the number of users that are just connected
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.
-
lordzardeck
- Posts: 14
- Joined: 03 Sep 2011, 13:39
-
jamalsoueidan
- Posts: 153
- Joined: 15 Aug 2011, 16:33
I don't get it.
You want user to login but don't want him to connect to server :S
How would this happen?
He need to interact with something to validate his user/password?
It either socket server or http server.
In casse you choose http server, then don't connect until he login?
I don't see where the problem is?
Sorry
You want user to login but don't want him to connect to server :S
How would this happen?
He need to interact with something to validate his user/password?
It either socket server or http server.
In casse you choose http server, then don't connect until he login?
I don't see where the problem is?
Sorry
---------------------------------------------------
Jamal Soueidan
http://linkedin.com/in/jamalsoueidan
Jamal Soueidan
http://linkedin.com/in/jamalsoueidan
-
lordzardeck
- Posts: 14
- Joined: 03 Sep 2011, 13:39
Not quite. I don't want to connect to the server until he actually ATTEMPTS to log in. for example:jamalsoueidan wrote:I don't get it.
You want user to login but don't want him to connect to server :S
Code: Select all
public function login(username:String, password:String):void
{
//do connection
//do login
}Well, CCU's stands for Concurrent Users, and a player only becomes an user after a successful loginlordzardeck wrote:Actually, it says # of CCU's are equal to the number of connections
Anyway, I don't understand where the problem is.
In your login function, you simply first load the config by using the loadConfig() method of the SmartFox class, which automatically connects after successfully loading the config file.
Then, you listen to the CONNECTION event and there, you send a login request (if the connection was successful, of course).
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.