diff options
author | Roxie Linden <roxie@lindenlab.com> | 2024-08-14 14:38:37 -0700 |
---|---|---|
committer | Roxie Linden <roxie@lindenlab.com> | 2024-08-14 14:42:59 -0700 |
commit | 8897ebeb6a0f1d96c7150385a01cb03cd0c43f50 (patch) | |
tree | 00666ec157a868eab9d935ed3db05b7abdec0a02 /indra/newview/llvoicewebrtc.cpp | |
parent | b36dacce33b074cd758f0e6f314924bcc50f817f (diff) |
Voice dot not always visible after crossing region boundaries.
For issue #2064
The connection to the voice server was not upgraded/downgraded to primary/secondary when crossing
region boundaries, so the server sent the wrong value and the viewer chose not to display a voice dot.
Diffstat (limited to 'indra/newview/llvoicewebrtc.cpp')
-rw-r--r-- | indra/newview/llvoicewebrtc.cpp | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/indra/newview/llvoicewebrtc.cpp b/indra/newview/llvoicewebrtc.cpp index 06baea4ba2..84d1e767f8 100644 --- a/indra/newview/llvoicewebrtc.cpp +++ b/indra/newview/llvoicewebrtc.cpp @@ -2150,8 +2150,21 @@ LLVoiceWebRTCConnection::LLVoiceWebRTCConnection(const LLUUID ®ionID, const s mOutstandingRequests(0), mChannelID(channelID), mRegionID(regionID), + mPrimary(false), mRetryWaitPeriod(0) { + if (isSpatial()) + { + if (gAgent.getRegion()) + { + mPrimary = (regionID == gAgent.getRegion()->getRegionID()); + } + } + else + { + mPrimary = true; + } + // retries wait a short period...randomize it so // all clients don't try to reconnect at once. mRetryWaitSecs = ((F32) rand() / (RAND_MAX)) + 0.5; @@ -2755,6 +2768,17 @@ bool LLVoiceWebRTCConnection::connectionStateMachine() { mRetryWaitPeriod = 0; mRetryWaitSecs = ((F32) rand() / (RAND_MAX)) + 0.5; + LLUUID agentRegionID; + if (isSpatial() && gAgent.getRegion()) + { + + bool primary = (mRegionID == gAgent.getRegion()->getRegionID()); + if (primary != mPrimary) + { + mPrimary = primary; + sendJoin(); + } + } // we'll stay here as long as the session remains up. if (mShutDown) @@ -3023,7 +3047,7 @@ void LLVoiceWebRTCConnection::sendJoin() Json::Value root = Json::objectValue; Json::Value join_obj = Json::objectValue; LLUUID regionID = gAgent.getRegion()->getRegionID(); - if ((regionID == mRegionID) || !isSpatial()) + if (mPrimary) { join_obj["p"] = true; } |