| 1446 | //----------------------------------------------------------------------------- |
| 1447 | |
| 1448 | static 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 |
no test coverage detected