Author Topic: How to show the server's ping?  (Read 789 times)

I can't find anything through searching Coding Help.
How would I show the server ping? Like set it to a variable to be used in messageAll. I'm trying to add this into my Server Info Announcer on RTB.

serverConnection.getping()
Though on your own server it would be a very low number

If you want it to show like the pings that show in JoinServerGUI, I don't think you can, because I'm pretty sure thats the ping for the specific player that is querying at that time. You can't really have one ping that will be true for all clients, for example one could be your neighbor while another could the world and there'd be a large ping difference.

You could show a specific client's ping with
client.getping()
« Last Edit: July 25, 2010, 03:43:22 AM by Headcrab Zombie »

serverConnection.getping()
That's what I was looking for. Thank you.

Well, I'm not thinking it's accurate enough. Kalphiter tells me this, and I'm starting to believe that.

I just want to have my server's ping as a variable. Like my server sending the heartbeat to the master server kind of ping.

Everybody's ping towards you is different.

serverConnection.getping(); happened to work because you were hosting a non-dedicated server.

Like I said
If you want it to show like the pings that show in JoinServerGUI, I don't think you can, because I'm pretty sure thats the ping for the specific player that is querying at that time. You can't really have one ping that will be true for all clients, for example one could be your neighbor while another could the world and there'd be a large ping difference.