Skip to content
Snippets Groups Projects
Commit 8897ebeb authored by Roxie Linden's avatar Roxie Linden
Browse files

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.
parent b36dacce
No related branches found
No related tags found
No related merge requests found
...@@ -2150,8 +2150,21 @@ LLVoiceWebRTCConnection::LLVoiceWebRTCConnection(const LLUUID &regionID, const s ...@@ -2150,8 +2150,21 @@ LLVoiceWebRTCConnection::LLVoiceWebRTCConnection(const LLUUID &regionID, const s
mOutstandingRequests(0), mOutstandingRequests(0),
mChannelID(channelID), mChannelID(channelID),
mRegionID(regionID), mRegionID(regionID),
mPrimary(false),
mRetryWaitPeriod(0) mRetryWaitPeriod(0)
{ {
if (isSpatial())
{
if (gAgent.getRegion())
{
mPrimary = (regionID == gAgent.getRegion()->getRegionID());
}
}
else
{
mPrimary = true;
}
// retries wait a short period...randomize it so // retries wait a short period...randomize it so
// all clients don't try to reconnect at once. // all clients don't try to reconnect at once.
mRetryWaitSecs = ((F32) rand() / (RAND_MAX)) + 0.5; mRetryWaitSecs = ((F32) rand() / (RAND_MAX)) + 0.5;
...@@ -2755,6 +2768,17 @@ bool LLVoiceWebRTCConnection::connectionStateMachine() ...@@ -2755,6 +2768,17 @@ bool LLVoiceWebRTCConnection::connectionStateMachine()
{ {
mRetryWaitPeriod = 0; mRetryWaitPeriod = 0;
mRetryWaitSecs = ((F32) rand() / (RAND_MAX)) + 0.5; 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. // we'll stay here as long as the session remains up.
if (mShutDown) if (mShutDown)
...@@ -3023,7 +3047,7 @@ void LLVoiceWebRTCConnection::sendJoin() ...@@ -3023,7 +3047,7 @@ void LLVoiceWebRTCConnection::sendJoin()
Json::Value root = Json::objectValue; Json::Value root = Json::objectValue;
Json::Value join_obj = Json::objectValue; Json::Value join_obj = Json::objectValue;
LLUUID regionID = gAgent.getRegion()->getRegionID(); LLUUID regionID = gAgent.getRegion()->getRegionID();
if ((regionID == mRegionID) || !isSpatial()) if (mPrimary)
{ {
join_obj["p"] = true; join_obj["p"] = true;
} }
......
...@@ -622,7 +622,7 @@ class LLVoiceWebRTCConnection : ...@@ -622,7 +622,7 @@ class LLVoiceWebRTCConnection :
bool connectionStateMachine(); bool connectionStateMachine();
virtual bool isSpatial() = 0; virtual bool isSpatial() { return false; }
LLUUID getRegionID() { return mRegionID; } LLUUID getRegionID() { return mRegionID; }
...@@ -686,6 +686,7 @@ class LLVoiceWebRTCConnection : ...@@ -686,6 +686,7 @@ class LLVoiceWebRTCConnection :
LLVoiceClientStatusObserver::EStatusType mCurrentStatus; LLVoiceClientStatusObserver::EStatusType mCurrentStatus;
LLUUID mRegionID; LLUUID mRegionID;
bool mPrimary;
LLUUID mViewerSession; LLUUID mViewerSession;
std::string mChannelID; std::string mChannelID;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment