Class UITKNetworkStats
A small heads-up overlay of what this client sends and receives, layer by layer: the game's own messages, the QUIC/UDP payload the transport puts on the network, and the estimated bytes on the wire once the IP and UDP headers are added. Toggled from the options panel.
public class UITKNetworkStats : UITKControl
- Inheritance
-
ObjectComponentBehaviourMonoBehaviourUITKNetworkStats
- Inherited Members
-
MonoBehaviour.IsInvoking()MonoBehaviour.CancelInvoke()MonoBehaviour.StopCoroutine(Coroutine)MonoBehaviour.StopAllCoroutines()MonoBehaviour.destroyCancellationTokenMonoBehaviour.useGUILayoutMonoBehaviour.didStartMonoBehaviour.didAwakeMonoBehaviour.runInEditModeBehaviour.enabledBehaviour.isActiveAndEnabledComponent.GetComponent<T>()Component.TryGetComponent<T>(out T)Component.GetComponentInChildren<T>()Component.GetComponentsInChildren<T>()Component.GetComponentInParent<T>()Component.GetComponentsInParent<T>()Component.GetComponents<T>()Component.GetComponentIndex()Component.CompareTag(TagHandle)Component.transformComponent.transformHandleComponent.gameObjectComponent.tagObject.GetEntityId()Object.MemberwiseClone()Object.GetInstanceID()Object.GetHashCode()Object.InstantiateAsync<T>(T)Object.InstantiateAsync<T>(T, Transform)Object.InstantiateAsync<T>(T, Vector3, Quaternion)Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion, Transform)Object.Instantiate(Object)Object.Instantiate(Object, Scene)Object.Instantiate<T>(T, InstantiateParameters)Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)Object.Instantiate(Object, Transform)Object.Instantiate<T>(T)Object.Instantiate<T>(T, Vector3, Quaternion)Object.Instantiate<T>(T, Vector3, Quaternion, Transform)Object.Instantiate<T>(T, Transform)Object.Destroy(Object)Object.DestroyImmediate(Object)Object.DontDestroyOnLoad(Object)Object.DestroyObject(Object)Object.FindObjectsOfType<T>()Object.FindObjectsByType<T>(FindObjectsSortMode)Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)Object.FindObjectOfType<T>()Object.FindFirstObjectByType<T>()Object.FindAnyObjectByType<T>()Object.FindFirstObjectByType<T>(FindObjectsInactive)Object.FindAnyObjectByType<T>(FindObjectsInactive)Object.FindObjectsByType<T>()Object.FindObjectsByType<T>(FindObjectsInactive)Object.ToString()Object.nameObject.hideFlags
Remarks
Where the numbers come from. Everything is read through FishNet.Transporting.WebTransport.TransportTraffic.Capture(out FishNet.Transporting.WebTransport.TransportTrafficSnapshot), the transport's own accounting, and never through FishNet's statistics manager (off in release builds, internal, and double-counting in development ones). Every figure carries the transport's FishNet.Transporting.WebTransport.TrafficMeasure, and every row shows it as a badge whose tooltip says why: a layer this process cannot see is labelled an estimate, and a value it cannot know is a dash. The rules between the counters and the text are in NetworkStatsPresentation; the smoothing and the graph's memory are in NetworkStatsSampler. Both are pure, and both are tested.
Cost. Nothing happens while the overlay is hidden: OnTick() runs for hidden panels too and returns at once. While shown it captures one snapshot a second (allocation-free) and rewrites its labels only when a new sample has arrived, at most MaxRefreshesPerSecond times a second — nothing it shows changes faster than the sample. Capturing is also what keeps the transport refreshing the connection's round-trip figures, which it stops doing a few seconds after the last capture, so a hidden overlay costs the connection nothing either.
Why it lives in ClientPreboot. That scene persists for the whole session, so the overlay works on the login, server-select and character-select screens as well as in the world — and those hops are exactly where handshakes show up in the numbers. The process-lifetime totals survive every hop.
Visibility has one owner, Enabled, applied in FishMMO.Client.UITKNetworkStats.ApplySettings(). Quit-to-login re-applies it rather than following the generic close-or-show rule, since the player's choice is what decides.
Fields
MaxRefreshesPerSecond
Ceiling on label rewrites.
public const double MaxRefreshesPerSecond = 4
Field Value
PanelName
Name this panel registers under with UIManager: its GameObject name.
public const string PanelName = "UINetworkStats"
Field Value
RowStems
Element-name stem of each row, indexed by NetworkStatsRow.
public static readonly string[] RowStems
Field Value
- string[]
SampleIntervalSeconds
Seconds between snapshots.
public const double SampleIntervalSeconds = 1
Field Value
Properties
CanDrag
Draggable by its header, like the resource bars: it is a readout the player places, and no default corner suits every HUD arrangement and every login screen.
protected override bool CanDrag { get; }
Property Value
CurrentReadout
What the labels currently show.
public NetworkStatsReadout CurrentReadout { get; }
Property Value
Layer
Draw order tier for this panel. See UITKPanelLayer.
protected override UITKPanelLayer Layer { get; }
Property Value
Sampler
The smoothing window and graph memory. Exposed for tests and the render harness.
public NetworkStatsSampler Sampler { get; }
Property Value
Methods
Ingest(in TransportTrafficSnapshot)
Feeds one snapshot into the window and the graph. OnTick() calls this once a second; tests and the render harness call it with fabricated snapshots.
public void Ingest(in TransportTrafficSnapshot snapshot)
Parameters
snapshotTransportTrafficSnapshot
OnAfterShow()
Starts a fresh window and graph on every open, and samples on the next frame.
protected override void OnAfterShow()
Remarks
Nothing was sampled while the overlay was hidden, so keeping the old window would average across the hidden spell and join its ends in the graph as adjacent seconds.
OnDestroying()
Unsubscribes from the settings.
public override void OnDestroying()
OnQuitToLogin()
Re-applies the player's choice after the generic quit-to-login rule has run.
public override void OnQuitToLogin()
OnStarting()
Resolves the rows, builds the graph lines, wires the tooltips, subscribes to the settings and applies them. Runs once per visual tree.
public override void OnStarting()
OnTick()
Samples once a second and refreshes the labels when a new sample is in, only while shown.
protected override void OnTick()
Refresh()
Writes the current readout into every label, badge and graph line.
public void Refresh()