i am stuck with a very weird problem.
i have made a simple private chat application.
scenario :
3 users are online(userid-1,userid-2,userid-3 are assigned by the sfsserver). all are able to ping each other and are receiving the messages. now user-1 gets disconnected due to idle user time expiry. He reconnects by pressing retry button which lets him reconnect to the private chat room again. Now the problem comes !
- when userid-2 or userid-3 try to ping him the message does not go! i debugged by method tht sends the message which is as follows :
Code: Select all
public function sendPrivateMessageTo(msg:String, sendToNickName:String):void
{
if(sfs.userManager.getUserByName(sendToNickName)!=null)
sfs.send(new PrivateMessageRequest(msg,sfs.userManager.getUserByName(sendToNickName).id));
} i saw the server trace and it said :
"private message recipient not available" and hence the message was not going as userid-1 neva existed..
I dont understand why sfs.userManager.getUserByName(sendToNickName).id gave 1 instead of 4!
and more confusion occured when userid-2 was able to get the value of reconnected user's new userid as 4 which was expected.
however another client which was open in another tab (the userid-3) was getting this value as 2!
why was the usermanager not getting updated on userid-3 and was updated on userid-2 ?
any ideas will help