Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / How to calculate ping?

Author
Message
MummyKillerSLO
17
Years of Service
User Offline
Joined: 5th Jul 2009
Location: Object Position Y(ObjChair)
Posted: 10th Aug 2010 17:53
Hello!

I am making one game and now I don't know how to calculate ping between clients and server. I am using Multisync for networking.

Happy to having and using DarkBASIC Professional...
Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 10th Aug 2010 21:43
Are you talking about latency? If you are, use a time-stamp. Syncronize the clients to the server's "game-time" when they log in and each time the server sends out an update, send a DWORD time stamp at the beginning of the frame. You could do this EVERY update or you could do it periodically in a "latency" check.

The fastest code is the code never written.
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 11th Aug 2010 00:23
1. Grab the value of the timer.
2. Send it in a packet to the server.
3. Have the server do nothing with it, just send it back.
4. Compare the value in the packet to the current timer value.

That's your round-trip ping.

Login to post a reply

Server time is: 2026-07-25 07:02:08
Your offset time is: 2026-07-25 07:02:08