I am trying to add the ping next to my player's name on the player list.
Naturally, I enabled the lag monitor after the login as such:
Code: Select all
sfs.enableLagMonitor(true);
Then, when I receive the event, I set a user variable called "ping".
Code: Select all
private function onPingPong(evt:SFSEvent):void
{
var lag:int = evt.params.lagValue;
trace("PING PONG: "+lag);
if(handlers_pingPong != null){
handlers_pingPong(lag);
}
}
handlers_pingPong is a function in my lobby that I set before.
Here is the said function:
Code: Select all
private function pingPongHandler(lag:int):void{
trace("received ping, update user variable");
var userVars:Array = new Array();
userVars.push(new SFSUserVariable("ping", lag));
NetworkManager.getInstance().SetUserVariables(userVars);
}
All of this works, and the user variable call is sent.
However, I do not get a response from the server (a userVariableUpdate event) or something like that. Is there a reason why the server doesn't send me an update? It says in the documentation that this call should send the event even to the sender.