Skip to content

Commit

Permalink
Mode 3: adjust delay calculation
Browse files Browse the repository at this point in the history
- use simulated delay to influence simulated latency delay
  • Loading branch information
jjolano committed Mar 24, 2022
1 parent b456e63 commit 218c475
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion XivAlexander/Apps/MainApp/Internal/NetworkTimingHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,8 @@ struct XivAlexander::Apps::MainApp::Internal::NetworkTimingHandler::Implementati
description << std::format(" latEst={}us", latencyEstimate);

// Add delay based on latency.
const auto delay = std::max(latencyEstimate / 2, (latencyEstimate + latencyAdjustedImmediate) / 4);
const auto delayBase = std::max(latencyEstimate / 2, (latencyEstimate + latencyAdjustedImmediate) / 4);
const auto delay = (delayBase + std::min(rttAdjusted - latencyEstimate, rttAdjusted - latencyAdjustedImmediate)) / 2;
description << std::format(" delayAdj={}us", delay);

if (rttUs > 80000 && latencyUs < 10000) {
Expand Down

0 comments on commit 218c475

Please sign in to comment.