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:
parent
5037efdea9
commit
558a133044
3 changed files with 12 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue