| 1449 | //----------------------------------------------------------------------------- |
| 1450 | |
| 1451 | static 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 |
no test coverage detected