diff options
Diffstat (limited to 'indra/newview/llvoicevivox.cpp')
-rw-r--r-- | indra/newview/llvoicevivox.cpp | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index cf40058c34..e10ba77e16 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -658,6 +658,8 @@ void LLVivoxVoiceClient::voiceControlCoro() mIsCoroutineActive = true; LLCoros::set_consuming(true); + U32 retry = 0; + while (gAgent.getTeleportState() != LLAgent::TELEPORT_NONE) { LL_DEBUGS("Voice") << "Suspending voiceControlCoro() momentarily for teleport. Tuning: " << mTuningMode << ". Relog: " << mRelogRequested << LL_ENDL; @@ -666,7 +668,8 @@ void LLVivoxVoiceClient::voiceControlCoro() do { - if (startAndConnectSession()) + bool success = startAndConnectSession(); + if (success) { if (mTuningMode) { @@ -677,6 +680,7 @@ void LLVivoxVoiceClient::voiceControlCoro() LL_DEBUGS("Voice") << "lost channel RelogRequested=" << mRelogRequested << LL_ENDL; endAndDisconnectSession(); + retry = 0; } // if we hit this and mRelogRequested is true, that indicates @@ -689,7 +693,19 @@ void LLVivoxVoiceClient::voiceControlCoro() << LL_ENDL; if (mRelogRequested) { - LL_INFOS("Voice") << "will attempt to reconnect to voice" << LL_ENDL; + if (!success) + { + // We failed to connect, give it a bit time before retrying. + retry++; + F32 delay = llmin(5.f * (F32)retry, 60.f); + llcoro::suspendUntilTimeout(delay); + LL_INFOS("Voice") << "Voice failed to establish session after " << retry << " tries. Will attempt to reconnect." << LL_ENDL; + } + else + { + LL_INFOS("Voice") << "will attempt to reconnect to voice" << LL_ENDL; + } + while (isGatewayRunning() || gAgent.getTeleportState() != LLAgent::TELEPORT_NONE) { LL_INFOS("Voice") << "waiting for SLVoice to exit" << LL_ENDL; @@ -770,12 +786,16 @@ bool LLVivoxVoiceClient::startAndLaunchDaemon() { #ifndef VIVOXDAEMON_REMOTEHOST // Launch the voice daemon - std::string exe_path = gDirUtilp->getAppRODataDir(); #if LL_WINDOWS + // On windows use exe (not work or RO) directory + std::string exe_path = gDirUtilp->getExecutableDir(); gDirUtilp->append(exe_path, "SLVoice.exe"); #elif LL_DARWIN + // On MAC use resource directory + std::string exe_path = gDirUtilp->getAppRODataDir(); gDirUtilp->append(exe_path, "SLVoice"); #else + std::string exe_path = gDirUtilp->getExecutableDir(); gDirUtilp->append(exe_path, "SLVoice"); #endif // See if the vivox executable exists @@ -1460,6 +1480,11 @@ bool LLVivoxVoiceClient::addAndJoinSession(const sessionStatePtr_t &nextSession) LLSD timeoutResult(LLSDMap("session", "timeout")); + // We are about to start a whole new session. Anything that MIGHT still be in our + // maildrop is going to be stale and cause us much wailing and gnashing of teeth. + // Just flush it all out and start new. + voicePump.flush(); + // It appears that I need to wait for BOTH the SessionGroup.AddSession response and the SessionStateChangeEvent with state 4 // before continuing from this state. They can happen in either order, and if I don't wait for both, things can get stuck. // For now, the SessionGroup.AddSession response handler sets mSessionHandle and the SessionStateChangeEvent handler transitions to stateSessionJoined. |