Add a public int BytesReceived to the top of TNGameClient.cs, then in the ProcessPacket function add: BytesReceived += buffer.size;
Now, in TNManager add a float BPSTimer = 0f, and an int BytesPerSecond. In TNManager's Update function, add this AFTER the call to mClient.ProcessPackets():
BPSTimer += Time.deltaTime;
if (BPSTimer >= 1f)
{
BPSTimer = 0f;
BytesPerSecond = mClient.BytesReceived;
mClient.BytesReceived = 0;
}
That'll get you incoming bytes per second on the client. Outgoing bytes could follow the same process, except you'd be looking into TNTcpProtocol::OnSend and TNUdpProtocol::OnSend functions. Stats on the server would, again, follow the same process, but you'd look into TNGameServer.cs::ThreadFunction for incoming bytes. Outgoing bytes on the server could use the same OnSend functions as the client. Timing bytes/sec on the standalone server is slightly more involved as you don't have Unity calling the Update function every frame, but for the sake of brevity I'll let you figure it out
