time delay to get uservariables.....

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

shin myeong yong
Posts: 1
Joined: 20 Jun 2005, 20:55

time delay to get uservariables.....

Postby shin myeong yong » 20 Jun 2005, 21:17

i think there is some time delay for getting user-variables at onUserEnterRoom Event. i have tried to get the information of newly visitor at onUserEnterRoom event. Id, name and other informations except user variables are transfered properly on time. But, uservairables does not transfered at that event.

In debug mode, i have noticed uservariables are transferred well but the that information has some time delay.

finally, i can display newly arriving user's avata by following codes

//-------------------------------------------------------------------------------

sfsClient.onUserEnterRoom = function(roomId, userObj){
var id = userObj.id;
trace(userObj.name); //<---- displayed well
trace(userObj.id); //<---- displayed well
trace(userObj.variables.px); //<---- undefined.... not arrived yet !!
if(_root["avata"+id] == undefined){
onEnterFrame = function(){
if(userObj.variables.px != undefined) {
var _mc = avata.duplicateMovieClip("avata" + id, id);
_mc._x = userObj.variables.px;
_mc._y = userObj.variables.py;
trace(userObj.variables.px); //<---- displayed well arrived yet !!
delete onEnterFrame;
}
};
}
}


//---------------------------------------------------------------------------------

i think this time delay is caused by transfered-xml parsing delays..... could u explain about this situation more detail? should i use onEnterFrame event to check the arrival of user-variables?
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 21 Jun 2005, 07:24

There shouldn't be any delay in getting those informations, because they are sent at the same time and received at the same time.

Your code looks right but I can't see the rest of it, so the problem might be somewhere else.
I would suggest to pay attention to moving to another frame while waiting for server events as this may cause troubles.

If you check our "Avatar Chat" example you will notice that user variables are used and there aren't any particular delays nor you have to use that onEnterFrame trick...

:)
Lapo
--
gotoAndPlay()
...addicted to flash games

Return to “SmartFoxServer 1.x Discussions and Help”

Who is online

Users browsing this forum: No registered users and 37 guests