how to add Ping : Measure Time Latency?
im trying to make a fighting and I wonna know how to add in ping.
how to add Ping : Measure Time Latency
-
Fantasticx
- Posts: 17
- Joined: 14 Aug 2011, 05:02
- Contact:
-
jamalsoueidan
- Posts: 153
- Joined: 15 Aug 2011, 16:33
You need to calculated yourself 
Check this post.
http://forums.smartfoxserver.com/viewtopic.php?t=12030
Check this post.
http://forums.smartfoxserver.com/viewtopic.php?t=12030
---------------------------------------------------
Jamal Soueidan
http://linkedin.com/in/jamalsoueidan
Jamal Soueidan
http://linkedin.com/in/jamalsoueidan
Hi, it depends if you want server-side ping measurement or client-side only.
If you want server-side, then yes, you need to make your own custom implementation but, if you want it client-side, you can use the enableLagMonitor method of the SmartFox class and then listen to the pingPong event
If you want server-side, then yes, you need to make your own custom implementation but, if you want it client-side, you can use the enableLagMonitor method of the SmartFox class and then listen to the pingPong event
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.
-
Fantasticx
- Posts: 17
- Joined: 14 Aug 2011, 05:02
- Contact:
-
Fantasticx
- Posts: 17
- Joined: 14 Aug 2011, 05:02
- Contact:
to enable the lag monitor you do sfs.enableLagMonitor(true) and then you listen to the pingPong event by doing sfs.addEventListener(SFSEvent.PING_PONG, pingPongHandler).
To show it to the other user, you could, for example, store the lag value as an UserVariable.
To show it to the other user, you could, for example, store the lag value as an UserVariable.
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.