aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llvoiceclient.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2010-05-08 16:25:10 -0500
committerJacek Antonelli2010-05-08 16:25:10 -0500
commit571bdc9fcfaec5182f6f020b6a31815ad9696da7 (patch)
tree5ab0e5d5bafedfe24a3171697522974a64572e53 /linden/indra/newview/llvoiceclient.cpp
parentRemoved the "Settings" section of Advanced Build Preferences. (diff)
downloadmeta-impy-571bdc9fcfaec5182f6f020b6a31815ad9696da7.zip
meta-impy-571bdc9fcfaec5182f6f020b6a31815ad9696da7.tar.gz
meta-impy-571bdc9fcfaec5182f6f020b6a31815ad9696da7.tar.bz2
meta-impy-571bdc9fcfaec5182f6f020b6a31815ad9696da7.tar.xz
Revert "disable voice temporaryly where no caps avail (renables on parcel change)"
It could potentially have unintended consequences for private voice conversations. This reverts commit f6ed529f2237975fb9a205cc6340a7159e44a404.
Diffstat (limited to 'linden/indra/newview/llvoiceclient.cpp')
-rw-r--r--linden/indra/newview/llvoiceclient.cpp93
1 files changed, 32 insertions, 61 deletions
diff --git a/linden/indra/newview/llvoiceclient.cpp b/linden/indra/newview/llvoiceclient.cpp
index c0d73e7..67e4075 100644
--- a/linden/indra/newview/llvoiceclient.cpp
+++ b/linden/indra/newview/llvoiceclient.cpp
@@ -1137,7 +1137,6 @@ LLVoiceClient::LLVoiceClient()
1137 1137
1138 // Use default values for everything then call updateSettings() after preferences are loaded 1138 // Use default values for everything then call updateSettings() after preferences are loaded
1139 mVoiceEnabled = false; 1139 mVoiceEnabled = false;
1140 mVoiceTemporaryDisabled = false;
1141 mUsePTT = true; 1140 mUsePTT = true;
1142 mPTTIsToggle = false; 1141 mPTTIsToggle = false;
1143 mEarLocation = 0; 1142 mEarLocation = 0;
@@ -1350,17 +1349,13 @@ void LLVoiceClient::userAuthorized(const std::string& firstName, const std::stri
1350 1349
1351void LLVoiceClient::requestVoiceAccountProvision(S32 retries) 1350void LLVoiceClient::requestVoiceAccountProvision(S32 retries)
1352{ 1351{
1353 if ( gAgent.getRegion() && mVoiceEnabled && !mVoiceTemporaryDisabled) 1352 if ( gAgent.getRegion() && mVoiceEnabled )
1354 { 1353 {
1355 std::string url = 1354 std::string url =
1356 gAgent.getRegion()->getCapability( 1355 gAgent.getRegion()->getCapability(
1357 "ProvisionVoiceAccountRequest"); 1356 "ProvisionVoiceAccountRequest");
1358 1357
1359 if ( url.empty() ) 1358 if ( url == "" ) return;
1360 {
1361 mVoiceTemporaryDisabled = true;
1362 return;
1363 }
1364 1359
1365 LLHTTPClient::post( 1360 LLHTTPClient::post(
1366 url, 1361 url,
@@ -1537,7 +1532,7 @@ void LLVoiceClient::stateMachine()
1537 setVoiceEnabled(false); 1532 setVoiceEnabled(false);
1538 } 1533 }
1539 1534
1540 if(mVoiceEnabled && !mVoiceTemporaryDisabled) 1535 if(mVoiceEnabled)
1541 { 1536 {
1542 updatePosition(); 1537 updatePosition();
1543 } 1538 }
@@ -1596,29 +1591,18 @@ void LLVoiceClient::stateMachine()
1596 } 1591 }
1597 else 1592 else
1598 { 1593 {
1599 if(!mVoiceTemporaryDisabled) 1594 static int count = 0;
1595 static int count2 = 0;
1596 static int num = 1;
1597 ++count;
1598 if (count % num == 0)
1600 { 1599 {
1601 static int count = 0; 1600 LL_DEBUGS("Voice") << "region doesn't have ParcelVoiceInfoRequest capability. This is normal for a short time after teleporting, but bad if it persists for very long (" << count << ")." << LL_ENDL;
1602 static int count2 = 0; 1601 if (num < 1000 && ++count2 == 10)
1603 static int num = 1; 1602 {
1604 ++count; 1603 num *= 10;
1605 if (count % num == 0) 1604 count2 = 0;
1606 { 1605 }
1607 LL_DEBUGS("Voice") << "region doesn't have ParcelVoiceInfoRequest capability. This is normal for a short time after teleporting, but bad if it persists for very long (" << count << ")." << LL_ENDL;
1608 if (num < 100)
1609 {
1610 if( ++count2 == 10)
1611 {
1612 num *= 10;
1613 count2 = 0;
1614 }
1615 }
1616 else
1617 {
1618 mVoiceTemporaryDisabled = true;
1619 count = 0;
1620 }
1621 }
1622 } 1606 }
1623 } 1607 }
1624 } 1608 }
@@ -1644,7 +1628,7 @@ void LLVoiceClient::stateMachine()
1644 1628
1645 //MARK: stateDisabled 1629 //MARK: stateDisabled
1646 case stateDisabled: 1630 case stateDisabled:
1647 if(mTuningMode || (!mVoiceTemporaryDisabled && mVoiceEnabled && !mAccountName.empty())) 1631 if(mTuningMode || (mVoiceEnabled && !mAccountName.empty()))
1648 { 1632 {
1649 setState(stateStart); 1633 setState(stateStart);
1650 } 1634 }
@@ -1868,12 +1852,12 @@ void LLVoiceClient::stateMachine()
1868 mTuningExitState = stateIdle; 1852 mTuningExitState = stateIdle;
1869 setState(stateMicTuningStart); 1853 setState(stateMicTuningStart);
1870 } 1854 }
1871 else if(!mVoiceEnabled || mVoiceTemporaryDisabled) 1855 else if(!mVoiceEnabled)
1872 { 1856 {
1873 // We never started up the connector. This will shut down the daemon. 1857 // We never started up the connector. This will shut down the daemon.
1874 setState(stateConnectorStopped); 1858 setState(stateConnectorStopped);
1875 } 1859 }
1876 else if(!mAccountName.empty() && mVoiceEnabled && !mVoiceTemporaryDisabled) 1860 else if(!mAccountName.empty() && mVoiceEnabled)
1877 { 1861 {
1878 LLViewerRegion *region = gAgent.getRegion(); 1862 LLViewerRegion *region = gAgent.getRegion();
1879 1863
@@ -1890,7 +1874,6 @@ void LLVoiceClient::stateMachine()
1890 else 1874 else
1891 { 1875 {
1892 LL_DEBUGS("Voice") << "region doesn't have ProvisionVoiceAccountRequest capability!" << LL_ENDL; 1876 LL_DEBUGS("Voice") << "region doesn't have ProvisionVoiceAccountRequest capability!" << LL_ENDL;
1893 mVoiceTemporaryDisabled = true;
1894 } 1877 }
1895 } 1878 }
1896 } 1879 }
@@ -1987,7 +1970,7 @@ void LLVoiceClient::stateMachine()
1987 1970
1988 //MARK: stateConnectorStart 1971 //MARK: stateConnectorStart
1989 case stateConnectorStart: 1972 case stateConnectorStart:
1990 if(!mVoiceEnabled || mVoiceTemporaryDisabled) 1973 if(!mVoiceEnabled)
1991 { 1974 {
1992 // We were never logged in. This will shut down the connector. 1975 // We were never logged in. This will shut down the connector.
1993 setState(stateLoggedOut); 1976 setState(stateLoggedOut);
@@ -2005,7 +1988,7 @@ void LLVoiceClient::stateMachine()
2005 1988
2006 //MARK: stateConnectorStarted 1989 //MARK: stateConnectorStarted
2007 case stateConnectorStarted: // connector handle received 1990 case stateConnectorStarted: // connector handle received
2008 if(!mVoiceEnabled || mVoiceTemporaryDisabled) 1991 if(!mVoiceEnabled)
2009 { 1992 {
2010 // We were never logged in. This will shut down the connector. 1993 // We were never logged in. This will shut down the connector.
2011 setState(stateLoggedOut); 1994 setState(stateLoggedOut);
@@ -2116,7 +2099,7 @@ void LLVoiceClient::stateMachine()
2116 2099
2117 //MARK: stateCreatingSessionGroup 2100 //MARK: stateCreatingSessionGroup
2118 case stateCreatingSessionGroup: 2101 case stateCreatingSessionGroup:
2119 if(mSessionTerminateRequested || !mVoiceEnabled || mVoiceTemporaryDisabled) 2102 if(mSessionTerminateRequested || !mVoiceEnabled)
2120 { 2103 {
2121 // TODO: Question: is this the right way out of this state 2104 // TODO: Question: is this the right way out of this state
2122 setState(stateSessionTerminated); 2105 setState(stateSessionTerminated);
@@ -2139,7 +2122,7 @@ void LLVoiceClient::stateMachine()
2139 // Otherwise, if you log in but don't join a proximal channel (such as when your login location has voice disabled), your friends list won't sync. 2122 // Otherwise, if you log in but don't join a proximal channel (such as when your login location has voice disabled), your friends list won't sync.
2140 sendFriendsListUpdates(); 2123 sendFriendsListUpdates();
2141 2124
2142 if(mSessionTerminateRequested || !mVoiceEnabled || mVoiceTemporaryDisabled) 2125 if(mSessionTerminateRequested || !mVoiceEnabled)
2143 { 2126 {
2144 // TODO: Question: Is this the right way out of this state? 2127 // TODO: Question: Is this the right way out of this state?
2145 setState(stateSessionTerminated); 2128 setState(stateSessionTerminated);
@@ -2192,7 +2175,7 @@ void LLVoiceClient::stateMachine()
2192 //MARK: stateJoiningSession 2175 //MARK: stateJoiningSession
2193 case stateJoiningSession: // waiting for session handle 2176 case stateJoiningSession: // waiting for session handle
2194 // joinedAudioSession() will transition from here to stateSessionJoined. 2177 // joinedAudioSession() will transition from here to stateSessionJoined.
2195 if(!mVoiceEnabled || mVoiceTemporaryDisabled) 2178 if(!mVoiceEnabled)
2196 { 2179 {
2197 // User bailed out during connect -- jump straight to teardown. 2180 // User bailed out during connect -- jump straight to teardown.
2198 setState(stateSessionTerminated); 2181 setState(stateSessionTerminated);
@@ -2236,7 +2219,7 @@ void LLVoiceClient::stateMachine()
2236 notifyStatusObservers(LLVoiceClientStatusObserver::STATUS_JOINED); 2219 notifyStatusObservers(LLVoiceClientStatusObserver::STATUS_JOINED);
2237 2220
2238 } 2221 }
2239 else if(!mVoiceEnabled || mVoiceTemporaryDisabled) 2222 else if(!mVoiceEnabled)
2240 { 2223 {
2241 // User bailed out during connect -- jump straight to teardown. 2224 // User bailed out during connect -- jump straight to teardown.
2242 setState(stateSessionTerminated); 2225 setState(stateSessionTerminated);
@@ -2256,7 +2239,7 @@ void LLVoiceClient::stateMachine()
2256 //MARK: stateRunning 2239 //MARK: stateRunning
2257 case stateRunning: // steady state 2240 case stateRunning: // steady state
2258 // Disabling voice or disconnect requested. 2241 // Disabling voice or disconnect requested.
2259 if(!mVoiceEnabled || mSessionTerminateRequested || mVoiceTemporaryDisabled) 2242 if(!mVoiceEnabled || mSessionTerminateRequested)
2260 { 2243 {
2261 leaveAudioSession(); 2244 leaveAudioSession();
2262 } 2245 }
@@ -2399,7 +2382,7 @@ void LLVoiceClient::stateMachine()
2399 break; 2382 break;
2400 //MARK: stateConnectorFailedWaiting 2383 //MARK: stateConnectorFailedWaiting
2401 case stateConnectorFailedWaiting: 2384 case stateConnectorFailedWaiting:
2402 if(!mVoiceEnabled || mVoiceTemporaryDisabled) 2385 if(!mVoiceEnabled)
2403 { 2386 {
2404 setState(stateDisableCleanup); 2387 setState(stateDisableCleanup);
2405 } 2388 }
@@ -2411,7 +2394,7 @@ void LLVoiceClient::stateMachine()
2411 break; 2394 break;
2412 //MARK: stateLoginFailedWaiting 2395 //MARK: stateLoginFailedWaiting
2413 case stateLoginFailedWaiting: 2396 case stateLoginFailedWaiting:
2414 if(!mVoiceEnabled || mVoiceTemporaryDisabled) 2397 if(!mVoiceEnabled)
2415 { 2398 {
2416 setState(stateDisableCleanup); 2399 setState(stateDisableCleanup);
2417 } 2400 }
@@ -5063,27 +5046,17 @@ LLVoiceClient::participantState* LLVoiceClient::findParticipantByID(const LLUUID
5063 5046
5064void LLVoiceClient::parcelChanged() 5047void LLVoiceClient::parcelChanged()
5065{ 5048{
5066 mVoiceTemporaryDisabled = false;
5067
5068 if(getState() >= stateNoChannel) 5049 if(getState() >= stateNoChannel)
5069 { 5050 {
5070 // If the user is logged in, start a channel lookup. 5051 // If the user is logged in, start a channel lookup.
5071 LL_DEBUGS("Voice") << "sending ParcelVoiceInfoRequest (" << mCurrentRegionName << ", " << mCurrentParcelLocalID << ")" << LL_ENDL; 5052 LL_DEBUGS("Voice") << "sending ParcelVoiceInfoRequest (" << mCurrentRegionName << ", " << mCurrentParcelLocalID << ")" << LL_ENDL;
5072 5053
5073 std::string url = gAgent.getRegion()->getCapability("ParcelVoiceInfoRequest"); 5054 std::string url = gAgent.getRegion()->getCapability("ParcelVoiceInfoRequest");
5074 5055 LLSD data;
5075 if ( !url.empty() ) 5056 LLHTTPClient::post(
5076 { 5057 url,
5077 LLSD data; 5058 data,
5078 LLHTTPClient::post( 5059 new LLVoiceClientCapResponder);
5079 url,
5080 data,
5081 new LLVoiceClientCapResponder);
5082 }
5083 else
5084 {
5085 mVoiceTemporaryDisabled = true;
5086 }
5087 } 5060 }
5088 else 5061 else
5089 { 5062 {
@@ -5837,7 +5810,6 @@ void LLVoiceClient::setVoiceEnabled(bool enabled)
5837 if (enabled) 5810 if (enabled)
5838 { 5811 {
5839 LLVoiceChannel::getCurrentVoiceChannel()->activate(); 5812 LLVoiceChannel::getCurrentVoiceChannel()->activate();
5840 mVoiceTemporaryDisabled =false;
5841 } 5813 }
5842 else 5814 else
5843 { 5815 {
@@ -5860,7 +5832,7 @@ void LLVoiceClient::setLipSyncEnabled(BOOL enabled)
5860BOOL LLVoiceClient::lipSyncEnabled() 5832BOOL LLVoiceClient::lipSyncEnabled()
5861{ 5833{
5862 5834
5863 if ( !mVoiceTemporaryDisabled && mVoiceEnabled && stateDisabled != getState() ) 5835 if ( mVoiceEnabled && stateDisabled != getState() )
5864 { 5836 {
5865 return mLipSyncEnabled; 5837 return mLipSyncEnabled;
5866 } 5838 }
@@ -6297,7 +6269,6 @@ LLVoiceClient::sessionState::sessionState() :
6297 mIsP2P(false), 6269 mIsP2P(false),
6298 mIncoming(false), 6270 mIncoming(false),
6299 mVoiceEnabled(false), 6271 mVoiceEnabled(false),
6300 mVoiceTemporaryDisabled(false),
6301 mReconnect(false), 6272 mReconnect(false),
6302 mVolumeDirty(false), 6273 mVolumeDirty(false),
6303 mParticipantsChanged(false) 6274 mParticipantsChanged(false)