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

Function updatePingProgress

Engine/source/app/net/serverQuery.cpp:1448–1471  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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