ContainsUser always returns false for MMO rooms

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

Moderators: Lapo, Bax

MetaJordan
Posts: 7
Joined: 03 Dec 2021, 16:53

ContainsUser always returns false for MMO rooms

Postby MetaJordan » 28 Mar 2022, 23:40

Simple enough to reproduce:

1. Download and open the SmartFox MMORoomDemo (I'm using Unity 2021.2.10)
2. Add this line of code to FixedUpdate of GameManager.cs:
Debug.Log(sfs.LastJoinedRoom.ContainsUser(sfs.MySelf));
3. Run the demo, login, and observe that it always returns false.

Is this intended behavior? I noticed it while trying to send a SetRoomVariablesRequest with the additional Room parameter. This appears to rely on the aforementioned ContainsUser method which kept giving me the "You are not joined in the target room" warning.
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: ContainsUser always returns false for MMO rooms

Postby Lapo » 29 Mar 2022, 09:54

Hi,
yes it is the intended behavior, the MMORoom uses a "proximity list" which replaces the standard User list, as per the MMO documentation overview:
"In other words the proximity list substitutes the regular user list on the client side, optimizing the number of updates that the user receives. On the server side the full user list of the Room is still accessible in its entirety."
http://docs2x.smartfoxserver.com/Advanc ... /mmo-rooms

I noticed it while trying to send a SetRoomVariablesRequest with the additional Room parameter. This appears to rely on the aforementioned ContainsUser method which kept giving me the "You are not joined in the target room" warning.

Yes that seems incorrect as the check would only work for regular Rooms.
I have added an entry in our bug tracker so that it will be fixed in the next API release.

Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
MetaJordan
Posts: 7
Joined: 03 Dec 2021, 16:53

Re: ContainsUser always returns false for MMO rooms

Postby MetaJordan » 21 Dec 2022, 17:59

Unfortunately after downloading the latest C# API (1.7.18) the problem still exists for MMO rooms.
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: ContainsUser always returns false for MMO rooms

Postby Lapo » 22 Dec 2022, 14:24

Hi,
we have released a new update with the fix to the problem you have posted here.
https://www.smartfoxserver.com/download/#p=client

Let us know if it helps.
Cheers
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: Stevenor and 117 guests