Code: Select all
private void SubscribeEvents() {
Debug.Log("****************=========================******************** SubscribeEvents to Events");
SFSEvent.onJoinRoom += OnJoinRoom;
SFSEvent.onUserEnterRoom += OnUserEnterRoom;
SFSEvent.onUserLeaveRoom += OnUserLeaveRoom;
SFSEvent.onObjectReceived += OnObjectReceived;
SFSEvent.onPublicMessage += OnPublicMessage;
SFSEvent.onPrivateMessage += OnPrivateMessage;
SFSEvent.onConnectionLost += OnConnectionLost;
SFSEvent.onRoomListUpdate += OnRoomList;
SFSEvent.onDebugMessage += OnDebugMessage;
SFSEvent.onExtensionResponse += OnExtensionResponse;
SFSEvent.onUserVariablesUpdate += OnUserVariablesUpdate;
}
public void UnsubscribeEvents() {
Debug.Log("****************=========================******************** UnsubscribeEvents to Events");
SFSEvent.onJoinRoom -= OnJoinRoom;
SFSEvent.onUserEnterRoom -= OnUserEnterRoom;
SFSEvent.onUserLeaveRoom -= OnUserLeaveRoom;
SFSEvent.onObjectReceived -= OnObjectReceived;
SFSEvent.onPublicMessage -= OnPublicMessage;
SFSEvent.onPrivateMessage -= OnPrivateMessage;
SFSEvent.onConnectionLost -= OnConnectionLost;
SFSEvent.onRoomListUpdate -= OnRoomList;
SFSEvent.onDebugMessage -= OnDebugMessage;
SFSEvent.onExtensionResponse -= OnExtensionResponse;
SFSEvent.onUserVariablesUpdate -= OnUserVariablesUpdate;
}
But the event doesn't seem to get fired.
Code: Select all
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
Debug.Log("---------------==================== Some Clothes Changed for user " + user.GetId());
}
And here is the call that I am populating the User variables with:
Code: Select all
try
{
smartFoxClient.SetUserVariables(myHashtable);
}
catch ( Exception e )
{
Debug.Log("*****&&&&&&&&&&$#@$#$@$#@$@$#@$# Error" + e.Message);
Disconnect("unknown");
}
Any suggestions? I am using Unity 3.1 with 1.2.7 RC1