C4 Engine Terathon Software C4 Engine API Documentation

• Message Manager

API Links
Developer Links

Player::GetNetworkPing

Defined in:  C4Messages.h
Returns the most recent ping between the local machine and the machine associated with a player.
Prototype

long GetNetworkPing(voidconst;

Description
The Network Manager records a ping value each time a reliable message is sent through a network connection. Calling GetNetworkPing returns the most recent ping value for a player. If messages are sent at long intervals, it may be desirable to send periodic messages of type PingMessage in order to maintain an up-to-date ping value.

Since client machines do not send messages directly to other clients, ping values are not available for these players and GetNetworkPing will return -1. Client machines can only retrieve the ping value between themselves and the server.
See Also
PingMessage