Outdated UserVariables when rejoining a room

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

Moderators: Lapo, Bax

User avatar
Zelek
Posts: 36
Joined: 24 Jun 2010, 22:36

Outdated UserVariables when rejoining a room

Postby Zelek » 05 Sep 2011, 07:19

I've noticed that when changing rooms with two clients, one client will have UserVariables that aren't up to date in a certain situation:

1) Player A and B are in the same room X.
2) Player B moves to room Y.
3) Player A has his User Variables updated by the server.
4) Player B returns to room X, but has the old values of A's User Variables.

Since User Variables changes are only broadcast to people in the same room, is this intended? If a player is rejoining a previous room, how should I ensure that all User Variables are up-to-date after rejoining?

I am using Unity, this is what's going on in my client code:

Code: Select all

smartFox.AddEventListener(SFSEvent.ROOM_JOIN, OnJoinRoom);
...
private static void OnJoinRoom (BaseEvent evt) {
    Room room = (Room)evt.Params["room"];

    // Find out which users are in the room we just joined
    foreach (User user in room.UserList) {
         // The UVs for these user objects didn't get updated while we
         // were in a different room!  Ack!
         App.drawUserOnScreen(user);
      }
}
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Postby rjgtav » 05 Sep 2011, 09:16

Hum... This is interesting...

Are you using the latest SFS RC3?
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
User avatar
Zelek
Posts: 36
Joined: 24 Jun 2010, 22:36

Postby Zelek » 05 Sep 2011, 16:31

I thought I had, but I just went through the process again and it fixed the issue. I think I must have missed the client API fix the first time. Thanks, rjgtav! :D

Return to “SFS2X Questions”

Who is online

Users browsing this forum: JanerHymn, XyrisKenn and 63 guests