Dispatched when a user in the current room updates his/her User Variables.
NOTE:
the changedVars array 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, Hashtable 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) { Trace.WriteLine("User " + user.GetName() + " moved to new coordinates:"); Trace.WriteLine("\t px: " + user.GetVariable("px")); Trace.WriteLine("\t py: " + user.GetVariable("py")); } }