diff options
author | Armin Weatherwax | 2010-03-25 15:25:49 +0100 |
---|---|---|
committer | Jacek Antonelli | 2010-05-04 02:15:11 -0500 |
commit | f6ed529f2237975fb9a205cc6340a7159e44a404 (patch) | |
tree | 1bc6fa181e58107c618918b4e457376bf684a621 /linden/indra | |
parent | Clicking the money balance now does nothing on non-SL grids. (diff) | |
download | meta-impy-f6ed529f2237975fb9a205cc6340a7159e44a404.zip meta-impy-f6ed529f2237975fb9a205cc6340a7159e44a404.tar.gz meta-impy-f6ed529f2237975fb9a205cc6340a7159e44a404.tar.bz2 meta-impy-f6ed529f2237975fb9a205cc6340a7159e44a404.tar.xz |
disable voice temporaryly where no caps avail (renables on parcel change)
Diffstat (limited to 'linden/indra')
-rw-r--r-- | linden/indra/newview/llvoiceclient.cpp | 93 | ||||
-rw-r--r-- | linden/indra/newview/llvoiceclient.h | 2 |
2 files changed, 63 insertions, 32 deletions
diff --git a/linden/indra/newview/llvoiceclient.cpp b/linden/indra/newview/llvoiceclient.cpp index 67e4075..2c46832 100644 --- a/linden/indra/newview/llvoiceclient.cpp +++ b/linden/indra/newview/llvoiceclient.cpp | |||
@@ -1137,6 +1137,7 @@ 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; | ||
1140 | mUsePTT = true; | 1141 | mUsePTT = true; |
1141 | mPTTIsToggle = false; | 1142 | mPTTIsToggle = false; |
1142 | mEarLocation = 0; | 1143 | mEarLocation = 0; |
@@ -1349,13 +1350,17 @@ void LLVoiceClient::userAuthorized(const std::string& firstName, const std::stri | |||
1349 | 1350 | ||
1350 | void LLVoiceClient::requestVoiceAccountProvision(S32 retries) | 1351 | void LLVoiceClient::requestVoiceAccountProvision(S32 retries) |
1351 | { | 1352 | { |
1352 | if ( gAgent.getRegion() && mVoiceEnabled ) | 1353 | if ( gAgent.getRegion() && mVoiceEnabled && !mVoiceTemporaryDisabled) |
1353 | { | 1354 | { |
1354 | std::string url = | 1355 | std::string url = |
1355 | gAgent.getRegion()->getCapability( | 1356 | gAgent.getRegion()->getCapability( |
1356 | "ProvisionVoiceAccountRequest"); | 1357 | "ProvisionVoiceAccountRequest"); |
1357 | 1358 | ||
1358 | if ( url == "" ) return; | 1359 | if ( url.empty() ) |
1360 | { | ||
1361 | mVoiceTemporaryDisabled = true; | ||
1362 | return; | ||
1363 | } | ||
1359 | 1364 | ||
1360 | LLHTTPClient::post( | 1365 | LLHTTPClient::post( |
1361 | url, | 1366 | url, |
@@ -1532,7 +1537,7 @@ void LLVoiceClient::stateMachine() | |||
1532 | setVoiceEnabled(false); | 1537 | setVoiceEnabled(false); |
1533 | } | 1538 | } |
1534 | 1539 | ||
1535 | if(mVoiceEnabled) | 1540 | if(mVoiceEnabled && !mVoiceTemporaryDisabled) |
1536 | { | 1541 | { |
1537 | updatePosition(); | 1542 | updatePosition(); |
1538 | } | 1543 | } |
@@ -1591,18 +1596,29 @@ void LLVoiceClient::stateMachine() | |||
1591 | } | 1596 | } |
1592 | else | 1597 | else |
1593 | { | 1598 | { |
1594 | static int count = 0; | 1599 | if(!mVoiceTemporaryDisabled) |
1595 | static int count2 = 0; | ||
1596 | static int num = 1; | ||
1597 | ++count; | ||
1598 | if (count % num == 0) | ||
1599 | { | 1600 | { |
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; | 1601 | static int count = 0; |
1601 | if (num < 1000 && ++count2 == 10) | 1602 | static int count2 = 0; |
1602 | { | 1603 | static int num = 1; |
1603 | num *= 10; | 1604 | ++count; |
1604 | count2 = 0; | 1605 | if (count % num == 0) |
1605 | } | 1606 | { |
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 < 1000) | ||
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 | } | ||
1606 | } | 1622 | } |
1607 | } | 1623 | } |
1608 | } | 1624 | } |
@@ -1628,7 +1644,7 @@ void LLVoiceClient::stateMachine() | |||
1628 | 1644 | ||
1629 | //MARK: stateDisabled | 1645 | //MARK: stateDisabled |
1630 | case stateDisabled: | 1646 | case stateDisabled: |
1631 | if(mTuningMode || (mVoiceEnabled && !mAccountName.empty())) | 1647 | if(mTuningMode || (!mVoiceTemporaryDisabled && mVoiceEnabled && !mAccountName.empty())) |
1632 | { | 1648 | { |
1633 | setState(stateStart); | 1649 | setState(stateStart); |
1634 | } | 1650 | } |
@@ -1852,12 +1868,12 @@ void LLVoiceClient::stateMachine() | |||
1852 | mTuningExitState = stateIdle; | 1868 | mTuningExitState = stateIdle; |
1853 | setState(stateMicTuningStart); | 1869 | setState(stateMicTuningStart); |
1854 | } | 1870 | } |
1855 | else if(!mVoiceEnabled) | 1871 | else if(!mVoiceEnabled || mVoiceTemporaryDisabled) |
1856 | { | 1872 | { |
1857 | // We never started up the connector. This will shut down the daemon. | 1873 | // We never started up the connector. This will shut down the daemon. |
1858 | setState(stateConnectorStopped); | 1874 | setState(stateConnectorStopped); |
1859 | } | 1875 | } |
1860 | else if(!mAccountName.empty() && mVoiceEnabled) | 1876 | else if(!mAccountName.empty() && mVoiceEnabled && !mVoiceTemporaryDisabled) |
1861 | { | 1877 | { |
1862 | LLViewerRegion *region = gAgent.getRegion(); | 1878 | LLViewerRegion *region = gAgent.getRegion(); |
1863 | 1879 | ||
@@ -1874,6 +1890,7 @@ void LLVoiceClient::stateMachine() | |||
1874 | else | 1890 | else |
1875 | { | 1891 | { |
1876 | LL_DEBUGS("Voice") << "region doesn't have ProvisionVoiceAccountRequest capability!" << LL_ENDL; | 1892 | LL_DEBUGS("Voice") << "region doesn't have ProvisionVoiceAccountRequest capability!" << LL_ENDL; |
1893 | mVoiceTemporaryDisabled = true; | ||
1877 | } | 1894 | } |
1878 | } | 1895 | } |
1879 | } | 1896 | } |
@@ -1970,7 +1987,7 @@ void LLVoiceClient::stateMachine() | |||
1970 | 1987 | ||
1971 | //MARK: stateConnectorStart | 1988 | //MARK: stateConnectorStart |
1972 | case stateConnectorStart: | 1989 | case stateConnectorStart: |
1973 | if(!mVoiceEnabled) | 1990 | if(!mVoiceEnabled || mVoiceTemporaryDisabled) |
1974 | { | 1991 | { |
1975 | // We were never logged in. This will shut down the connector. | 1992 | // We were never logged in. This will shut down the connector. |
1976 | setState(stateLoggedOut); | 1993 | setState(stateLoggedOut); |
@@ -1988,7 +2005,7 @@ void LLVoiceClient::stateMachine() | |||
1988 | 2005 | ||
1989 | //MARK: stateConnectorStarted | 2006 | //MARK: stateConnectorStarted |
1990 | case stateConnectorStarted: // connector handle received | 2007 | case stateConnectorStarted: // connector handle received |
1991 | if(!mVoiceEnabled) | 2008 | if(!mVoiceEnabled || mVoiceTemporaryDisabled) |
1992 | { | 2009 | { |
1993 | // We were never logged in. This will shut down the connector. | 2010 | // We were never logged in. This will shut down the connector. |
1994 | setState(stateLoggedOut); | 2011 | setState(stateLoggedOut); |
@@ -2099,7 +2116,7 @@ void LLVoiceClient::stateMachine() | |||
2099 | 2116 | ||
2100 | //MARK: stateCreatingSessionGroup | 2117 | //MARK: stateCreatingSessionGroup |
2101 | case stateCreatingSessionGroup: | 2118 | case stateCreatingSessionGroup: |
2102 | if(mSessionTerminateRequested || !mVoiceEnabled) | 2119 | if(mSessionTerminateRequested || !mVoiceEnabled || mVoiceTemporaryDisabled) |
2103 | { | 2120 | { |
2104 | // TODO: Question: is this the right way out of this state | 2121 | // TODO: Question: is this the right way out of this state |
2105 | setState(stateSessionTerminated); | 2122 | setState(stateSessionTerminated); |
@@ -2122,7 +2139,7 @@ void LLVoiceClient::stateMachine() | |||
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. | 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. |
2123 | sendFriendsListUpdates(); | 2140 | sendFriendsListUpdates(); |
2124 | 2141 | ||
2125 | if(mSessionTerminateRequested || !mVoiceEnabled) | 2142 | if(mSessionTerminateRequested || !mVoiceEnabled || mVoiceTemporaryDisabled) |
2126 | { | 2143 | { |
2127 | // TODO: Question: Is this the right way out of this state? | 2144 | // TODO: Question: Is this the right way out of this state? |
2128 | setState(stateSessionTerminated); | 2145 | setState(stateSessionTerminated); |
@@ -2175,7 +2192,7 @@ void LLVoiceClient::stateMachine() | |||
2175 | //MARK: stateJoiningSession | 2192 | //MARK: stateJoiningSession |
2176 | case stateJoiningSession: // waiting for session handle | 2193 | case stateJoiningSession: // waiting for session handle |
2177 | // joinedAudioSession() will transition from here to stateSessionJoined. | 2194 | // joinedAudioSession() will transition from here to stateSessionJoined. |
2178 | if(!mVoiceEnabled) | 2195 | if(!mVoiceEnabled || mVoiceTemporaryDisabled) |
2179 | { | 2196 | { |
2180 | // User bailed out during connect -- jump straight to teardown. | 2197 | // User bailed out during connect -- jump straight to teardown. |
2181 | setState(stateSessionTerminated); | 2198 | setState(stateSessionTerminated); |
@@ -2219,7 +2236,7 @@ void LLVoiceClient::stateMachine() | |||
2219 | notifyStatusObservers(LLVoiceClientStatusObserver::STATUS_JOINED); | 2236 | notifyStatusObservers(LLVoiceClientStatusObserver::STATUS_JOINED); |
2220 | 2237 | ||
2221 | } | 2238 | } |
2222 | else if(!mVoiceEnabled) | 2239 | else if(!mVoiceEnabled || mVoiceTemporaryDisabled) |
2223 | { | 2240 | { |
2224 | // User bailed out during connect -- jump straight to teardown. | 2241 | // User bailed out during connect -- jump straight to teardown. |
2225 | setState(stateSessionTerminated); | 2242 | setState(stateSessionTerminated); |
@@ -2239,7 +2256,7 @@ void LLVoiceClient::stateMachine() | |||
2239 | //MARK: stateRunning | 2256 | //MARK: stateRunning |
2240 | case stateRunning: // steady state | 2257 | case stateRunning: // steady state |
2241 | // Disabling voice or disconnect requested. | 2258 | // Disabling voice or disconnect requested. |
2242 | if(!mVoiceEnabled || mSessionTerminateRequested) | 2259 | if(!mVoiceEnabled || mSessionTerminateRequested || mVoiceTemporaryDisabled) |
2243 | { | 2260 | { |
2244 | leaveAudioSession(); | 2261 | leaveAudioSession(); |
2245 | } | 2262 | } |
@@ -2382,7 +2399,7 @@ void LLVoiceClient::stateMachine() | |||
2382 | break; | 2399 | break; |
2383 | //MARK: stateConnectorFailedWaiting | 2400 | //MARK: stateConnectorFailedWaiting |
2384 | case stateConnectorFailedWaiting: | 2401 | case stateConnectorFailedWaiting: |
2385 | if(!mVoiceEnabled) | 2402 | if(!mVoiceEnabled || mVoiceTemporaryDisabled) |
2386 | { | 2403 | { |
2387 | setState(stateDisableCleanup); | 2404 | setState(stateDisableCleanup); |
2388 | } | 2405 | } |
@@ -2394,7 +2411,7 @@ void LLVoiceClient::stateMachine() | |||
2394 | break; | 2411 | break; |
2395 | //MARK: stateLoginFailedWaiting | 2412 | //MARK: stateLoginFailedWaiting |
2396 | case stateLoginFailedWaiting: | 2413 | case stateLoginFailedWaiting: |
2397 | if(!mVoiceEnabled) | 2414 | if(!mVoiceEnabled || mVoiceTemporaryDisabled) |
2398 | { | 2415 | { |
2399 | setState(stateDisableCleanup); | 2416 | setState(stateDisableCleanup); |
2400 | } | 2417 | } |
@@ -5046,17 +5063,27 @@ LLVoiceClient::participantState* LLVoiceClient::findParticipantByID(const LLUUID | |||
5046 | 5063 | ||
5047 | void LLVoiceClient::parcelChanged() | 5064 | void LLVoiceClient::parcelChanged() |
5048 | { | 5065 | { |
5066 | mVoiceTemporaryDisabled = false; | ||
5067 | |||
5049 | if(getState() >= stateNoChannel) | 5068 | if(getState() >= stateNoChannel) |
5050 | { | 5069 | { |
5051 | // If the user is logged in, start a channel lookup. | 5070 | // If the user is logged in, start a channel lookup. |
5052 | LL_DEBUGS("Voice") << "sending ParcelVoiceInfoRequest (" << mCurrentRegionName << ", " << mCurrentParcelLocalID << ")" << LL_ENDL; | 5071 | LL_DEBUGS("Voice") << "sending ParcelVoiceInfoRequest (" << mCurrentRegionName << ", " << mCurrentParcelLocalID << ")" << LL_ENDL; |
5053 | 5072 | ||
5054 | std::string url = gAgent.getRegion()->getCapability("ParcelVoiceInfoRequest"); | 5073 | std::string url = gAgent.getRegion()->getCapability("ParcelVoiceInfoRequest"); |
5055 | LLSD data; | 5074 | |
5056 | LLHTTPClient::post( | 5075 | if ( !url.empty() ) |
5057 | url, | 5076 | { |
5058 | data, | 5077 | LLSD data; |
5059 | new LLVoiceClientCapResponder); | 5078 | LLHTTPClient::post( |
5079 | url, | ||
5080 | data, | ||
5081 | new LLVoiceClientCapResponder); | ||
5082 | } | ||
5083 | else | ||
5084 | { | ||
5085 | mVoiceTemporaryDisabled = true; | ||
5086 | } | ||
5060 | } | 5087 | } |
5061 | else | 5088 | else |
5062 | { | 5089 | { |
@@ -5810,6 +5837,7 @@ void LLVoiceClient::setVoiceEnabled(bool enabled) | |||
5810 | if (enabled) | 5837 | if (enabled) |
5811 | { | 5838 | { |
5812 | LLVoiceChannel::getCurrentVoiceChannel()->activate(); | 5839 | LLVoiceChannel::getCurrentVoiceChannel()->activate(); |
5840 | mVoiceTemporaryDisabled =false; | ||
5813 | } | 5841 | } |
5814 | else | 5842 | else |
5815 | { | 5843 | { |
@@ -5832,7 +5860,7 @@ void LLVoiceClient::setLipSyncEnabled(BOOL enabled) | |||
5832 | BOOL LLVoiceClient::lipSyncEnabled() | 5860 | BOOL LLVoiceClient::lipSyncEnabled() |
5833 | { | 5861 | { |
5834 | 5862 | ||
5835 | if ( mVoiceEnabled && stateDisabled != getState() ) | 5863 | if ( !mVoiceTemporaryDisabled && mVoiceEnabled && stateDisabled != getState() ) |
5836 | { | 5864 | { |
5837 | return mLipSyncEnabled; | 5865 | return mLipSyncEnabled; |
5838 | } | 5866 | } |
@@ -6269,6 +6297,7 @@ LLVoiceClient::sessionState::sessionState() : | |||
6269 | mIsP2P(false), | 6297 | mIsP2P(false), |
6270 | mIncoming(false), | 6298 | mIncoming(false), |
6271 | mVoiceEnabled(false), | 6299 | mVoiceEnabled(false), |
6300 | mVoiceTemporaryDisabled(false), | ||
6272 | mReconnect(false), | 6301 | mReconnect(false), |
6273 | mVolumeDirty(false), | 6302 | mVolumeDirty(false), |
6274 | mParticipantsChanged(false) | 6303 | mParticipantsChanged(false) |
diff --git a/linden/indra/newview/llvoiceclient.h b/linden/indra/newview/llvoiceclient.h index cfc336b..d2ec752 100644 --- a/linden/indra/newview/llvoiceclient.h +++ b/linden/indra/newview/llvoiceclient.h | |||
@@ -330,6 +330,7 @@ static void updatePosition(void); | |||
330 | bool mIsP2P; | 330 | bool mIsP2P; |
331 | bool mIncoming; | 331 | bool mIncoming; |
332 | bool mVoiceEnabled; | 332 | bool mVoiceEnabled; |
333 | bool mVoiceTemporaryDisabled; | ||
333 | bool mReconnect; // Whether we should try to reconnect to this session if it's dropped | 334 | bool mReconnect; // Whether we should try to reconnect to this session if it's dropped |
334 | // Set to true when the mute state of someone in the participant list changes. | 335 | // Set to true when the mute state of someone in the participant list changes. |
335 | // The code will have to walk the list to find the changed participant(s). | 336 | // The code will have to walk the list to find the changed participant(s). |
@@ -725,6 +726,7 @@ static std::string nameFromsipURI(const std::string &uri); | |||
725 | bool mMicVolumeDirty; | 726 | bool mMicVolumeDirty; |
726 | 727 | ||
727 | bool mVoiceEnabled; | 728 | bool mVoiceEnabled; |
729 | bool mVoiceTemporaryDisabled; | ||
728 | bool mWriteInProgress; | 730 | bool mWriteInProgress; |
729 | std::string mWriteString; | 731 | std::string mWriteString; |
730 | size_t mWriteOffset; | 732 | size_t mWriteOffset; |