MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / updatePingProgress

Function updatePingProgress

Engine/source/app/net/serverQuery.cpp:1451–1474  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1449//-----------------------------------------------------------------------------
1450
1451static void updatePingProgress()
1452{
1453 if ( !gPingList.size() )
1454 {
1455 updateQueryProgress();
1456 return;
1457 }
1458
1459 char msg[64];
1460 U32 pingsLeft = countPingRequests();
1461 dSprintf( msg, sizeof(msg),
1462 (!pingsLeft && gPingList.size())?
1463 "Waiting for lan servers...":
1464 "Pinging servers: %d left...",
1465 pingsLeft );
1466
1467 // Ping progress is 0 -> 0.5
1468 F32 progress = 0.0f;
1469 if ( gServerPingCount )
1470 progress = F32( gServerPingCount - pingsLeft ) / F32( gServerPingCount * 2 );
1471
1472 //Con::errorf( ConsoleLogEntry::General, "Ping progress - %d of %d left - progress = %.2f", pingsLeft, gServerPingCount, progress );
1473 Con::executef( "onServerQueryStatus", "ping", msg, Con::getFloatArg( progress ) );
1474}
1475
1476//-----------------------------------------------------------------------------
1477

Callers 2

processPingsAndQueriesFunction · 0.85
handleGamePingResponseFunction · 0.85

Calls 6

updateQueryProgressFunction · 0.85
countPingRequestsFunction · 0.85
dSprintfFunction · 0.85
executefFunction · 0.85
getFloatArgFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected