- Documentation
- Server functions
- getNetworkStats
Function
getNetworkStats
Returns network statistics for the server or one player: bytes and packets sent and received. The packet loss and buffer fields are zeros for now.
Syntax
table getNetworkStats([player thePlayer])Arguments
thePlayerplayer, optional- A player; the whole server without it.
Returns
A table with bytesReceived, bytesSent, packetsReceived, packetsSent and more, or false.
Example
local s = getNetworkStats(player)
outputServerLog(("%s: %d KB odebrane"):format(getPlayerName(player), s.bytesReceived / 1024))
See also
getSyncCostReturns how much player synchronisation has cost since the last call: the number of cycles (ticks), the average and longest cycle time in ms (avgMs,maxMs), states per cycle (statesPerTick) and the measured time (seconds). Helps to find server hitches.getPlayerPingReturns the player's ping in milliseconds.