SmartFoxServer Unity/.NET API
SFSEvent..::.OnUserVariablesUpdateDelegate Delegate
NamespacesSmartFoxClientAPISFSEventSFSEvent..::.OnUserVariablesUpdateDelegate
Dispatched when a user in the current room updates his/her User Variables.
Declaration Syntax
C#Visual BasicVisual C++
public delegate void OnUserVariablesUpdateDelegate(
	User user,
	Hashtable changedVars
)
Public Delegate Sub OnUserVariablesUpdateDelegate ( _
	user As User, _
	changedVars As Hashtable _
)
public delegate void OnUserVariablesUpdateDelegate(
	User^ user, 
	Hashtable^ changedVars
)
Parameters
user (User)
the User object representing the user who updated his/her variables.
changedVars (Hashtable)
a Hashtable with the names of the changed variables as keys.
Remarks

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

Examples
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"));
    }
}
See Also

Assembly: SmartFoxClient (Module: SmartFoxClient) Version: 1.2.4.0 (1.2.4.0)