Hello,
I searched the net, the documentation and the forums, but i couldn't find an answer to this question:
I would like to receive an event on my server side room extension when a user has exceeded the max idle time, is that possible?
Thanks,
Alex
user idle time out event
Hi.
Well, when an user is disconnected, independent from being idle or not, the server always fires an userLost event.
So, in this case, if you want to find out if the user was disconnected for being idle or not, i think the best way is to: When you get an userLost event, you get the user's last message time (the time he sent the last message to the server) by using the getLastMessageTime() method and then you check how much time has passed since then and if it is bigger or equal to the max time an user can be idle, so that user was disconnected for being idle.
Well, when an user is disconnected, independent from being idle or not, the server always fires an userLost event.
So, in this case, if you want to find out if the user was disconnected for being idle or not, i think the best way is to: When you get an userLost event, you get the user's last message time (the time he sent the last message to the server) by using the getLastMessageTime() method and then you check how much time has passed since then and if it is bigger or equal to the max time an user can be idle, so that user was disconnected for being idle.
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
You can't send that message from the extension, as the user is already disconnected and won't receive it. What you have to do is to show that message client-side, maybe have a client-level counter which counts the amount of time that user has being idle and when you get the disconnect event, you check the time you have been idle.
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.