Hello!
I need to reset a user variable ("readyToPlay") for ALL users. I plan a method which causes a reset through the room so the user settings will be cleaner than the room of my sister (she never tidies up).
Sir, how can I make it in a performant way? If I build a loop (reset user var of user 1, then user2, then user 3...) then it will probably fire 300 alerts for user var update to 300 users if 300 users are logged in. Isn't that a bigger disaster than my birthday last year where we wanted to communicate with hundreds guests? My boss would kill me if the application will slow down!
Is there no method like setUservarvalueForAll(null)?
Thanks in advance!
delete value of one user variable name for ALL users
-
- Posts: 33
- Joined: 28 Sep 2018, 19:47
Re: delete value of one user variable name for ALL users
Hi,
to reset a User variable you just need to set said variable to NULL. Once it's updated all other clients in the Room will be updated. The system is already optimized and doesn't require you to do anything else.
Hope it helps
to reset a User variable you just need to set said variable to NULL. Once it's updated all other clients in the Room will be updated. The system is already optimized and doesn't require you to do anything else.
Hope it helps
-
- Posts: 33
- Joined: 28 Sep 2018, 19:47
Re: delete value of one user variable name for ALL users
Yes sure, but it's about to set the value to null OF ALL users. Sorry for confusing
Re: delete value of one user variable name for ALL users
I don't understand the "all users" part. When you reset Variable X for User A, all Users that "can see" User A will receive an update.
What we mean with "can see", is all of the Users that are joined in the same Room(s) with User A.
Cheers
What we mean with "can see", is all of the Users that are joined in the same Room(s) with User A.
Cheers
-
- Posts: 33
- Joined: 28 Sep 2018, 19:47
Re: delete value of one user variable name for ALL users
I want to reset the Variable X for User A, B, C, D and ALL others in the room at the same time.
User A will have a reseted Variable X, User B has a reseted Variable X and so on.
User A will have a reseted Variable X, User B has a reseted Variable X and so on.
Re: delete value of one user variable name for ALL users
It's best if you do it on the server side, looping through each User in the Room and setting the variable to null via the getApi().setUserVariables(...) method call.
Cheers
Cheers
Who is online
Users browsing this forum: Google [Bot] and 94 guests