Client does not receive ROOM_JOIN event after joinRoom() on server

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

Moderators: Lapo, Bax

Post Reply
AiryKai
Posts: 14
Joined: 01 Apr 2015, 08:02

Client does not receive ROOM_JOIN event after joinRoom() on server

Post by AiryKai »

Hi, I’m facing a strange issue while working with SmartFoxServer 2X.

Problem summary:

  • The server calls joinRoom() for a connected user;
  • On the server side, the user successfully joins the target room;
  • However, on the client side, the SFSEvent.ROOM_JOIN event is never fired;
  • Additionally, sfs.LastJoinedRoom is null (before joinRoom() it returns Lobby), and sfs.RoomManager.GetJoinedRooms() (this also returns Lobby before joinRoom()) returns an empty list;
  • The client is properly subscribed to SFSEvent.ROOM_JOIN before the joinRoom() call;
  • No ROOM_JOIN_ERROR events are triggered.

Additional details:

  • Client and server versions match, using the latest stable API versions;
  • Server logs confirm that the user successfully joins the room;
  • The client can send ExtensionRequest() messages, and the server handles them correctly as if the user is part of the room;
  • It started happening suddenly. No changes have been made that would cause this. Everything worked fine for a long time.

Question:

What else could cause this desynchronization between the server and client regarding room joining?
Are there any known bugs, edge cases, or special requirements that could lead to this behavior?

Any help or ideas would be greatly appreciated.

Thanks in advance!
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Client does not receive ROOM_JOIN event after joinRoom() on server

Post by Lapo »

Hi,
can you show the code used to join the user from the server side?
Can you confirm that the user is found joined in the Room via the AdminTool, using the Zone Monitor?

Also please specify the Server version, and client API type and version.

Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
AiryKai
Posts: 14
Joined: 01 Apr 2015, 08:02

Re: Client does not receive ROOM_JOIN event after joinRoom() on server

Post by AiryKai »

This code:

ISFSApi.joinRoom(universingComponent.User, room, null, false, lobby, true, true);

Yes, I totally checked - the user is connected to the room. It's seen in AdminTool, it's seen in the logs.
The client can also send an ExtensionRequest to the server targeting that room (if the client knows the room id).

I encountered this issue when the server was version 2.19. I then updated this to 2.20.3. That didn't change anything.
The client uses C# Api version 1.8.4.
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Client does not receive ROOM_JOIN event after joinRoom() on server

Post by Lapo »

Have you double checked you have no exceptions both on the client and server side? (particularly server side) at the time of joining?
Is this something that you can reproduce 100% of the times?
Can you reproduce it on a local machine?
If so, can you give us a step-by-step description of how to reproduce it?

Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
AiryKai
Posts: 14
Joined: 01 Apr 2015, 08:02

Re: Client does not receive ROOM_JOIN event after joinRoom() on server

Post by AiryKai »

I checked all of this several times before creating this thread.

I found a temporary solution for this problem in my project. I send a custom ExtensionResponse to the client when the server changes the room for it.

Today I found that the client started receiving the correct room change events again. No changes related to it have been made.

Unfortunately, I was never able to find the cause. And I can't be sure it won't happen again.
Post Reply