user.setVariable and getApi().setUserVariables

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
jpardoe
Posts: 132
Joined: 31 Aug 2009, 20:54

user.setVariable and getApi().setUserVariables

Post by jpardoe »

When doing user.setVariable() does it notify all other players or does that only occur when I do getApi().setUserVariables?
tpenn
Posts: 95
Joined: 03 Aug 2010, 18:48

Post by tpenn »

My experience with the beta was that any time you could do something through an api call you should. It seemed that often the other methods were not intended for external use. There was some discussion of not exposing such methods to us, but I'm not sure where the SFS guys are on that.

If I remember correctly, I did discover at one point that in order for the notifications to take place, the api call needed to be used. Either way though, it's just a good practice to always use them when possible.
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

You always need to call the API functions. If you operate directly on the User or Room objects you won't get any updates.
Lapo
--
gotoAndPlay()
...addicted to flash games
jpardoe
Posts: 132
Joined: 31 Aug 2009, 20:54

Post by jpardoe »

Great, thanks guys!
Post Reply