Turn on Multiple Logins

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

Moderators: Lapo, Bax

Post Reply
Bosskafett
Posts: 41
Joined: 24 Jan 2012, 00:04

Turn on Multiple Logins

Post by Bosskafett »

How do you turn on Multiple Logins in SFS PRO? Thanks.
if(_global.is_rocketsnail == 1){
mc.snail._visible = true;
smartfox.setUserVariables({snl:1, init:false})
}
The Re-creator of Old Games ;D
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: Turn on Multiple Logins

Post by Bax »

What does "multiple login" means?
Paolo Bax
The SmartFoxServer Team
Bosskafett
Posts: 41
Joined: 24 Jan 2012, 00:04

Re: Turn on Multiple Logins

Post by Bosskafett »

Simply allow users to login more than once? Is it possible? I'm sure it is :lol:
if(_global.is_rocketsnail == 1){
mc.snail._visible = true;
smartfox.setUserVariables({snl:1, init:false})
}
The Re-creator of Old Games ;D
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Re: Turn on Multiple Logins

Post by rjgtav »

Hi.
Sorry but I think you misread it. A client can only login once (unless you create several SmartFoxClient instances but why would you need that?). Can you please describe better what do you want to achieve? And are you sure that you aren't referring to joining multiple rooms instead?
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.
Bosskafett
Posts: 41
Joined: 24 Jan 2012, 00:04

Re: Turn on Multiple Logins

Post by Bosskafett »

I have created a chat application where you can join a chat from a link e.g. www.aurorachat.me/lobby. I want users to be able to login to multiple chats (rooms) but not the same one more than once. Is this possible? Thanks you. :D
if(_global.is_rocketsnail == 1){
mc.snail._visible = true;
smartfox.setUserVariables({snl:1, init:false})
}
The Re-creator of Old Games ;D
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Re: Turn on Multiple Logins

Post by rjgtav »

Hello.
You could create a Room for each Chat Room instead of different Zones. That way you would only need to login once and then you could join multiple rooms by providing true as the dontLeave parameter in the smartfox.joinRoom() method.
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.
Bosskafett
Posts: 41
Joined: 24 Jan 2012, 00:04

Re: Turn on Multiple Logins

Post by Bosskafett »

Wait, I need a user to be able to login to two client screens and have the same user in different rooms at once. Is it possible to login to the same user that's already logged into a room? This will make the user able to chat in two rooms while on the same user.
if(_global.is_rocketsnail == 1){
mc.snail._visible = true;
smartfox.setUserVariables({snl:1, init:false})
}
The Re-creator of Old Games ;D
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: Turn on Multiple Logins

Post by Bax »

This is not possible. You can't have the same user perform two separate logins at the same time using the same username.
Paolo Bax
The SmartFoxServer Team
Bosskafett
Posts: 41
Joined: 24 Jan 2012, 00:04

Re: Turn on Multiple Logins

Post by Bosskafett »

So, the Server reads the Username ( user.getName() ) if I can randomise the end of that and record a different variable with the display username (e.g. user.setName(resObj.name + random_number) & user.setRealName(resObj.name) ). I will try something like that. Tell you what happens after.
if(_global.is_rocketsnail == 1){
mc.snail._visible = true;
smartfox.setUserVariables({snl:1, init:false})
}
The Re-creator of Old Games ;D
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Re: Turn on Multiple Logins

Post by rjgtav »

Hi.
You could try sending the SmartFoxClient object from the main client to all the other different windows, via JavaScript. Then you would just need to join multiple rooms instead of logging in multiple times.
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.
Post Reply