1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Display RTT (round trip time, ping) on client status text

This commit is contained in:
Perttu Ahola 2011-10-17 17:18:50 +03:00
parent 5037efdea9
commit 558a133044
3 changed files with 12 additions and 2 deletions

View file

@ -2166,4 +2166,11 @@ ClientEvent Client::getClientEvent()
return m_client_event_queue.pop_front();
}
float Client::getRTT(void)
{
con::Peer *peer = m_con.GetPeerNoEx(PEER_ID_SERVER);
if(!peer)
return 0.0;
return peer->avg_rtt;
}