bug on user variable updates
Posted: 20 Feb 2011, 18:55
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
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