NetworkInfo
NetworkInfo provides current network connection statistics. In a Reflex module’s server.lua, the global NetworkInfo object is nil.
Where values come from
Section titled “Where values come from”The client networking system collects transport, interpolation, and tick timing statistics, while these properties return the current measured snapshot. The API sends nothing and cannot change connection settings.
Metrics cover the client’s whole game connection, not only tables sent through Network. Values change over time, so read them repeatedly when building a graph.
Quick example
Section titled “Quick example”print("Ping: " .. NetworkInfo.Ping .. " ms")print("Packet loss: " .. NetworkInfo.InPacketLossPercent .. "%")Properties
Section titled “Properties”Every property is read-only.
| Property | Type | Access | Unit | Description |
|---|---|---|---|---|
InKBps |
number |
get |
KB/s | Incoming traffic rate. |
InPacketLossPercent |
number |
get |
% |
Incoming packet loss. |
InterpolationDelayMs |
number |
get |
ms | Current interpolation delay. |
OutKBps |
number |
get |
KB/s | Outgoing traffic rate. |
OutPacketLossPercent |
number |
get |
% |
Outgoing packet loss. |
Ping |
integer |
get |
ms | Average ping based on recent measurements. |
RttSeconds |
number |
get |
s | Current round-trip time. |
ServerTickTimeMs |
number |
get |
ms | Processing time of a server network tick. |
TickTimeMs |
number |
get |
ms | Processing time of a network tick. |
Ping and RTT
Section titled “Ping and RTT”Ping and RttSeconds are not the same sample expressed in different units. During testing:
Pingwas44 ms;RttSeconds × 1000was approximately60.88 ms.
Use Ping for the ready-made average and RttSeconds when you need the current RTT in seconds. Do not expect exact equality between them.
Dynamic values
Section titled “Dynamic values”Metrics change while connected. Read them when updating an interface or collecting diagnostics:
Scheduler:OnFrame(function() local ping = NetworkInfo.Ping -- Update the interfaceend)Do not assign these properties: all nine setters raise a Lua access error.