Max Rooms Per User

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

petergpls
Posts: 16
Joined: 14 Apr 2013, 14:15

Max Rooms Per User

Postby petergpls » 15 Jul 2013, 02:21

Hi,
I have configured a zone with the property 'Max Rooms Per User' = 4 but when I try and login with the same username more than once, the other connection disconnects. It's as if I am not allowed to exist in the same zone more than once.

Now even if I connect to a room in the same zone as username='abc', the same user cannot connect to the zone prior to connecting to another room?

I need to implement this way because I use the signupandlogin API to first register and then I logout of the signup zone and login to the new zone in readiness to select a new room. Any ideas what I am doing wrong here?

Regards
User avatar
Lapo
Site Admin
Posts: 21926
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Max Rooms Per User

Postby Lapo » 15 Jul 2013, 07:18

I have configured a zone with the property 'Max Rooms Per User' = 4 but when I try and login with the same username more than once, the other connection disconnects. It's as if I am not allowed to exist in the same zone more than once.

You cannot exist in the same Zone more than one time with the same name. Names are unique and case sensitive.

I need to implement this way because I use the signupandlogin API to first register and then I logout of the signup zone and login to the new zone in readiness to select a new room. Any ideas what I am doing wrong here?

This part is not very clear to me. Why do you need to be logged in the zone twice with the same name?
Lapo
--
gotoAndPlay()
...addicted to flash games
petergpls
Posts: 16
Joined: 14 Apr 2013, 14:15

Re: Max Rooms Per User

Postby petergpls » 15 Jul 2013, 08:34

Hi - thanks for your reply.

I need to ask the question a different way - this is the process:

1. Login to Signup zone and register etc.
2. Once authenticated or have registered etc., logout of the SignUp zone and login to the game zone
3. Once logged into game zone, I then join ROOM_A
4. I then also join ROOM_B without manually doing any exit of previous room. Now, the issue here is that I wanted to be joined to ROOM_A and ROOM_B but as soon as I perform the JoinRoomRequest, it leaves the previous room.

So question is how does one join multiple rooms up to Max Rooms Per User?

Thanks
User avatar
Lapo
Site Admin
Posts: 21926
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Max Rooms Per User

Postby Lapo » 15 Jul 2013, 09:04

Thanks for clarifying.
The default behavior when joining a Room is to leave the previous one, but you can specify in your request that you don't want to leave the previous Room.
Just check the documentation for the JoinRoomRequest for the client API that you are using.

For example in AS3 you have this:

Code: Select all

JoinRoomRequest(id:*, pass:String = null, roomIdToLeave:Number, asSpect:Boolean = false)

By passing a negative value as the roomIdToLeave parameter you will instruct the server to let the user in any previous Room.
Lapo

--

gotoAndPlay()

...addicted to flash games
petergpls
Posts: 16
Joined: 14 Apr 2013, 14:15

Re: Max Rooms Per User

Postby petergpls » 15 Jul 2013, 10:10

Thanks - and you know I cant believe how many times the answer is in the documentation and it's missed. I'll make sure to check the doc as I go along building/developing.
Cheers - you have been a great help many times over....

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 32 guests