MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / SendMessages

Method SendMessages

engine/Poseidon/Network/NetworkClientActions.cpp:2466–2803  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2464 if (!_finite(error))
2465 {
2466 RptF("Client: Infinite error catched on %s", (const char*)oInfo.object->GetDebugName());
2467 }
2468 }
2469 saturateMax(maxError, error);
2470 sumError += error;
2471 }
2472 }
2473 }
2474 /*
2475 #if _ENABLE_CHEATS
2476 if (outputDiags == 1 && sumError > 0)
2477 {
2478 char buf1[32], buf2[32];
2479 sprintf
2480 (
2481 output + strlen(output),
2482 "Err %s / %s",
2483 FormatVal(maxError, buf1),
2484 FormatVal(sumError, buf2)
2485 );
2486 GlobalShowMessage(1000, output);
2487 }
2488 #endif
2489 */
2490
2491 // sort local objects by errors
2492 QSort(objects.Data(), objects.Size(), CmpLocalObjects);
2493}
2494
2495void NetworkClient::SendMessages()
2496{
2497 // calculate limits
2498 int nMsg = 0, nBytes = 0;
2499 int nMsgMax, nBytesMax;
2500
2501 EstimateBandwidth(nMsgMax, nBytesMax);
2502
2503 // send enqueued guaranteed messages
2504
2505 const int nMsgMaxGuaranteed = nMsgMax;
2506 const int nBytesMaxGuaranteed = nBytesMax;
2507
2508 int maxSize = MaxSizeGuaranteed;
2509 while (_messageQueue.Size() > 0)
2510 {
2511 if (nMsg >= nMsgMaxGuaranteed || nBytes >= nBytesMaxGuaranteed)
2512 {
2513 /*
2514 #if _ENABLE_CHEATS
2515 if (outputDiags == 1)
2516 {
2517 strcat(output, "Limit reached");
2518 GlobalShowMessage(1000, output);
2519 }
2520 #endif
2521 */
2522 break;
2523 }

Callers

nothing calls this directly

Calls 12

DiagLogFFunction · 0.85
RemoveTextMethod · 0.80
ShowTextFMethod · 0.80
AUTO_STATIC_ARRAYFunction · 0.70
FormatFunction · 0.50
SizeMethod · 0.45
DeleteMethod · 0.45
IsServerMethod · 0.45
GetRefMethod · 0.45
ResizeMethod · 0.45
GetStatisticsMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected