Hi
I have these lines on server side:
List<UserVariable> vars = new LinkedList<UserVariable>();
vars.add(new SFSUserVariable("posx", receivedTransform.x, true));
getApi().setUserVariables(u, vars);
In theory, since the variable is hidden (true), the client should get nothing. It's true, the client gets no variable changes but they do get a OnUserVariablesUpdate call. This is unnecesary traffic. Here it's what I have on the client:
public void OnUserVariablesUpdate(BaseEvent evt)
{
User user = (User)evt.Params["user"];
List<UserVariable> changedVars = (List<UserVariable>)evt.Params["variables"];
Debug.Log("User variables changed");
foreach (UserVariable v in changedVars)
{
Debug.Log("variable changed:" + v.Value + " to:" + user.GetVariable(v.Name).Value);
}
}
I will get tons of "User variables changed" text on the console but no one single "variable changed:" line. So no variable has changed from the client point of view, but it does get notification.
--
Joaquin Grech
bug on user variable updates
bug on user variable updates
Last edited by creat326 on 21 Feb 2011, 18:28, edited 1 time in total.
Yes, I can reproduce it, thanks for noticing. We'll add a fix in the next release.
You can anyways avoid the problem by using the API overloaded method:
setting the 3rd param to false.
Thanks
You can anyways avoid the problem by using the API overloaded method:
Code: Select all
setUserVariables(User owner, List<UserVariable> variables, boolean fireClientEvent, boolean fireServerEvent)
setting the 3rd param to false.
Thanks
Who is online
Users browsing this forum: No registered users and 60 guests