Throw 'area full' message when the voice server reports max users for voice

master
Roxie Linden 2024-03-24 20:43:37 -07:00
parent 92171a42c9
commit e272e387d3
2 changed files with 27 additions and 8 deletions

View File

@ -837,18 +837,20 @@ void LLWebRTCVoiceClient::OnConnectionShutDown(const std::string &channelID, con
}
}
}
void LLWebRTCVoiceClient::OnConnectionFailure(const std::string &channelID, const LLUUID &regionID)
void LLWebRTCVoiceClient::OnConnectionFailure(const std::string &channelID,
const LLUUID &regionID,
LLVoiceClientStatusObserver::EStatusType status_type)
{
LL_DEBUGS("Voice") << "A connection failed. channel:" << channelID << LL_ENDL;
if (gAgent.getRegion()->getRegionID() == regionID)
{
if (mNextSession && mNextSession->mChannelID == channelID)
{
LLWebRTCVoiceClient::getInstance()->notifyStatusObservers(LLVoiceClientStatusObserver::ERROR_UNKNOWN);
LLWebRTCVoiceClient::getInstance()->notifyStatusObservers(status_type);
}
else if (mSession && mSession->mChannelID == channelID)
{
LLWebRTCVoiceClient::getInstance()->notifyStatusObservers(LLVoiceClientStatusObserver::ERROR_UNKNOWN);
LLWebRTCVoiceClient::getInstance()->notifyStatusObservers(status_type);
}
}
}
@ -2030,6 +2032,7 @@ LLVoiceWebRTCConnection::LLVoiceWebRTCConnection(const LLUUID &regionID, const s
mWebRTCAudioInterface(nullptr),
mWebRTCDataInterface(nullptr),
mVoiceConnectionState(VOICE_STATE_START_SESSION),
mCurrentStatus(LLVoiceClientStatusObserver::STATUS_VOICE_ENABLED),
mMuted(true),
mShutDown(false),
mIceCompleted(false),
@ -2458,13 +2461,25 @@ void LLVoiceWebRTCSpatialConnection::requestVoiceConnection()
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
if (!status)
if (status)
{
setVoiceConnectionState(VOICE_STATE_SESSION_RETRY);
OnVoiceConnectionRequestSuccess(result);
}
else
{
OnVoiceConnectionRequestSuccess(result);
switch (status.getType())
{
case HTTP_CONFLICT:
mCurrentStatus = LLVoiceClientStatusObserver::ERROR_CHANNEL_FULL;
break;
case HTTP_UNAUTHORIZED:
mCurrentStatus = LLVoiceClientStatusObserver::ERROR_CHANNEL_LOCKED;
break;
default:
mCurrentStatus = LLVoiceClientStatusObserver::ERROR_UNKNOWN;
break;
}
setVoiceConnectionState(VOICE_STATE_SESSION_RETRY);
}
mOutstandingRequests--;
}
@ -2611,7 +2626,7 @@ bool LLVoiceWebRTCConnection::connectionStateMachine()
if (mRetryWaitPeriod++ * UPDATE_THROTTLE_SECONDS > mRetryWaitSecs)
{
// something went wrong, so notify that the connection has failed.
LLWebRTCVoiceClient::getInstance()->OnConnectionFailure(mChannelID, mRegionID);
LLWebRTCVoiceClient::getInstance()->OnConnectionFailure(mChannelID, mRegionID, mCurrentStatus);
setVoiceConnectionState(VOICE_STATE_DISCONNECT);
mRetryWaitPeriod = 0;
if (mRetryWaitSecs < MAX_RETRY_WAIT_SECONDS)

View File

@ -203,7 +203,9 @@ public:
void OnConnectionEstablished(const std::string& channelID, const LLUUID& regionID);
void OnConnectionShutDown(const std::string &channelID, const LLUUID &regionID);
void OnConnectionFailure(const std::string &channelID, const LLUUID& regionID);
void OnConnectionFailure(const std::string &channelID,
const LLUUID &regionID,
LLVoiceClientStatusObserver::EStatusType status_type = LLVoiceClientStatusObserver::ERROR_UNKNOWN);
void sendPositionUpdate(bool force);
void updateOwnVolume();
@ -675,6 +677,8 @@ class LLVoiceWebRTCConnection :
void breakVoiceConnectionCoro();
LLVoiceClientStatusObserver::EStatusType mCurrentStatus;
LLUUID mRegionID;
LLUUID mViewerSession;
std::string mChannelID;