MCPcopy Create free account
hub / github.com/dhewm/dhewm3 / SCR_DrawAsyncStats

Function SCR_DrawAsyncStats

neo/framework/Console.cpp:268–315  ·  view source on GitHub ↗

================== SCR_DrawAsyncStats ================== */

Source from the content-addressed store, hash-verified

266==================
267*/
268float SCR_DrawAsyncStats( float y ) {
269 int i, outgoingRate, incomingRate;
270 float outgoingCompression, incomingCompression;
271
272 if ( idAsyncNetwork::server.IsActive() ) {
273
274 SCR_DrawTextRightAlign( y, "server delay = %d msec", idAsyncNetwork::server.GetDelay() );
275 SCR_DrawTextRightAlign( y, "total outgoing rate = %d KB/s", idAsyncNetwork::server.GetOutgoingRate() >> 10 );
276 SCR_DrawTextRightAlign( y, "total incoming rate = %d KB/s", idAsyncNetwork::server.GetIncomingRate() >> 10 );
277
278 for ( i = 0; i < MAX_ASYNC_CLIENTS; i++ ) {
279
280 outgoingRate = idAsyncNetwork::server.GetClientOutgoingRate( i );
281 incomingRate = idAsyncNetwork::server.GetClientIncomingRate( i );
282 outgoingCompression = idAsyncNetwork::server.GetClientOutgoingCompression( i );
283 incomingCompression = idAsyncNetwork::server.GetClientIncomingCompression( i );
284
285 if ( outgoingRate != -1 && incomingRate != -1 ) {
286 SCR_DrawTextRightAlign( y, "client %d: out rate = %d B/s (% -2.1f%%), in rate = %d B/s (% -2.1f%%)",
287 i, outgoingRate, outgoingCompression, incomingRate, incomingCompression );
288 }
289 }
290
291 idStr msg;
292 idAsyncNetwork::server.GetAsyncStatsAvgMsg( msg );
293 SCR_DrawTextRightAlign( y, "%s", msg.c_str() );
294
295 } else if ( idAsyncNetwork::client.IsActive() ) {
296
297 outgoingRate = idAsyncNetwork::client.GetOutgoingRate();
298 incomingRate = idAsyncNetwork::client.GetIncomingRate();
299 outgoingCompression = idAsyncNetwork::client.GetOutgoingCompression();
300 incomingCompression = idAsyncNetwork::client.GetIncomingCompression();
301
302 if ( outgoingRate != -1 && incomingRate != -1 ) {
303 SCR_DrawTextRightAlign( y, "out rate = %d B/s (% -2.1f%%), in rate = %d B/s (% -2.1f%%)",
304 outgoingRate, outgoingCompression, incomingRate, incomingCompression );
305 }
306
307 SCR_DrawTextRightAlign( y, "packet loss = %d%%, client prediction = %d",
308 (int)idAsyncNetwork::client.GetIncomingPacketLoss(), idAsyncNetwork::client.GetPrediction() );
309
310 SCR_DrawTextRightAlign( y, "predicted frames: %d", idAsyncNetwork::client.GetPredictedFrames() );
311
312 }
313
314 return y;
315}
316
317/*
318==================

Callers 1

DrawMethod · 0.85

Calls 15

SCR_DrawTextRightAlignFunction · 0.85
GetDelayMethod · 0.80
GetClientOutgoingRateMethod · 0.80
GetClientIncomingRateMethod · 0.80
GetAsyncStatsAvgMsgMethod · 0.80
GetPredictionMethod · 0.80
GetPredictedFramesMethod · 0.80
IsActiveMethod · 0.45
GetOutgoingRateMethod · 0.45
GetIncomingRateMethod · 0.45

Tested by

no test coverage detected