diff options
-rw-r--r-- | indra/newview/llvieweraudio.cpp | 26 | ||||
-rwxr-xr-x | indra/newview/llviewermessage.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llviewermessage.h | 4 |
3 files changed, 18 insertions, 16 deletions
diff --git a/indra/newview/llvieweraudio.cpp b/indra/newview/llvieweraudio.cpp index 7ac0d3aeaa..8d8c401dac 100644 --- a/indra/newview/llvieweraudio.cpp +++ b/indra/newview/llvieweraudio.cpp @@ -65,6 +65,7 @@ LLViewerAudio::~LLViewerAudio() { mTeleportFailedConnection.disconnect(); mTeleportFinishedConnection.disconnect(); + mTeleportStartedConnection.disconnect(); } void LLViewerAudio::registerIdleListener() @@ -74,7 +75,6 @@ void LLViewerAudio::registerIdleListener() mIdleListnerActive = true; doOnIdleRepeating(boost::bind(boost::bind(&LLViewerAudio::onIdleUpdate, this))); } - } void LLViewerAudio::startInternetStreamWithAutoFade(std::string streamURI) @@ -254,7 +254,16 @@ F32 LLViewerAudio::getFadeVolume() void LLViewerAudio::onTeleportStarted() { -llwarns << "DBG teleport started" << llendl; + if (!LLViewerAudio::getInstance()->getForcedTeleportFade()) + { + // Even though the music was turned off it was starting up (with autoplay disabled) occasionally + // after a failed teleport or after an intra-parcel teleport. Also, the music sometimes was not + // restarting after a successful intra-parcel teleport. Setting mWasPlaying fixes these issues. + LLViewerAudio::getInstance()->setWasPlaying(!gAudiop->getInternetStreamURL().empty()); + LLViewerAudio::getInstance()->setForcedTeleportFade(true); + LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(LLStringUtil::null); + LLViewerAudio::getInstance()->setNextStreamURI(LLStringUtil::null); + } } void LLViewerAudio::onTeleportFailed() @@ -398,23 +407,10 @@ void audio_update_volume(bool force_update) { if (!progress_view_visible && LLViewerAudio::getInstance()->getForcedTeleportFade()) { -LL_WARNS("FADING") << "DBG ForcedTeleportFade = true, WasPlaying = " << !gAudiop->getInternetStreamURL().empty() << " stream ='" << gAudiop->getInternetStreamURL() << "'" << LL_ENDL; LLViewerAudio::getInstance()->setWasPlaying(!gAudiop->getInternetStreamURL().empty()); LLViewerAudio::getInstance()->setForcedTeleportFade(false); } - if (progress_view_visible && !LLViewerAudio::getInstance()->getForcedTeleportFade()) - { -LL_WARNS("FADING") << "DBG ForcedTeleportFade = false, WasPlaying = " << !gAudiop->getInternetStreamURL().empty() << " stream ='" << gAudiop->getInternetStreamURL() << "'" << LL_ENDL; - // Even though the music was turned off it was starting up (with autoplay disabled) occasionally - // after a failed teleport or after an intra-parcel teleport. Also, the music sometimes was not - // restarting after a successful intra-parcel teleport. Setting mWasPlaying fixes these issues. - LLViewerAudio::getInstance()->setWasPlaying(!gAudiop->getInternetStreamURL().empty()); - LLViewerAudio::getInstance()->setForcedTeleportFade(true); - LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(LLStringUtil::null); - LLViewerAudio::getInstance()->setNextStreamURI(LLStringUtil::null); - } - F32 music_volume = gSavedSettings.getF32("AudioLevelMusic"); BOOL music_muted = gSavedSettings.getBOOL("MuteMusic"); F32 fade_volume = LLViewerAudio::getInstance()->getFadeVolume(); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 33ce8a79e1..536d3d2056 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -3417,6 +3417,9 @@ void process_teleport_start(LLMessageSystem *msg, void**) LL_DEBUGS("Messaging") << "Got TeleportStart with TeleportFlags=" << teleport_flags << ". gTeleportDisplay: " << gTeleportDisplay << ", gAgent.mTeleportState: " << gAgent.getTeleportState() << LL_ENDL; + // *NOTE: The server sends two StartTeleport packets when you are teleporting to a LM + LLViewerMessage::getInstance()->mTeleportStartedSignal(); + if (teleport_flags & TELEPORT_FLAGS_DISABLE_CANCEL) { gViewerWindow->setProgressCancelButtonVisible(FALSE); @@ -3436,6 +3439,7 @@ void process_teleport_start(LLMessageSystem *msg, void**) make_ui_sound("UISndTeleportOut"); LL_INFOS("Messaging") << "Teleport initiated by remote TeleportStart message with TeleportFlags: " << teleport_flags << LL_ENDL; + // Don't call LLFirstUse::useTeleport here because this could be // due to being killed, which would send you home, not to a Telehub } diff --git a/indra/newview/llviewermessage.h b/indra/newview/llviewermessage.h index e4fc77c06d..f326a5b29b 100644 --- a/indra/newview/llviewermessage.h +++ b/indra/newview/llviewermessage.h @@ -36,6 +36,9 @@ #include "stdenums.h" #include "llnotifications.h" +#include <boost/function.hpp> +#include <boost/signals2.hpp> + // // Forward declarations // @@ -211,7 +214,6 @@ public: typedef boost::signals2::signal<void()> teleport_started_signal_t; boost::signals2::connection setTeleportStartedCallback(teleport_started_callback_t cb); -protected: teleport_started_signal_t mTeleportStartedSignal; }; |