Page 1 of 1

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

Posted: 25 Jun 2025, 07:36
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!

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

Posted: 26 Jun 2025, 13:46
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

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

Posted: 26 Jun 2025, 21:23
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.

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

Posted: 27 Jun 2025, 06:56
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

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

Posted: 02 Jul 2025, 14:53
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.