Room Join Error : User is already in this room

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

prasoon
Posts: 6
Joined: 04 Mar 2014, 14:08

Room Join Error : User is already in this room

Postby prasoon » 08 Mar 2014, 10:42

Hi,
I am getting this error.
{ DATA IN } : <msg t='sys'><body action='joinRoom' r='1'><room id='1' pwd='' spec='0' leave='1' old='1' /></body></msg>
[ INFO ] > Room Join Error: User is already in this room!, User: "my mail ID", IP: ???????
[ INFO ] > { DATA OUT } : <msg t='sys'><body action='joinKO' r='0'><error msg='User is already in this room!' /></body></msg>

Can anyone help??
prasoon
Posts: 6
Joined: 04 Mar 2014, 14:08

Re: Room Join Error : User is already in this room

Postby prasoon » 08 Mar 2014, 10:48

I have restarted the server then also it is coming.

What's the cause?

Thanks,
Prasoon
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: Room Join Error : User is already in this room

Postby Bax » 08 Mar 2014, 15:52

Please check the server-side log. An error should be reported there.
This happens if you try to join the same Room twice. Maybe there's a bug in your code making the user join twice?
Paolo Bax
The SmartFoxServer Team
prasoon
Posts: 6
Joined: 04 Mar 2014, 14:08

Re: Room Join Error : User is already in this room

Postby prasoon » 16 Mar 2014, 14:03

Hey bax,
Thanks a lot bax.
I have checked the codes at server side and whenever a user is leaving the room from "handleInternalEvent", I have given a room.removeUser(user, true, true). I have tried a lot but the error still persists.

Actually, What the client is doing is, when a user wants to leave a room it sends a join room to lobby and send the user to lobby without calling anything at server-side to leave the room. Can this be the root of the issue??
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: Room Join Error : User is already in this room

Postby Bax » 17 Mar 2014, 08:59

First of all you don't have to remove the user from the Room manually. The server will do it for you. This is mandatory.
Also, when you need to join a Room leaving the previous one, you have to pass a specific parameter to the joinRoom method. The server will then handle this for you.
Paolo Bax
The SmartFoxServer Team
prasoon
Posts: 6
Joined: 04 Mar 2014, 14:08

Re: Room Join Error : User is already in this room

Postby prasoon » 18 Mar 2014, 09:52

Hey Bax,
Thanks a lot.
But i have not yet been able to resolve it. Is there any support/paid for sfs?


Thanks,
Prasoon
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: Room Join Error : User is already in this room

Postby Bax » 19 Mar 2014, 08:56

I don't think you need paid support to solve this. Also we don't provide code reviews.
The error you shown at the very beginning is quite straightforward: the user is trying to join the same Room two times.
The reason could be an error in your code, or maybe when moving from one Room to the other, you are not leaving the first one.
For example when the user connects he joins Room A. Then he moves to Room B without leaving Room A. If then he goes back to Room A, the server will trace that error.
Paolo Bax
The SmartFoxServer Team

Return to “SmartFoxServer 1.x Discussions and Help”

Who is online

Users browsing this forum: No registered users and 115 guests