Dispatched when a user in the current room updates his/her User Variables.

C# | Visual Basic | Visual C++ |
public delegate void OnUserVariablesUpdateDelegate( User user, Dictionary<string, Object> changedVars )
Public Delegate Sub OnUserVariablesUpdateDelegate ( _ user As User, _ changedVars As Dictionary(Of String, Object) _ )
public delegate void OnUserVariablesUpdateDelegate( User^ user, Dictionary<String^, Object^>^ changedVars )

- changedVars (Dictionary<(Of <(String, Object>)>))
- a dictionary with the names of the changed variables as keys.

NOTE:
the changedVars dictionary contains the names of the changed variables only, not the actual values. To retrieve them the GetVariable(String) / GetVariables()()() methods can be used.
Version:
SmartFoxServer Basic / Pro

The following example shows how to handle an update in User Variables.
CopyC#

SFSEvent.onUserVariablesUpdate += OnUserVariablesUpdate; public void OnUserVariablesUpdate(User user, Dictionary<string, object> changedVars) { // We assume that each user has px and py variables representing the users's avatar coordinates in a 2D environment if (changedVars["px"] != null || changedVars["py"] != null) { Debug.WriteLine("User " + user.GetName() + " moved to new coordinates:"); Debug.WriteLine("\t px: " + user.GetVariable("px")); Debug.WriteLine("\t py: " + user.GetVariable("py")); } }