From c4ddaf67cb31517c3d5e379d0237a21d1d7b2c9d Mon Sep 17 00:00:00 2001 From: prep Date: Thu, 1 Mar 2012 17:33:45 -0500 Subject: path-264: Locking avatar in place when pathing floater is up. --- indra/newview/llagent.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'indra/newview/llagent.cpp') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index ab9b5ff436..657e464cbb 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -88,6 +88,7 @@ #include "llworld.h" #include "llworldmap.h" #include "stringize.h" +#include "llfloaterpathfindingconsole.h" using namespace LLVOAvatarDefines; @@ -399,6 +400,12 @@ void LLAgent::ageChat() //----------------------------------------------------------------------------- void LLAgent::moveAt(S32 direction, bool reset) { + LLFloaterPathfindingConsole* pWindow = LLFloaterPathfindingConsole::getInstanceHandle().get(); + if ( pWindow && pWindow->getHeartBeat() ) + { + return; + } + mMoveTimer.reset(); LLFirstUse::notMoving(false); @@ -427,6 +434,11 @@ void LLAgent::moveAt(S32 direction, bool reset) //----------------------------------------------------------------------------- void LLAgent::moveAtNudge(S32 direction) { + LLFloaterPathfindingConsole* pWindow = LLFloaterPathfindingConsole::getInstanceHandle().get(); + if ( pWindow && pWindow->getHeartBeat() ) + { + return; + } mMoveTimer.reset(); LLFirstUse::notMoving(false); @@ -648,6 +660,12 @@ void LLAgent::setFlying(BOOL fly) // static void LLAgent::toggleFlying() { + LLFloaterPathfindingConsole* pWindow = LLFloaterPathfindingConsole::getInstanceHandle().get(); + if ( pWindow && pWindow->getHeartBeat() ) + { + return; + } + if ( gAgent.mAutoPilot ) { LLToolPie::instance().stopClickToWalk(); @@ -2706,6 +2724,12 @@ void LLAgent::sendAnimationRequest(const LLUUID &anim_id, EAnimRequest request) void LLAgent::sendWalkRun(bool running) { + LLFloaterPathfindingConsole* pWindow = LLFloaterPathfindingConsole::getInstanceHandle().get(); + if ( pWindow->getHeartBeat() ) + { + return; + } + LLMessageSystem* msgsys = gMessageSystem; if (msgsys) { -- cgit v1.2.3 From c2a7006413ea5e4a0bf7b8b75fe5afdb51e9a6e5 Mon Sep 17 00:00:00 2001 From: prep Date: Fri, 2 Mar 2012 11:28:49 -0500 Subject: path-356: purging any data from the pathinglib after a successfull teleport. --- indra/newview/llagent.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview/llagent.cpp') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 657e464cbb..1132ee4ea8 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -3661,6 +3661,9 @@ void LLAgent::setTeleportState(ETeleportState state) // Let the interested parties know we've teleported. LLViewerParcelMgr::getInstance()->onTeleportFinished(false, getPositionGlobal()); + + //Since we teleported into a new region, we need to cleanup up any navmesh residuals + if ( LLPathingLib::getInstance() ) { LLPathingLib::getInstance()->cleanupResidual(); } break; default: -- cgit v1.2.3 From e558f5cb0b8c0937da0f08a1af149afbc497462c Mon Sep 17 00:00:00 2001 From: prep Date: Mon, 12 Mar 2012 15:04:09 -0400 Subject: path-405: Avatar is no longer frozen when pathing window is up and when avatar crosses a region boundary the resident is informed with a message in the pathing window. --- indra/newview/llagent.cpp | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) (limited to 'indra/newview/llagent.cpp') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 1132ee4ea8..9d23d439fa 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -400,12 +400,7 @@ void LLAgent::ageChat() //----------------------------------------------------------------------------- void LLAgent::moveAt(S32 direction, bool reset) { - LLFloaterPathfindingConsole* pWindow = LLFloaterPathfindingConsole::getInstanceHandle().get(); - if ( pWindow && pWindow->getHeartBeat() ) - { - return; - } - + mMoveTimer.reset(); LLFirstUse::notMoving(false); @@ -434,11 +429,6 @@ void LLAgent::moveAt(S32 direction, bool reset) //----------------------------------------------------------------------------- void LLAgent::moveAtNudge(S32 direction) { - LLFloaterPathfindingConsole* pWindow = LLFloaterPathfindingConsole::getInstanceHandle().get(); - if ( pWindow && pWindow->getHeartBeat() ) - { - return; - } mMoveTimer.reset(); LLFirstUse::notMoving(false); @@ -660,11 +650,6 @@ void LLAgent::setFlying(BOOL fly) // static void LLAgent::toggleFlying() { - LLFloaterPathfindingConsole* pWindow = LLFloaterPathfindingConsole::getInstanceHandle().get(); - if ( pWindow && pWindow->getHeartBeat() ) - { - return; - } if ( gAgent.mAutoPilot ) { @@ -2724,12 +2709,7 @@ void LLAgent::sendAnimationRequest(const LLUUID &anim_id, EAnimRequest request) void LLAgent::sendWalkRun(bool running) { - LLFloaterPathfindingConsole* pWindow = LLFloaterPathfindingConsole::getInstanceHandle().get(); - if ( pWindow->getHeartBeat() ) - { - return; - } - + LLMessageSystem* msgsys = gMessageSystem; if (msgsys) { -- cgit v1.2.3 From f1109baffa7619750807a9e9d23e47c7f1d8f77a Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Tue, 13 Mar 2012 10:37:25 -0700 Subject: Removing an unreferenced .h file and replacing it with a more specific one. --- indra/newview/llagent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llagent.cpp') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 9d23d439fa..9fb66fe630 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -88,7 +88,7 @@ #include "llworld.h" #include "llworldmap.h" #include "stringize.h" -#include "llfloaterpathfindingconsole.h" +#include "LLPathingLib.h" using namespace LLVOAvatarDefines; -- cgit v1.2.3 From 2f4ad07633264688f5335022f65bfab095c19815 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Tue, 20 Mar 2012 17:38:58 -0700 Subject: Cleaning up miscellaneous differences between the pathfinding repository and the latest viewer-development. --- indra/newview/llagent.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'indra/newview/llagent.cpp') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 8fd6c2605f..0102fb8270 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -396,7 +396,6 @@ void LLAgent::ageChat() //----------------------------------------------------------------------------- void LLAgent::moveAt(S32 direction, bool reset) { - mMoveTimer.reset(); LLFirstUse::notMoving(false); @@ -646,7 +645,6 @@ void LLAgent::setFlying(BOOL fly) // static void LLAgent::toggleFlying() { - if ( gAgent.mAutoPilot ) { LLToolPie::instance().stopClickToWalk(); @@ -2705,7 +2703,6 @@ void LLAgent::sendAnimationRequest(const LLUUID &anim_id, EAnimRequest request) void LLAgent::sendWalkRun(bool running) { - LLMessageSystem* msgsys = gMessageSystem; if (msgsys) { -- cgit v1.2.3 From 8c5a7a9c5d9ff391ae367a66ce88930d5121723a Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Thu, 5 Apr 2012 18:07:20 -0700 Subject: Removing unneeded code because we have the pathfinding console working to correctly when teleporting or crossing region boundaries. --- indra/newview/llagent.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'indra/newview/llagent.cpp') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 0102fb8270..3870a3be2e 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -88,7 +88,6 @@ #include "llworld.h" #include "llworldmap.h" #include "stringize.h" -#include "LLPathingLib.h" using namespace LLVOAvatarDefines; @@ -3634,9 +3633,6 @@ void LLAgent::setTeleportState(ETeleportState state) // Let the interested parties know we've teleported. LLViewerParcelMgr::getInstance()->onTeleportFinished(false, getPositionGlobal()); - - //Since we teleported into a new region, we need to cleanup up any navmesh residuals - if ( LLPathingLib::getInstance() ) { LLPathingLib::getInstance()->cleanupResidual(); } break; default: -- cgit v1.2.3 From a85bf36d4fd5026dac21f95432d06a7c0dd766d4 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Thu, 10 May 2012 20:20:55 -0700 Subject: EXP-1928: Adding fundamentals for managing a teleport request in such a way that it can be restarted. --- indra/newview/llagent.cpp | 192 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 191 insertions(+), 1 deletion(-) (limited to 'indra/newview/llagent.cpp') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 3870a3be2e..d7c39ff78d 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -112,6 +112,81 @@ const F32 MAX_FIDGET_TIME = 20.f; // seconds // The agent instance. LLAgent gAgent; +class LLTeleportRequest +{ +public: + LLTeleportRequest(); + virtual ~LLTeleportRequest(); + + virtual void doTeleport() = 0; + +protected: + +private: + +}; + +class LLTeleportRequestViaLandmark : public LLTeleportRequest +{ +public: + LLTeleportRequestViaLandmark(const LLUUID &pLandmarkId); + virtual ~LLTeleportRequestViaLandmark(); + + virtual void doTeleport(); + +protected: + inline const LLUUID &getLandmarkId() const {return mLandmarkId;}; + +private: + LLUUID mLandmarkId; +}; + +class LLTeleportRequestViaLure : public LLTeleportRequestViaLandmark +{ +public: + LLTeleportRequestViaLure(const LLUUID &pLureId, BOOL pIsLureGodLike); + virtual ~LLTeleportRequestViaLure(); + + virtual void doTeleport(); + +protected: + inline BOOL isLureGodLike() const {return mIsLureGodLike;}; + +private: + BOOL mIsLureGodLike; +}; + +class LLTeleportRequestViaLocation : public LLTeleportRequest +{ +public: + LLTeleportRequestViaLocation(const LLVector3d &pPosGlobal); + virtual ~LLTeleportRequestViaLocation(); + + virtual void doTeleport(); + +protected: + inline const LLVector3d &getPosGlobal() const {return mPosGlobal;}; + +private: + LLVector3d mPosGlobal; +}; + + +class LLTeleportRequestViaLocationLookAt : public LLTeleportRequestViaLocation +{ +public: + LLTeleportRequestViaLocationLookAt(const LLVector3d &pPosGlobal); + virtual ~LLTeleportRequestViaLocationLookAt(); + + virtual void doTeleport(); + +protected: + +private: + +}; + + //-------------------------------------------------------------------- // Statics // @@ -3494,6 +3569,13 @@ void LLAgent::teleportRequest( // Landmark ID = LLUUID::null means teleport home void LLAgent::teleportViaLandmark(const LLUUID& landmark_asset_id) +{ + llassert(mTeleportRequest == NULL); + mTeleportRequest = LLTeleportRequestPtr(new LLTeleportRequestViaLandmark(landmark_asset_id)); + mTeleportRequest->doTeleport(); +} + +void LLAgent::doTeleportViaLandmark(const LLUUID& landmark_asset_id) { LLViewerRegion *regionp = getRegion(); if(regionp && teleportCore()) @@ -3509,6 +3591,13 @@ void LLAgent::teleportViaLandmark(const LLUUID& landmark_asset_id) } void LLAgent::teleportViaLure(const LLUUID& lure_id, BOOL godlike) +{ + llassert(mTeleportRequest == NULL); + mTeleportRequest = LLTeleportRequestPtr(new LLTeleportRequestViaLure(lure_id, godlike)); + mTeleportRequest->doTeleport(); +} + +void LLAgent::doTeleportViaLure(const LLUUID& lure_id, BOOL godlike) { LLViewerRegion* regionp = getRegion(); if(regionp && teleportCore()) @@ -3558,6 +3647,13 @@ void LLAgent::teleportCancel() void LLAgent::teleportViaLocation(const LLVector3d& pos_global) +{ + llassert(mTeleportRequest == NULL); + mTeleportRequest = LLTeleportRequestPtr(new LLTeleportRequestViaLocation(pos_global)); + mTeleportRequest->doTeleport(); +} + +void LLAgent::doTeleportViaLocation(const LLVector3d& pos_global) { LLViewerRegion* regionp = getRegion(); U64 handle = to_region_handle(pos_global); @@ -3600,6 +3696,13 @@ void LLAgent::teleportViaLocation(const LLVector3d& pos_global) // Teleport to global position, but keep facing in the same direction void LLAgent::teleportViaLocationLookAt(const LLVector3d& pos_global) +{ + llassert(mTeleportRequest == NULL); + mTeleportRequest = LLTeleportRequestPtr(new LLTeleportRequestViaLocationLookAt(pos_global)); + mTeleportRequest->doTeleport(); +} + +void LLAgent::doTeleportViaLocationLookAt(const LLVector3d& pos_global) { mbTeleportKeepsLookAt = true; gAgentCamera.setFocusOnAvatar(FALSE, ANIMATE); // detach camera form avatar, so it keeps direction @@ -3620,6 +3723,7 @@ void LLAgent::setTeleportState(ETeleportState state) { case TELEPORT_NONE: mbTeleportKeepsLookAt = false; + mTeleportRequest.reset(); break; case TELEPORT_MOVING: @@ -4034,5 +4138,91 @@ LLAgentQueryManager::~LLAgentQueryManager() { } -// EOF +//----------------------------------------------------------------------------- +// LLTeleportRequest +//----------------------------------------------------------------------------- +LLTeleportRequest::LLTeleportRequest() +{ +} + +LLTeleportRequest::~LLTeleportRequest() +{ +} + +//----------------------------------------------------------------------------- +// LLTeleportRequestViaLandmark +//----------------------------------------------------------------------------- + +LLTeleportRequestViaLandmark::LLTeleportRequestViaLandmark(const LLUUID &pLandmarkId) + : LLTeleportRequest(), + mLandmarkId(pLandmarkId) +{ +} + +LLTeleportRequestViaLandmark::~LLTeleportRequestViaLandmark() +{ +} + +void LLTeleportRequestViaLandmark::doTeleport() +{ + gAgent.doTeleportViaLandmark(getLandmarkId()); +} + +//----------------------------------------------------------------------------- +// LLTeleportRequestViaLure +//----------------------------------------------------------------------------- + +LLTeleportRequestViaLure::LLTeleportRequestViaLure(const LLUUID &pLureId, BOOL pIsLureGodLike) + : LLTeleportRequestViaLandmark(pLureId), + mIsLureGodLike(pIsLureGodLike) +{ +} + +LLTeleportRequestViaLure::~LLTeleportRequestViaLure() +{ +} + +void LLTeleportRequestViaLure::doTeleport() +{ + gAgent.doTeleportViaLure(getLandmarkId(), isLureGodLike()); +} + +//----------------------------------------------------------------------------- +// LLTeleportRequestViaLocation +//----------------------------------------------------------------------------- + +LLTeleportRequestViaLocation::LLTeleportRequestViaLocation(const LLVector3d &pPosGlobal) + : LLTeleportRequest(), + mPosGlobal(pPosGlobal) +{ +} + +LLTeleportRequestViaLocation::~LLTeleportRequestViaLocation() +{ +} + +void LLTeleportRequestViaLocation::doTeleport() +{ + gAgent.doTeleportViaLocation(getPosGlobal()); +} + +//----------------------------------------------------------------------------- +// LLTeleportRequestViaLocationLookAt +//----------------------------------------------------------------------------- + +LLTeleportRequestViaLocationLookAt::LLTeleportRequestViaLocationLookAt(const LLVector3d &pPosGlobal) + : LLTeleportRequestViaLocation(pPosGlobal) +{ +} + +LLTeleportRequestViaLocationLookAt::~LLTeleportRequestViaLocationLookAt() +{ +} + +void LLTeleportRequestViaLocationLookAt::doTeleport() +{ + gAgent.doTeleportViaLocationLookAt(getPosGlobal()); +} + +// EOF -- cgit v1.2.3 From cca85dea6755a90f9f6b4c3174743bb0abc4f73e Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Fri, 11 May 2012 19:39:44 -0700 Subject: EXP-1928: First pass at building the functionality to restart teleport after increasing the maturity preference level to match the intended teleport region. There are probably still some cases that are broken and bugs. --- indra/newview/llagent.cpp | 151 +++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 135 insertions(+), 16 deletions(-) (limited to 'indra/newview/llagent.cpp') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index d7c39ff78d..fb217f2186 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -320,6 +320,12 @@ LLAgent::LLAgent() : mAgentAccess(new LLAgentAccess(gSavedSettings)), mCanEditParcel(false), mTeleportSourceSLURL(new LLSLURL), + mCurrentTeleportRequest(), + mFailedTeleportRequest(), + mTeleportFinishedSlot(), + mTeleportFailedSlot(), + mIsMaturityRatingChangingDuringTeleport(false), + mMaturityRatingChange(0), mTeleportState( TELEPORT_NONE ), mRegionp(NULL), @@ -406,7 +412,14 @@ void LLAgent::init() gSavedSettings.getControl("PreferredMaturity")->getValidateSignal()->connect(boost::bind(&LLAgent::validateMaturity, this, _2)); gSavedSettings.getControl("PreferredMaturity")->getSignal()->connect(boost::bind(&LLAgent::handleMaturity, this, _2)); - LLViewerParcelMgr::getInstance()->addAgentParcelChangedCallback(boost::bind(&LLAgent::parcelChangedCallback)); + if (!mTeleportFinishedSlot.connected()) + { + mTeleportFinishedSlot = LLViewerParcelMgr::getInstance()->setTeleportFinishedCallback(boost::bind(&LLAgent::handleTeleportFinished, this)); + } + if (!mTeleportFailedSlot.connected()) + { + mTeleportFailedSlot = LLViewerParcelMgr::getInstance()->setTeleportFailedCallback(boost::bind(&LLAgent::handleTeleportFailed, this)); + } mInitialized = TRUE; } @@ -417,6 +430,14 @@ void LLAgent::init() void LLAgent::cleanup() { mRegionp = NULL; + if (mTeleportFinishedSlot.connected()) + { + mTeleportFinishedSlot.disconnect(); + } + if (mTeleportFailedSlot.connected()) + { + mTeleportFailedSlot.disconnect(); + } } //----------------------------------------------------------------------------- @@ -2457,7 +2478,49 @@ int LLAgent::convertTextToMaturity(char text) return LLAgentAccess::convertTextToMaturity(text); } -bool LLAgent::sendMaturityPreferenceToServer(int preferredMaturity) +class LLMaturityPreferencesResponder : public LLHTTPClient::Responder +{ +public: + LLMaturityPreferencesResponder(LLAgent::maturity_preferences_callback_t pMaturityPreferencesCallback); + virtual ~LLMaturityPreferencesResponder(); + + virtual void result(const LLSD &pContent); + virtual void error(U32 pStatus, const std::string& pReason); + +protected: + +private: + LLAgent::maturity_preferences_callback_t mMaturityPreferencesCallback; +}; + +LLMaturityPreferencesResponder::LLMaturityPreferencesResponder(LLAgent::maturity_preferences_callback_t pMaturityPreferencesCallback) + : LLHTTPClient::Responder(), + mMaturityPreferencesCallback(pMaturityPreferencesCallback) +{ +} + +LLMaturityPreferencesResponder::~LLMaturityPreferencesResponder() +{ +} + +void LLMaturityPreferencesResponder::result(const LLSD &pContent) +{ + if (!mMaturityPreferencesCallback.empty()) + { + mMaturityPreferencesCallback(pContent); + } +} + +void LLMaturityPreferencesResponder::error(U32 pStatus, const std::string& pReason) +{ + if (!mMaturityPreferencesCallback.empty()) + { + LLSD empty; + mMaturityPreferencesCallback(empty); + } +} + +bool LLAgent::sendMaturityPreferenceToServer(int preferredMaturity, maturity_preferences_callback_t pMaturityPreferencesCallback) { if (!getRegion()) return false; @@ -2485,7 +2548,8 @@ bool LLAgent::sendMaturityPreferenceToServer(int preferredMaturity) body["access_prefs"] = access_prefs; llinfos << "Sending access prefs update to " << (access_prefs["max"].asString()) << " via capability to: " << url << llendl; - LLHTTPClient::post(url, body, new LLHTTPClient::Responder()); // Ignore response + LLHTTPClient::ResponderPtr responderPtr = LLHTTPClient::ResponderPtr(new LLMaturityPreferencesResponder(pMaturityPreferencesCallback)); + LLHTTPClient::post(url, body, responderPtr); return true; } return false; @@ -3538,6 +3602,62 @@ bool LLAgent::teleportCore(bool is_local) return true; } +void LLAgent::restartFailedTeleportRequest() +{ + // XXX stinson 05/11/2012 llassert(hasFailedTeleportRequest()); + if (hasFailedTeleportRequest()) + { + mFailedTeleportRequest->doTeleport(); + } +} + +void LLAgent::clearFailedTeleportRequest() +{ + // XXX stinson 05/11/2012 llassert(hasFailedTeleportRequest()); + if (hasFailedTeleportRequest()) + { + mFailedTeleportRequest.reset(); + } +} + +void LLAgent::setMaturityRatingChangeDuringTeleport(int pMaturityRatingChange) +{ + mIsMaturityRatingChangingDuringTeleport = true; + mMaturityRatingChange = pMaturityRatingChange; +} + +void LLAgent::handleTeleportFinished() +{ + // XXX stinson 05/11/2012 llassert(hasCurrentTeleportRequest()); + if (hasCurrentTeleportRequest()) + { + mCurrentTeleportRequest.reset(); + } + if (hasFailedTeleportRequest()) + { + clearFailedTeleportRequest(); + } + if (mIsMaturityRatingChangingDuringTeleport) + { + // notify user that the maturity preference has been changed + LLSD args; + args["RATING"] = LLViewerRegion::accessToString(mMaturityRatingChange); + LLNotificationsUtil::add("PreferredMaturityChanged", args); + mIsMaturityRatingChangingDuringTeleport = false; + } +} + +void LLAgent::handleTeleportFailed() +{ + // XXX stinson 05/11/2012 llassert(hasCurrentTeleportRequest()); + // XXX stinson 05/11/2012 llassert(!hasFailedTeleportRequest()); + if (hasCurrentTeleportRequest()) + { + mFailedTeleportRequest = mCurrentTeleportRequest; + } + mIsMaturityRatingChangingDuringTeleport = false; +} + void LLAgent::teleportRequest( const U64& region_handle, const LLVector3& pos_local, @@ -3570,9 +3690,9 @@ void LLAgent::teleportRequest( // Landmark ID = LLUUID::null means teleport home void LLAgent::teleportViaLandmark(const LLUUID& landmark_asset_id) { - llassert(mTeleportRequest == NULL); - mTeleportRequest = LLTeleportRequestPtr(new LLTeleportRequestViaLandmark(landmark_asset_id)); - mTeleportRequest->doTeleport(); + // XXX stinson 05/11/2012 llassert(!hasCurrentTeleportRequest()); + mCurrentTeleportRequest = LLTeleportRequestPtr(new LLTeleportRequestViaLandmark(landmark_asset_id)); + mCurrentTeleportRequest->doTeleport(); } void LLAgent::doTeleportViaLandmark(const LLUUID& landmark_asset_id) @@ -3592,9 +3712,9 @@ void LLAgent::doTeleportViaLandmark(const LLUUID& landmark_asset_id) void LLAgent::teleportViaLure(const LLUUID& lure_id, BOOL godlike) { - llassert(mTeleportRequest == NULL); - mTeleportRequest = LLTeleportRequestPtr(new LLTeleportRequestViaLure(lure_id, godlike)); - mTeleportRequest->doTeleport(); + // XXX stinson 05/11/2012 llassert(!hasCurrentTeleportRequest()); + mCurrentTeleportRequest = LLTeleportRequestPtr(new LLTeleportRequestViaLure(lure_id, godlike)); + mCurrentTeleportRequest->doTeleport(); } void LLAgent::doTeleportViaLure(const LLUUID& lure_id, BOOL godlike) @@ -3648,9 +3768,9 @@ void LLAgent::teleportCancel() void LLAgent::teleportViaLocation(const LLVector3d& pos_global) { - llassert(mTeleportRequest == NULL); - mTeleportRequest = LLTeleportRequestPtr(new LLTeleportRequestViaLocation(pos_global)); - mTeleportRequest->doTeleport(); + // XXX stinson 05/11/2012 llassert(!hasCurrentTeleportRequest()); + mCurrentTeleportRequest = LLTeleportRequestPtr(new LLTeleportRequestViaLocation(pos_global)); + mCurrentTeleportRequest->doTeleport(); } void LLAgent::doTeleportViaLocation(const LLVector3d& pos_global) @@ -3697,9 +3817,9 @@ void LLAgent::doTeleportViaLocation(const LLVector3d& pos_global) // Teleport to global position, but keep facing in the same direction void LLAgent::teleportViaLocationLookAt(const LLVector3d& pos_global) { - llassert(mTeleportRequest == NULL); - mTeleportRequest = LLTeleportRequestPtr(new LLTeleportRequestViaLocationLookAt(pos_global)); - mTeleportRequest->doTeleport(); + // XXX stinson 05/11/2012 llassert(!hasCurrentTeleportRequest()); + mCurrentTeleportRequest = LLTeleportRequestPtr(new LLTeleportRequestViaLocationLookAt(pos_global)); + mCurrentTeleportRequest->doTeleport(); } void LLAgent::doTeleportViaLocationLookAt(const LLVector3d& pos_global) @@ -3723,7 +3843,6 @@ void LLAgent::setTeleportState(ETeleportState state) { case TELEPORT_NONE: mbTeleportKeepsLookAt = false; - mTeleportRequest.reset(); break; case TELEPORT_MOVING: -- cgit v1.2.3 From 91acda05d57c360924a46696a44a5b7841b84543 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Tue, 15 May 2012 16:49:13 -0700 Subject: EXP-1928: Removing some commented asserts following more development testing. --- indra/newview/llagent.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'indra/newview/llagent.cpp') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index fb217f2186..d27fc252d8 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -3604,7 +3604,7 @@ bool LLAgent::teleportCore(bool is_local) void LLAgent::restartFailedTeleportRequest() { - // XXX stinson 05/11/2012 llassert(hasFailedTeleportRequest()); + llassert(hasFailedTeleportRequest()); if (hasFailedTeleportRequest()) { mFailedTeleportRequest->doTeleport(); @@ -3613,7 +3613,6 @@ void LLAgent::restartFailedTeleportRequest() void LLAgent::clearFailedTeleportRequest() { - // XXX stinson 05/11/2012 llassert(hasFailedTeleportRequest()); if (hasFailedTeleportRequest()) { mFailedTeleportRequest.reset(); @@ -3628,7 +3627,6 @@ void LLAgent::setMaturityRatingChangeDuringTeleport(int pMaturityRatingChange) void LLAgent::handleTeleportFinished() { - // XXX stinson 05/11/2012 llassert(hasCurrentTeleportRequest()); if (hasCurrentTeleportRequest()) { mCurrentTeleportRequest.reset(); @@ -3649,8 +3647,6 @@ void LLAgent::handleTeleportFinished() void LLAgent::handleTeleportFailed() { - // XXX stinson 05/11/2012 llassert(hasCurrentTeleportRequest()); - // XXX stinson 05/11/2012 llassert(!hasFailedTeleportRequest()); if (hasCurrentTeleportRequest()) { mFailedTeleportRequest = mCurrentTeleportRequest; @@ -3690,7 +3686,6 @@ void LLAgent::teleportRequest( // Landmark ID = LLUUID::null means teleport home void LLAgent::teleportViaLandmark(const LLUUID& landmark_asset_id) { - // XXX stinson 05/11/2012 llassert(!hasCurrentTeleportRequest()); mCurrentTeleportRequest = LLTeleportRequestPtr(new LLTeleportRequestViaLandmark(landmark_asset_id)); mCurrentTeleportRequest->doTeleport(); } @@ -3712,7 +3707,6 @@ void LLAgent::doTeleportViaLandmark(const LLUUID& landmark_asset_id) void LLAgent::teleportViaLure(const LLUUID& lure_id, BOOL godlike) { - // XXX stinson 05/11/2012 llassert(!hasCurrentTeleportRequest()); mCurrentTeleportRequest = LLTeleportRequestPtr(new LLTeleportRequestViaLure(lure_id, godlike)); mCurrentTeleportRequest->doTeleport(); } @@ -3768,7 +3762,6 @@ void LLAgent::teleportCancel() void LLAgent::teleportViaLocation(const LLVector3d& pos_global) { - // XXX stinson 05/11/2012 llassert(!hasCurrentTeleportRequest()); mCurrentTeleportRequest = LLTeleportRequestPtr(new LLTeleportRequestViaLocation(pos_global)); mCurrentTeleportRequest->doTeleport(); } @@ -3817,7 +3810,6 @@ void LLAgent::doTeleportViaLocation(const LLVector3d& pos_global) // Teleport to global position, but keep facing in the same direction void LLAgent::teleportViaLocationLookAt(const LLVector3d& pos_global) { - // XXX stinson 05/11/2012 llassert(!hasCurrentTeleportRequest()); mCurrentTeleportRequest = LLTeleportRequestPtr(new LLTeleportRequestViaLocationLookAt(pos_global)); mCurrentTeleportRequest->doTeleport(); } -- cgit v1.2.3 From 52b624aa3db193cec0980e369be3ff1a8e5faa24 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Tue, 15 May 2012 19:10:03 -0700 Subject: EXP-1928: Removing ability to restart a teleport via lure because the re-attempt will fail on the server. --- indra/newview/llagent.cpp | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'indra/newview/llagent.cpp') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index d27fc252d8..3b1e894ed3 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -3604,7 +3604,6 @@ bool LLAgent::teleportCore(bool is_local) void LLAgent::restartFailedTeleportRequest() { - llassert(hasFailedTeleportRequest()); if (hasFailedTeleportRequest()) { mFailedTeleportRequest->doTeleport(); @@ -3707,8 +3706,29 @@ void LLAgent::doTeleportViaLandmark(const LLUUID& landmark_asset_id) void LLAgent::teleportViaLure(const LLUUID& lure_id, BOOL godlike) { +#if 0 + // stinson 05/15/2012 : cannot restart a teleport via lure because of server-side restrictions + // The current scenario is as follows: + // 1. User A initializes a request for User B to teleport via lure + // 2. User B accepts the teleport via lure request + // 3. The server sees the init request from User A and the accept request from User B and matches them up + // 4. The server then removes the paired requests up from the "queue" + // 5. The server then fails User B's teleport for reason of maturity level (for example) + // 6. User B's viewer prompts user to increase their maturity level profile value. + // 7. User B confirms and accepts increase in maturity level + // 8. User B's viewer then attempts to teleport via lure again + // 9. This fails on the server because User A's initial request has been removed from the "queue" in step 4 mCurrentTeleportRequest = LLTeleportRequestPtr(new LLTeleportRequestViaLure(lure_id, godlike)); mCurrentTeleportRequest->doTeleport(); +#else + // Clear any current and failed teleports. + mCurrentTeleportRequest.reset(); + clearFailedTeleportRequest(); + + // Do not persist the teleport via lure request as it is only temporary and cannot be restarted + LLTeleportRequestPtr currentTeleportRequest = LLTeleportRequestPtr(new LLTeleportRequestViaLure(lure_id, godlike)); + currentTeleportRequest->doTeleport(); +#endif } void LLAgent::doTeleportViaLure(const LLUUID& lure_id, BOOL godlike) -- cgit v1.2.3 From ecdc5cf7647c0cbbb057dba2f4bdeaafc3f5a93f Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Thu, 17 May 2012 14:50:33 -0700 Subject: EXP-1928: Handling the rare case that the user preferences cannot be successfully changed, and reporting that to the user. --- indra/newview/llagent.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llagent.cpp') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 3b1e894ed3..5d5e585563 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -325,7 +325,7 @@ LLAgent::LLAgent() : mTeleportFinishedSlot(), mTeleportFailedSlot(), mIsMaturityRatingChangingDuringTeleport(false), - mMaturityRatingChange(0), + mMaturityRatingChange(0U), mTeleportState( TELEPORT_NONE ), mRegionp(NULL), @@ -3618,7 +3618,7 @@ void LLAgent::clearFailedTeleportRequest() } } -void LLAgent::setMaturityRatingChangeDuringTeleport(int pMaturityRatingChange) +void LLAgent::setMaturityRatingChangeDuringTeleport(U8 pMaturityRatingChange) { mIsMaturityRatingChangingDuringTeleport = true; mMaturityRatingChange = pMaturityRatingChange; -- cgit v1.2.3 From cf0a6a61bd44b4becfa81eb3e0c6b16bc42c4c44 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Thu, 17 May 2012 15:38:17 -0700 Subject: EXP-1928: Minor tweak to ensure that the case of the copy for content type is lower-case. --- indra/newview/llagent.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview/llagent.cpp') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 5d5e585563..b109749688 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -3637,8 +3637,10 @@ void LLAgent::handleTeleportFinished() if (mIsMaturityRatingChangingDuringTeleport) { // notify user that the maturity preference has been changed + std::string maturityRating = LLViewerRegion::accessToString(mMaturityRatingChange); + LLStringUtil::toLower(maturityRating); LLSD args; - args["RATING"] = LLViewerRegion::accessToString(mMaturityRatingChange); + args["RATING"] = maturityRating; LLNotificationsUtil::add("PreferredMaturityChanged", args); mIsMaturityRatingChangingDuringTeleport = false; } -- cgit v1.2.3 From 90c6b871c49e5936639cfc181d6119fc1a8a3f08 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Thu, 17 May 2012 17:12:00 -0700 Subject: EXP-1928: Constructing the new maturity preferences flow for the case of a teleport via lure (which cannot be restared). --- indra/newview/llagent.cpp | 128 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 91 insertions(+), 37 deletions(-) (limited to 'indra/newview/llagent.cpp') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index b109749688..340629e404 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -118,7 +118,10 @@ public: LLTeleportRequest(); virtual ~LLTeleportRequest(); - virtual void doTeleport() = 0; + virtual bool canRestartTeleport(); + + virtual void startTeleport() = 0; + virtual void restartTeleport(); protected: @@ -132,7 +135,10 @@ public: LLTeleportRequestViaLandmark(const LLUUID &pLandmarkId); virtual ~LLTeleportRequestViaLandmark(); - virtual void doTeleport(); + virtual bool canRestartTeleport(); + + virtual void startTeleport(); + virtual void restartTeleport(); protected: inline const LLUUID &getLandmarkId() const {return mLandmarkId;}; @@ -147,7 +153,9 @@ public: LLTeleportRequestViaLure(const LLUUID &pLureId, BOOL pIsLureGodLike); virtual ~LLTeleportRequestViaLure(); - virtual void doTeleport(); + virtual bool canRestartTeleport(); + + virtual void startTeleport(); protected: inline BOOL isLureGodLike() const {return mIsLureGodLike;}; @@ -162,7 +170,10 @@ public: LLTeleportRequestViaLocation(const LLVector3d &pPosGlobal); virtual ~LLTeleportRequestViaLocation(); - virtual void doTeleport(); + virtual bool canRestartTeleport(); + + virtual void startTeleport(); + virtual void restartTeleport(); protected: inline const LLVector3d &getPosGlobal() const {return mPosGlobal;}; @@ -178,7 +189,10 @@ public: LLTeleportRequestViaLocationLookAt(const LLVector3d &pPosGlobal); virtual ~LLTeleportRequestViaLocationLookAt(); - virtual void doTeleport(); + virtual bool canRestartTeleport(); + + virtual void startTeleport(); + virtual void restartTeleport(); protected: @@ -186,7 +200,6 @@ private: }; - //-------------------------------------------------------------------- // Statics // @@ -3602,11 +3615,16 @@ bool LLAgent::teleportCore(bool is_local) return true; } +bool LLAgent::hasRestartableFailedTeleportRequest() +{ + return hasFailedTeleportRequest() && mFailedTeleportRequest->canRestartTeleport(); +} + void LLAgent::restartFailedTeleportRequest() { - if (hasFailedTeleportRequest()) + if (hasRestartableFailedTeleportRequest()) { - mFailedTeleportRequest->doTeleport(); + mFailedTeleportRequest->restartTeleport(); } } @@ -3688,7 +3706,7 @@ void LLAgent::teleportRequest( void LLAgent::teleportViaLandmark(const LLUUID& landmark_asset_id) { mCurrentTeleportRequest = LLTeleportRequestPtr(new LLTeleportRequestViaLandmark(landmark_asset_id)); - mCurrentTeleportRequest->doTeleport(); + mCurrentTeleportRequest->startTeleport(); } void LLAgent::doTeleportViaLandmark(const LLUUID& landmark_asset_id) @@ -3708,29 +3726,8 @@ void LLAgent::doTeleportViaLandmark(const LLUUID& landmark_asset_id) void LLAgent::teleportViaLure(const LLUUID& lure_id, BOOL godlike) { -#if 0 - // stinson 05/15/2012 : cannot restart a teleport via lure because of server-side restrictions - // The current scenario is as follows: - // 1. User A initializes a request for User B to teleport via lure - // 2. User B accepts the teleport via lure request - // 3. The server sees the init request from User A and the accept request from User B and matches them up - // 4. The server then removes the paired requests up from the "queue" - // 5. The server then fails User B's teleport for reason of maturity level (for example) - // 6. User B's viewer prompts user to increase their maturity level profile value. - // 7. User B confirms and accepts increase in maturity level - // 8. User B's viewer then attempts to teleport via lure again - // 9. This fails on the server because User A's initial request has been removed from the "queue" in step 4 mCurrentTeleportRequest = LLTeleportRequestPtr(new LLTeleportRequestViaLure(lure_id, godlike)); - mCurrentTeleportRequest->doTeleport(); -#else - // Clear any current and failed teleports. - mCurrentTeleportRequest.reset(); - clearFailedTeleportRequest(); - - // Do not persist the teleport via lure request as it is only temporary and cannot be restarted - LLTeleportRequestPtr currentTeleportRequest = LLTeleportRequestPtr(new LLTeleportRequestViaLure(lure_id, godlike)); - currentTeleportRequest->doTeleport(); -#endif + mCurrentTeleportRequest->startTeleport(); } void LLAgent::doTeleportViaLure(const LLUUID& lure_id, BOOL godlike) @@ -3785,7 +3782,7 @@ void LLAgent::teleportCancel() void LLAgent::teleportViaLocation(const LLVector3d& pos_global) { mCurrentTeleportRequest = LLTeleportRequestPtr(new LLTeleportRequestViaLocation(pos_global)); - mCurrentTeleportRequest->doTeleport(); + mCurrentTeleportRequest->startTeleport(); } void LLAgent::doTeleportViaLocation(const LLVector3d& pos_global) @@ -3833,7 +3830,7 @@ void LLAgent::doTeleportViaLocation(const LLVector3d& pos_global) void LLAgent::teleportViaLocationLookAt(const LLVector3d& pos_global) { mCurrentTeleportRequest = LLTeleportRequestPtr(new LLTeleportRequestViaLocationLookAt(pos_global)); - mCurrentTeleportRequest->doTeleport(); + mCurrentTeleportRequest->startTeleport(); } void LLAgent::doTeleportViaLocationLookAt(const LLVector3d& pos_global) @@ -4283,6 +4280,16 @@ LLTeleportRequest::~LLTeleportRequest() { } +bool LLTeleportRequest::canRestartTeleport() +{ + return false; +} + +void LLTeleportRequest::restartTeleport() +{ + llassert(0); +} + //----------------------------------------------------------------------------- // LLTeleportRequestViaLandmark //----------------------------------------------------------------------------- @@ -4297,7 +4304,17 @@ LLTeleportRequestViaLandmark::~LLTeleportRequestViaLandmark() { } -void LLTeleportRequestViaLandmark::doTeleport() +bool LLTeleportRequestViaLandmark::canRestartTeleport() +{ + return true; +} + +void LLTeleportRequestViaLandmark::startTeleport() +{ + gAgent.doTeleportViaLandmark(getLandmarkId()); +} + +void LLTeleportRequestViaLandmark::restartTeleport() { gAgent.doTeleportViaLandmark(getLandmarkId()); } @@ -4316,7 +4333,24 @@ LLTeleportRequestViaLure::~LLTeleportRequestViaLure() { } -void LLTeleportRequestViaLure::doTeleport() +bool LLTeleportRequestViaLure::canRestartTeleport() +{ + // stinson 05/17/2012 : cannot restart a teleport via lure because of server-side restrictions + // The current scenario is as follows: + // 1. User A initializes a request for User B to teleport via lure + // 2. User B accepts the teleport via lure request + // 3. The server sees the init request from User A and the accept request from User B and matches them up + // 4. The server then removes the paired requests up from the "queue" + // 5. The server then fails User B's teleport for reason of maturity level (for example) + // 6. User B's viewer prompts user to increase their maturity level profile value. + // 7. User B confirms and accepts increase in maturity level + // 8. User B's viewer then attempts to teleport via lure again + // 9. This request will time-out on the viewer-side because User A's initial request has been removed from the "queue" in step 4 + + return false; +} + +void LLTeleportRequestViaLure::startTeleport() { gAgent.doTeleportViaLure(getLandmarkId(), isLureGodLike()); } @@ -4335,7 +4369,17 @@ LLTeleportRequestViaLocation::~LLTeleportRequestViaLocation() { } -void LLTeleportRequestViaLocation::doTeleport() +bool LLTeleportRequestViaLocation::canRestartTeleport() +{ + return true; +} + +void LLTeleportRequestViaLocation::startTeleport() +{ + gAgent.doTeleportViaLocation(getPosGlobal()); +} + +void LLTeleportRequestViaLocation::restartTeleport() { gAgent.doTeleportViaLocation(getPosGlobal()); } @@ -4353,7 +4397,17 @@ LLTeleportRequestViaLocationLookAt::~LLTeleportRequestViaLocationLookAt() { } -void LLTeleportRequestViaLocationLookAt::doTeleport() +bool LLTeleportRequestViaLocationLookAt::canRestartTeleport() +{ + return true; +} + +void LLTeleportRequestViaLocationLookAt::startTeleport() +{ + gAgent.doTeleportViaLocationLookAt(getPosGlobal()); +} + +void LLTeleportRequestViaLocationLookAt::restartTeleport() { gAgent.doTeleportViaLocationLookAt(getPosGlobal()); } -- cgit v1.2.3 From 9845ad1728384629d0bafbf74e76c823ffd565bb Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Thu, 17 May 2012 20:02:53 -0700 Subject: EXP-1940: BUGFIX Correcting issue with changing maturity setting and teleporting from dialog did not work on agni. Problem stemmed from 2 issues. 1) The server responded with different results between aditi and agni due to some changes in the Pathfinding project. 2) The viewer was actually sending two separate requests to change to the same preference setting. This fixes both issues. --- indra/newview/llagent.cpp | 55 ++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 50 insertions(+), 5 deletions(-) (limited to 'indra/newview/llagent.cpp') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 340629e404..b822af352c 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -339,6 +339,7 @@ LLAgent::LLAgent() : mTeleportFailedSlot(), mIsMaturityRatingChangingDuringTeleport(false), mMaturityRatingChange(0U), + mMaturityPreferenceConfirmCallback(NULL), mTeleportState( TELEPORT_NONE ), mRegionp(NULL), @@ -2520,7 +2521,39 @@ void LLMaturityPreferencesResponder::result(const LLSD &pContent) { if (!mMaturityPreferencesCallback.empty()) { - mMaturityPreferencesCallback(pContent); + U8 actualPreferenceValue = SIM_ACCESS_MIN; + llassert(!pContent.isUndefined()); + llassert(pContent.isMap()); + + if (!pContent.isUndefined() && pContent.isMap()) + { + if (pContent.has("access_prefs")) + { + llassert(pContent.has("access_prefs")); + llassert(pContent.get("access_prefs").isMap()); + llassert(pContent.get("access_prefs").has("max")); + llassert(pContent.get("access_prefs").get("max").isString()); + if (pContent.get("access_prefs").isMap() && pContent.get("access_prefs").has("max") && + pContent.get("access_prefs").get("max").isString()) + { + LLSD::String actualPreference = pContent.get("access_prefs").get("max").asString(); + LLStringUtil::trim(actualPreference); + actualPreferenceValue = LLViewerRegion::shortStringToAccess(actualPreference); + } + } + else if (pContent.has("max")) + { + llassert(pContent.get("max").isString()); + if (pContent.get("max").isString()) + { + LLSD::String actualPreference = pContent.get("max").asString(); + LLStringUtil::trim(actualPreference); + actualPreferenceValue = LLViewerRegion::shortStringToAccess(actualPreference); + } + } + } + + mMaturityPreferencesCallback(actualPreferenceValue); } } @@ -2528,12 +2561,24 @@ void LLMaturityPreferencesResponder::error(U32 pStatus, const std::string& pReas { if (!mMaturityPreferencesCallback.empty()) { - LLSD empty; - mMaturityPreferencesCallback(empty); + mMaturityPreferencesCallback(SIM_ACCESS_MIN); } } -bool LLAgent::sendMaturityPreferenceToServer(int preferredMaturity, maturity_preferences_callback_t pMaturityPreferencesCallback) +void LLAgent::setMaturityPreferenceAndConfirm(U32 preferredMaturity, maturity_preferences_callback_t pMaturityPreferencesCallback) +{ + llassert(mMaturityPreferenceConfirmCallback == NULL); + mMaturityPreferenceConfirmCallback = pMaturityPreferencesCallback; + + gSavedSettings.setU32("PreferredMaturity", static_cast(preferredMaturity)); + // PreferredMaturity has a signal hook on change that will call LLAgent::sendMaturityPreferenceToServer + // sendMaturityPreferenceToServer will use mMaturityPreferenceConfirmCallback in the LLHTTPResponder + // This allows for confirmation that the server has officially received the maturity preference change + + mMaturityPreferenceConfirmCallback = NULL; +} + +bool LLAgent::sendMaturityPreferenceToServer(int preferredMaturity) { if (!getRegion()) return false; @@ -2561,7 +2606,7 @@ bool LLAgent::sendMaturityPreferenceToServer(int preferredMaturity, maturity_pre body["access_prefs"] = access_prefs; llinfos << "Sending access prefs update to " << (access_prefs["max"].asString()) << " via capability to: " << url << llendl; - LLHTTPClient::ResponderPtr responderPtr = LLHTTPClient::ResponderPtr(new LLMaturityPreferencesResponder(pMaturityPreferencesCallback)); + LLHTTPClient::ResponderPtr responderPtr = LLHTTPClient::ResponderPtr(new LLMaturityPreferencesResponder(mMaturityPreferenceConfirmCallback)); LLHTTPClient::post(url, body, responderPtr); return true; } -- cgit v1.2.3 From e76d7d73c5867b6e662672c88244c38b49d34d0d Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Wed, 23 May 2012 18:58:47 -0700 Subject: Removing cruft code that is no longer used. --- indra/newview/llagent.cpp | 5 ----- 1 file changed, 5 deletions(-) (limited to 'indra/newview/llagent.cpp') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index b822af352c..23a2908ce6 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -2633,11 +2633,6 @@ void LLAgent::setGodLevel(U8 god_level) mAgentAccess->setGodLevel(god_level); } -void LLAgent::setAOTransition() -{ - mAgentAccess->setTransition(); -} - const LLAgentAccess& LLAgent::getAgentAccess() { return *mAgentAccess; -- cgit v1.2.3 From 7fc6d3d79b0e28a450b097c923387de133cc4545 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Wed, 23 May 2012 19:29:17 -0700 Subject: Removing some code that allowed the viewer to toggle the user's maturity access level. But only toggling it in the viewer leads to some really bad discontinuities with the server's actual access level for the user. --- indra/newview/llagent.cpp | 5 ----- 1 file changed, 5 deletions(-) (limited to 'indra/newview/llagent.cpp') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 23a2908ce6..07a439e696 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -2481,11 +2481,6 @@ bool LLAgent::isAdult() const return mAgentAccess->isAdult(); } -void LLAgent::setTeen(bool teen) -{ - mAgentAccess->setTeen(teen); -} - //static int LLAgent::convertTextToMaturity(char text) { -- cgit v1.2.3 From 245a5a2814306836d61d6acc9ff852835d624ed9 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Thu, 24 May 2012 11:39:54 -0700 Subject: EXP-1948: Ensuring that we show the maturity changed notification in the case of a teleport failure on the second attempt. --- indra/newview/llagent.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'indra/newview/llagent.cpp') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 07a439e696..1e0ec7f05b 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -3705,7 +3705,16 @@ void LLAgent::handleTeleportFailed() { mFailedTeleportRequest = mCurrentTeleportRequest; } - mIsMaturityRatingChangingDuringTeleport = false; + if (mIsMaturityRatingChangingDuringTeleport) + { + // notify user that the maturity preference has been changed + std::string maturityRating = LLViewerRegion::accessToString(mMaturityRatingChange); + LLStringUtil::toLower(maturityRating); + LLSD args; + args["RATING"] = maturityRating; + LLNotificationsUtil::add("PreferredMaturityChanged", args); + mIsMaturityRatingChangingDuringTeleport = false; + } } void LLAgent::teleportRequest( -- cgit v1.2.3 From 55392ef7f6499c639b10e56646cf535742152682 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Thu, 24 May 2012 19:41:20 -0700 Subject: EXP-1942,EXP-1945: Altering behavior when setting maturity preference to check the server response in an effort to ensure the viewer and server remain in sync. This is a partial commit as I still need to add user behavior and notifications when things go wrong. --- indra/newview/llagent.cpp | 197 +++++++++++++++++++++++++++++++++++----------- 1 file changed, 152 insertions(+), 45 deletions(-) (limited to 'indra/newview/llagent.cpp') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 1e0ec7f05b..804dec0b33 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -81,6 +81,7 @@ #include "llviewermenu.h" #include "llviewerobjectlist.h" #include "llviewerparcelmgr.h" +#include "llviewerregion.h" #include "llviewerstats.h" #include "llviewerwindow.h" #include "llvoavatarself.h" @@ -339,7 +340,11 @@ LLAgent::LLAgent() : mTeleportFailedSlot(), mIsMaturityRatingChangingDuringTeleport(false), mMaturityRatingChange(0U), + mIsDoSendMaturityPreferenceToServer(false), mMaturityPreferenceConfirmCallback(NULL), + mMaturityPerferenceMessageId(0U), + mPreferredMaturityValidateSlot(), + mPreferredMaturityCommitSlot(), mTeleportState( TELEPORT_NONE ), mRegionp(NULL), @@ -423,8 +428,9 @@ void LLAgent::init() *mEffectColor = LLUIColorTable::instance().getColor("EffectColor"); - gSavedSettings.getControl("PreferredMaturity")->getValidateSignal()->connect(boost::bind(&LLAgent::validateMaturity, this, _2)); - gSavedSettings.getControl("PreferredMaturity")->getSignal()->connect(boost::bind(&LLAgent::handleMaturity, this, _2)); + mPreferredMaturityValidateSlot = gSavedSettings.getControl("PreferredMaturity")->getValidateSignal()->connect(boost::bind(&LLAgent::validateMaturity, this, _2)); + mPreferredMaturityCommitSlot = gSavedSettings.getControl("PreferredMaturity")->getSignal()->connect(boost::bind(&LLAgent::handleMaturity, this, _2, _3)); + mIsDoSendMaturityPreferenceToServer = true; if (!mTeleportFinishedSlot.connected()) { @@ -2490,7 +2496,7 @@ int LLAgent::convertTextToMaturity(char text) class LLMaturityPreferencesResponder : public LLHTTPClient::Responder { public: - LLMaturityPreferencesResponder(LLAgent::maturity_preferences_callback_t pMaturityPreferencesCallback); + LLMaturityPreferencesResponder(LLAgent *pAgent, unsigned int pMessageId, U8 pPreferredMaturity, U8 pPreviousMaturity, LLAgent::maturity_preferences_callback_t pMaturityPreferencesCallback); virtual ~LLMaturityPreferencesResponder(); virtual void result(const LLSD &pContent); @@ -2499,11 +2505,21 @@ public: protected: private: + U8 parseMaturityFromServerResponse(const LLSD &pContent); + + LLAgent *mAgent; + unsigned int mMessageId; + U8 mPreferredMaturity; + U8 mPreviousMaturity; LLAgent::maturity_preferences_callback_t mMaturityPreferencesCallback; }; -LLMaturityPreferencesResponder::LLMaturityPreferencesResponder(LLAgent::maturity_preferences_callback_t pMaturityPreferencesCallback) +LLMaturityPreferencesResponder::LLMaturityPreferencesResponder(LLAgent *pAgent, unsigned int pMessageId, U8 pPreferredMaturity, U8 pPreviousMaturity, LLAgent::maturity_preferences_callback_t pMaturityPreferencesCallback) : LLHTTPClient::Responder(), + mAgent(pAgent), + mMessageId(pMessageId), + mPreferredMaturity(pPreferredMaturity), + mPreviousMaturity(pPreviousMaturity), mMaturityPreferencesCallback(pMaturityPreferencesCallback) { } @@ -2514,14 +2530,65 @@ LLMaturityPreferencesResponder::~LLMaturityPreferencesResponder() void LLMaturityPreferencesResponder::result(const LLSD &pContent) { + U8 actualMaturity = parseMaturityFromServerResponse(pContent); + + if (actualMaturity == mPreferredMaturity) + { + llinfos << "succesfully changed maturity preference from '" << LLViewerRegion::accessToString(mPreviousMaturity) + << "' to '" << LLViewerRegion::accessToString(mPreferredMaturity) << "', the server responded with '" + << LLViewerRegion::accessToString(actualMaturity) << "' [value:" << static_cast(actualMaturity) << ", llsd:" + << pContent << "]" << llendl; + mAgent->handlePreferredMaturityResult(mMessageId, actualMaturity); + } + else + { + llwarns << "while attempting to change maturity preference from '" << LLViewerRegion::accessToString(mPreviousMaturity) + << "' to '" << LLViewerRegion::accessToString(mPreferredMaturity) << "', the server responded with '" + << LLViewerRegion::accessToString(actualMaturity) << "' [value:" << static_cast(actualMaturity) << ", llsd:" + << pContent << "]" << llendl; + mAgent->handlePreferredMaturityUnexpectedResult(mMessageId, mPreferredMaturity, mPreviousMaturity, actualMaturity); + } + + if (!mMaturityPreferencesCallback.empty()) + { + mMaturityPreferencesCallback(actualMaturity); + } +} + +void LLMaturityPreferencesResponder::error(U32 pStatus, const std::string& pReason) +{ + llwarns << "while attempting to change maturity preference from '" << LLViewerRegion::accessToString(mPreviousMaturity) + << "' to '" << LLViewerRegion::accessToString(mPreferredMaturity) << "', we got an error because '" + << pReason << "' [status:" << pStatus << "]" << llendl; + mAgent->handlePreferredMaturityError(mMessageId, mPreferredMaturity, mPreviousMaturity); if (!mMaturityPreferencesCallback.empty()) { - U8 actualPreferenceValue = SIM_ACCESS_MIN; + mMaturityPreferencesCallback(mPreviousMaturity); + } +} + +U8 LLMaturityPreferencesResponder::parseMaturityFromServerResponse(const LLSD &pContent) +{ + // stinson 05/24/2012 Pathfinding regions have re-defined the response behavior. In the old server code, + // if you attempted to change the preferred maturity to the same value, the response content would be an + // undefined LLSD block. In the new server code with pathfinding, the response content should always be + // defined. Thus, the check for isUndefined() can be replaced with an assert after pathfinding is merged + // into server trunk and fully deployed. + U8 maturity = SIM_ACCESS_MIN; + if (pContent.isUndefined()) + { + maturity = mPreviousMaturity; + } + else + { llassert(!pContent.isUndefined()); llassert(pContent.isMap()); - + if (!pContent.isUndefined() && pContent.isMap()) { + // stinson 05/24/2012 Pathfinding regions have re-defined the response syntax. The if statement catches + // the new syntax, and the else statement catches the old syntax. After pathfinding is merged into + // server trunk and fully deployed, we can remove the else statement. if (pContent.has("access_prefs")) { llassert(pContent.has("access_prefs")); @@ -2533,7 +2600,7 @@ void LLMaturityPreferencesResponder::result(const LLSD &pContent) { LLSD::String actualPreference = pContent.get("access_prefs").get("max").asString(); LLStringUtil::trim(actualPreference); - actualPreferenceValue = LLViewerRegion::shortStringToAccess(actualPreference); + maturity = LLViewerRegion::shortStringToAccess(actualPreference); } } else if (pContent.has("max")) @@ -2543,21 +2610,13 @@ void LLMaturityPreferencesResponder::result(const LLSD &pContent) { LLSD::String actualPreference = pContent.get("max").asString(); LLStringUtil::trim(actualPreference); - actualPreferenceValue = LLViewerRegion::shortStringToAccess(actualPreference); + maturity = LLViewerRegion::shortStringToAccess(actualPreference); } } } - - mMaturityPreferencesCallback(actualPreferenceValue); } -} -void LLMaturityPreferencesResponder::error(U32 pStatus, const std::string& pReason) -{ - if (!mMaturityPreferencesCallback.empty()) - { - mMaturityPreferencesCallback(SIM_ACCESS_MIN); - } + return maturity; } void LLAgent::setMaturityPreferenceAndConfirm(U32 preferredMaturity, maturity_preferences_callback_t pMaturityPreferencesCallback) @@ -2573,39 +2632,87 @@ void LLAgent::setMaturityPreferenceAndConfirm(U32 preferredMaturity, maturity_pr mMaturityPreferenceConfirmCallback = NULL; } -bool LLAgent::sendMaturityPreferenceToServer(int preferredMaturity) +void LLAgent::handlePreferredMaturityResult(unsigned int pMessageId, U8 pServerMaturity) { - if (!getRegion()) - return false; - - // Update agent access preference on the server - std::string url = getRegion()->getCapability("UpdateAgentInformation"); - if (!url.empty()) + llassert(pMessageId <= mMaturityPerferenceMessageId); + if (pMessageId < mMaturityPerferenceMessageId) { - // Set new access preference - LLSD access_prefs = LLSD::emptyMap(); - if (preferredMaturity == SIM_ACCESS_PG) - { - access_prefs["max"] = "PG"; - } - else if (preferredMaturity == SIM_ACCESS_MATURE) + llwarns << "out of order result while changing maturity preference" << llendl; + } + U8 localMaturity = static_cast(gSavedSettings.getU32("PreferredMaturity")); + if (localMaturity != pServerMaturity) + { + bool tmpIsDoSendMaturityPreferenceToServer = mIsDoSendMaturityPreferenceToServer; + mIsDoSendMaturityPreferenceToServer = false; + llinfos << "Setting viewer preferred maturity to '" << LLViewerRegion::accessToString(pServerMaturity) << "'" << llendl; + gSavedSettings.setU32("PreferredMaturity", static_cast(pServerMaturity)); + mIsDoSendMaturityPreferenceToServer = tmpIsDoSendMaturityPreferenceToServer; + } +} + +void LLAgent::handlePreferredMaturityError(unsigned int pMessageId, U8 pPreferredMaturity, U8 pPreviousMaturity) +{ + llassert(pMessageId <= mMaturityPerferenceMessageId); + if (pMessageId < mMaturityPerferenceMessageId) + { + llwarns << "out of order result while changing maturity preference" << llendl; + } + if (pMessageId == mMaturityPerferenceMessageId) + { + bool tmpIsDoSendMaturityPreferenceToServer = mIsDoSendMaturityPreferenceToServer; + mIsDoSendMaturityPreferenceToServer = false; + llinfos << "Setting viewer preferred maturity to '" << LLViewerRegion::accessToString(pPreviousMaturity) << "'" << llendl; + gSavedSettings.setU32("PreferredMaturity", static_cast(pPreviousMaturity)); + mIsDoSendMaturityPreferenceToServer = tmpIsDoSendMaturityPreferenceToServer; + } +} + +void LLAgent::handlePreferredMaturityUnexpectedResult(unsigned int pMessageId, U8 pPreferredMaturity, U8 pPreviousMaturity, U8 pServerMaturity) +{ + llassert(pMessageId <= mMaturityPerferenceMessageId); + if (pMessageId < mMaturityPerferenceMessageId) + { + llwarns << "out of order result while changing maturity preference" << llendl; + } + bool tmpIsDoSendMaturityPreferenceToServer = mIsDoSendMaturityPreferenceToServer; + mIsDoSendMaturityPreferenceToServer = false; + llinfos << "Setting viewer preferred maturity to '" << LLViewerRegion::accessToString(pServerMaturity) << "'" << llendl; + gSavedSettings.setU32("PreferredMaturity", static_cast(pServerMaturity)); + mIsDoSendMaturityPreferenceToServer = tmpIsDoSendMaturityPreferenceToServer; +} + +void LLAgent::sendMaturityPreferenceToServer(U8 pPreferredMaturity, U8 pPreviousMaturity) +{ + if (mIsDoSendMaturityPreferenceToServer) + { + LLHTTPClient::ResponderPtr responderPtr = LLHTTPClient::ResponderPtr(new LLMaturityPreferencesResponder(this, ++mMaturityPerferenceMessageId, pPreferredMaturity, pPreviousMaturity, mMaturityPreferenceConfirmCallback)); + if (getRegion() == NULL) { - access_prefs["max"] = "M"; + responderPtr->error(0U, "region is not defined"); } - if (preferredMaturity == SIM_ACCESS_ADULT) + else { - access_prefs["max"] = "A"; + // Update agent access preference on the server + std::string url = getRegion()->getCapability("UpdateAgentInformation"); + if (url.empty()) + { + responderPtr->error(0U, "capability 'UpdateAgentInformation' is not defined for region"); + } + else + { + // Set new access preference + LLSD access_prefs = LLSD::emptyMap(); + access_prefs["max"] = LLViewerRegion::accessToShortString(pPreferredMaturity); + + LLSD body = LLSD::emptyMap(); + body["access_prefs"] = access_prefs; + llinfos << "Sending access prefs update to " << (access_prefs["max"].asString()) << " via capability to: " + << url << llendl; + LLSD headers; + LLHTTPClient::post(url, body, responderPtr, headers, 30.0f); + } } - - LLSD body = LLSD::emptyMap(); - body["access_prefs"] = access_prefs; - llinfos << "Sending access prefs update to " << (access_prefs["max"].asString()) << " via capability to: " - << url << llendl; - LLHTTPClient::ResponderPtr responderPtr = LLHTTPClient::ResponderPtr(new LLMaturityPreferencesResponder(mMaturityPreferenceConfirmCallback)); - LLHTTPClient::post(url, body, responderPtr); - return true; } - return false; } BOOL LLAgent::getAdminOverride() const @@ -2638,9 +2745,9 @@ bool LLAgent::validateMaturity(const LLSD& newvalue) return mAgentAccess->canSetMaturity(newvalue.asInteger()); } -void LLAgent::handleMaturity(const LLSD& newvalue) +void LLAgent::handleMaturity(const LLSD &pNewValue, const LLSD &pPreviousValue) { - sendMaturityPreferenceToServer(newvalue.asInteger()); + sendMaturityPreferenceToServer(static_cast(pNewValue.asInteger()), static_cast(pPreviousValue.asInteger())); } //---------------------------------------------------------------------------- -- cgit v1.2.3 From 3c2a4da3a6a2630de7ad6a526b3190ecfccceff0 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Fri, 25 May 2012 12:08:53 -0700 Subject: EXP-1942, EXP-1945: Improved handling of the maturity preference change response. Still needs work though. --- indra/newview/llagent.cpp | 113 ++++++++++++++++++++++++++++------------------ 1 file changed, 69 insertions(+), 44 deletions(-) (limited to 'indra/newview/llagent.cpp') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 804dec0b33..4cd15f6336 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -342,7 +342,10 @@ LLAgent::LLAgent() : mMaturityRatingChange(0U), mIsDoSendMaturityPreferenceToServer(false), mMaturityPreferenceConfirmCallback(NULL), - mMaturityPerferenceMessageId(0U), + mMaturityPerferenceRequestId(0U), + mMaturityPerferenceResponseId(0U), + mLastKnownRequestMaturity(SIM_ACCESS_MIN), + mLastKnownResponseMaturity(SIM_ACCESS_MIN), mPreferredMaturityValidateSlot(), mPreferredMaturityCommitSlot(), mTeleportState( TELEPORT_NONE ), @@ -430,6 +433,8 @@ void LLAgent::init() mPreferredMaturityValidateSlot = gSavedSettings.getControl("PreferredMaturity")->getValidateSignal()->connect(boost::bind(&LLAgent::validateMaturity, this, _2)); mPreferredMaturityCommitSlot = gSavedSettings.getControl("PreferredMaturity")->getSignal()->connect(boost::bind(&LLAgent::handleMaturity, this, _2, _3)); + mLastKnownRequestMaturity = static_cast(gSavedSettings.getU32("PreferredMaturity")); + mLastKnownResponseMaturity = mLastKnownRequestMaturity; mIsDoSendMaturityPreferenceToServer = true; if (!mTeleportFinishedSlot.connected()) @@ -2496,7 +2501,7 @@ int LLAgent::convertTextToMaturity(char text) class LLMaturityPreferencesResponder : public LLHTTPClient::Responder { public: - LLMaturityPreferencesResponder(LLAgent *pAgent, unsigned int pMessageId, U8 pPreferredMaturity, U8 pPreviousMaturity, LLAgent::maturity_preferences_callback_t pMaturityPreferencesCallback); + LLMaturityPreferencesResponder(LLAgent *pAgent, unsigned int pRequestId, U8 pPreferredMaturity, U8 pPreviousMaturity, LLAgent::maturity_preferences_callback_t pMaturityPreferencesCallback); virtual ~LLMaturityPreferencesResponder(); virtual void result(const LLSD &pContent); @@ -2508,16 +2513,16 @@ private: U8 parseMaturityFromServerResponse(const LLSD &pContent); LLAgent *mAgent; - unsigned int mMessageId; + unsigned int mRequestId; U8 mPreferredMaturity; U8 mPreviousMaturity; LLAgent::maturity_preferences_callback_t mMaturityPreferencesCallback; }; -LLMaturityPreferencesResponder::LLMaturityPreferencesResponder(LLAgent *pAgent, unsigned int pMessageId, U8 pPreferredMaturity, U8 pPreviousMaturity, LLAgent::maturity_preferences_callback_t pMaturityPreferencesCallback) +LLMaturityPreferencesResponder::LLMaturityPreferencesResponder(LLAgent *pAgent, unsigned int pRequestId, U8 pPreferredMaturity, U8 pPreviousMaturity, LLAgent::maturity_preferences_callback_t pMaturityPreferencesCallback) : LLHTTPClient::Responder(), mAgent(pAgent), - mMessageId(pMessageId), + mRequestId(pRequestId), mPreferredMaturity(pPreferredMaturity), mPreviousMaturity(pPreviousMaturity), mMaturityPreferencesCallback(pMaturityPreferencesCallback) @@ -2538,7 +2543,7 @@ void LLMaturityPreferencesResponder::result(const LLSD &pContent) << "' to '" << LLViewerRegion::accessToString(mPreferredMaturity) << "', the server responded with '" << LLViewerRegion::accessToString(actualMaturity) << "' [value:" << static_cast(actualMaturity) << ", llsd:" << pContent << "]" << llendl; - mAgent->handlePreferredMaturityResult(mMessageId, actualMaturity); + mAgent->handlePreferredMaturityResult(mRequestId, actualMaturity); } else { @@ -2546,7 +2551,7 @@ void LLMaturityPreferencesResponder::result(const LLSD &pContent) << "' to '" << LLViewerRegion::accessToString(mPreferredMaturity) << "', the server responded with '" << LLViewerRegion::accessToString(actualMaturity) << "' [value:" << static_cast(actualMaturity) << ", llsd:" << pContent << "]" << llendl; - mAgent->handlePreferredMaturityUnexpectedResult(mMessageId, mPreferredMaturity, mPreviousMaturity, actualMaturity); + mAgent->handlePreferredMaturityUnexpectedResult(mRequestId, mPreferredMaturity, mPreviousMaturity, actualMaturity); } if (!mMaturityPreferencesCallback.empty()) @@ -2560,7 +2565,7 @@ void LLMaturityPreferencesResponder::error(U32 pStatus, const std::string& pReas llwarns << "while attempting to change maturity preference from '" << LLViewerRegion::accessToString(mPreviousMaturity) << "' to '" << LLViewerRegion::accessToString(mPreferredMaturity) << "', we got an error because '" << pReason << "' [status:" << pStatus << "]" << llendl; - mAgent->handlePreferredMaturityError(mMessageId, mPreferredMaturity, mPreviousMaturity); + mAgent->handlePreferredMaturityError(mRequestId, mPreferredMaturity, mPreviousMaturity); if (!mMaturityPreferencesCallback.empty()) { mMaturityPreferencesCallback(mPreviousMaturity); @@ -2577,7 +2582,7 @@ U8 LLMaturityPreferencesResponder::parseMaturityFromServerResponse(const LLSD &p U8 maturity = SIM_ACCESS_MIN; if (pContent.isUndefined()) { - maturity = mPreviousMaturity; + maturity = mPreferredMaturity; } else { @@ -2632,60 +2637,80 @@ void LLAgent::setMaturityPreferenceAndConfirm(U32 preferredMaturity, maturity_pr mMaturityPreferenceConfirmCallback = NULL; } -void LLAgent::handlePreferredMaturityResult(unsigned int pMessageId, U8 pServerMaturity) +void LLAgent::handlePreferredMaturityResult(unsigned int pRequestId, U8 pServerMaturity) { - llassert(pMessageId <= mMaturityPerferenceMessageId); - if (pMessageId < mMaturityPerferenceMessageId) + ++mMaturityPerferenceResponseId; + mLastKnownResponseMaturity = pServerMaturity; + llassert(mMaturityPerferenceResponseId <= mMaturityPerferenceRequestId); + if (mMaturityPerferenceResponseId == mMaturityPerferenceRequestId) { - llwarns << "out of order result while changing maturity preference" << llendl; - } - U8 localMaturity = static_cast(gSavedSettings.getU32("PreferredMaturity")); - if (localMaturity != pServerMaturity) - { - bool tmpIsDoSendMaturityPreferenceToServer = mIsDoSendMaturityPreferenceToServer; - mIsDoSendMaturityPreferenceToServer = false; - llinfos << "Setting viewer preferred maturity to '" << LLViewerRegion::accessToString(pServerMaturity) << "'" << llendl; - gSavedSettings.setU32("PreferredMaturity", static_cast(pServerMaturity)); - mIsDoSendMaturityPreferenceToServer = tmpIsDoSendMaturityPreferenceToServer; + U8 localMaturity = static_cast(gSavedSettings.getU32("PreferredMaturity")); + if (localMaturity != mLastKnownResponseMaturity) + { + bool tmpIsDoSendMaturityPreferenceToServer = mIsDoSendMaturityPreferenceToServer; + mIsDoSendMaturityPreferenceToServer = false; + llinfos << "Setting viewer preferred maturity to '" << LLViewerRegion::accessToString(pServerMaturity) << "'" << llendl; + gSavedSettings.setU32("PreferredMaturity", static_cast(pServerMaturity)); + mIsDoSendMaturityPreferenceToServer = tmpIsDoSendMaturityPreferenceToServer; + } + if (mLastKnownRequestMaturity != mLastKnownResponseMaturity) + { + llwarns << "Last known requested maturity '" << LLViewerRegion::accessToString(mLastKnownRequestMaturity) + << "' does not match last known response maturity '" << LLViewerRegion::accessToString(mLastKnownResponseMaturity) + << "'" << llendl; + } } } -void LLAgent::handlePreferredMaturityError(unsigned int pMessageId, U8 pPreferredMaturity, U8 pPreviousMaturity) +void LLAgent::handlePreferredMaturityError(unsigned int pRequestId, U8 pPreferredMaturity, U8 pPreviousMaturity) { - llassert(pMessageId <= mMaturityPerferenceMessageId); - if (pMessageId < mMaturityPerferenceMessageId) - { - llwarns << "out of order result while changing maturity preference" << llendl; - } - if (pMessageId == mMaturityPerferenceMessageId) + ++mMaturityPerferenceResponseId; + llassert(mMaturityPerferenceResponseId <= mMaturityPerferenceRequestId); + if (mMaturityPerferenceResponseId == mMaturityPerferenceRequestId) { - bool tmpIsDoSendMaturityPreferenceToServer = mIsDoSendMaturityPreferenceToServer; - mIsDoSendMaturityPreferenceToServer = false; - llinfos << "Setting viewer preferred maturity to '" << LLViewerRegion::accessToString(pPreviousMaturity) << "'" << llendl; - gSavedSettings.setU32("PreferredMaturity", static_cast(pPreviousMaturity)); - mIsDoSendMaturityPreferenceToServer = tmpIsDoSendMaturityPreferenceToServer; + U8 localMaturity = static_cast(gSavedSettings.getU32("PreferredMaturity")); + if (localMaturity != mLastKnownResponseMaturity) + { + bool tmpIsDoSendMaturityPreferenceToServer = mIsDoSendMaturityPreferenceToServer; + mIsDoSendMaturityPreferenceToServer = false; + llinfos << "Setting viewer preferred maturity to '" << LLViewerRegion::accessToString(mLastKnownResponseMaturity) << "'" << llendl; + gSavedSettings.setU32("PreferredMaturity", static_cast(mLastKnownResponseMaturity)); + mIsDoSendMaturityPreferenceToServer = tmpIsDoSendMaturityPreferenceToServer; + } } } -void LLAgent::handlePreferredMaturityUnexpectedResult(unsigned int pMessageId, U8 pPreferredMaturity, U8 pPreviousMaturity, U8 pServerMaturity) +void LLAgent::handlePreferredMaturityUnexpectedResult(unsigned int pRequestId, U8 pPreferredMaturity, U8 pPreviousMaturity, U8 pServerMaturity) { - llassert(pMessageId <= mMaturityPerferenceMessageId); - if (pMessageId < mMaturityPerferenceMessageId) + ++mMaturityPerferenceResponseId; + mLastKnownResponseMaturity = pServerMaturity; + llassert(mMaturityPerferenceResponseId <= mMaturityPerferenceRequestId); + if (mMaturityPerferenceResponseId == mMaturityPerferenceRequestId) { - llwarns << "out of order result while changing maturity preference" << llendl; + U8 localMaturity = static_cast(gSavedSettings.getU32("PreferredMaturity")); + if (localMaturity != mLastKnownResponseMaturity) + { + bool tmpIsDoSendMaturityPreferenceToServer = mIsDoSendMaturityPreferenceToServer; + mIsDoSendMaturityPreferenceToServer = false; + llinfos << "Setting viewer preferred maturity to '" << LLViewerRegion::accessToString(pServerMaturity) << "'" << llendl; + gSavedSettings.setU32("PreferredMaturity", static_cast(pServerMaturity)); + mIsDoSendMaturityPreferenceToServer = tmpIsDoSendMaturityPreferenceToServer; + } + if (mLastKnownRequestMaturity != mLastKnownResponseMaturity) + { + llwarns << "Last known requested maturity '" << LLViewerRegion::accessToString(mLastKnownRequestMaturity) + << "' does not match last known response maturity '" << LLViewerRegion::accessToString(mLastKnownResponseMaturity) + << "'" << llendl; + } } - bool tmpIsDoSendMaturityPreferenceToServer = mIsDoSendMaturityPreferenceToServer; - mIsDoSendMaturityPreferenceToServer = false; - llinfos << "Setting viewer preferred maturity to '" << LLViewerRegion::accessToString(pServerMaturity) << "'" << llendl; - gSavedSettings.setU32("PreferredMaturity", static_cast(pServerMaturity)); - mIsDoSendMaturityPreferenceToServer = tmpIsDoSendMaturityPreferenceToServer; } void LLAgent::sendMaturityPreferenceToServer(U8 pPreferredMaturity, U8 pPreviousMaturity) { if (mIsDoSendMaturityPreferenceToServer) { - LLHTTPClient::ResponderPtr responderPtr = LLHTTPClient::ResponderPtr(new LLMaturityPreferencesResponder(this, ++mMaturityPerferenceMessageId, pPreferredMaturity, pPreviousMaturity, mMaturityPreferenceConfirmCallback)); + mLastKnownRequestMaturity = pPreferredMaturity; + LLHTTPClient::ResponderPtr responderPtr = LLHTTPClient::ResponderPtr(new LLMaturityPreferencesResponder(this, ++mMaturityPerferenceRequestId, pPreferredMaturity, pPreviousMaturity, mMaturityPreferenceConfirmCallback)); if (getRegion() == NULL) { responderPtr->error(0U, "region is not defined"); -- cgit v1.2.3 From 403ed9656bf4c0c92004cce44d08972b9bd6ee43 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Fri, 25 May 2012 17:48:21 -0700 Subject: EXP-1942,EXP-1945: More robust handling and syncing of the maturity preference. --- indra/newview/llagent.cpp | 176 ++++++++++++++++++++++++++-------------------- 1 file changed, 100 insertions(+), 76 deletions(-) (limited to 'indra/newview/llagent.cpp') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 4cd15f6336..6e32f3358f 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -342,12 +342,11 @@ LLAgent::LLAgent() : mMaturityRatingChange(0U), mIsDoSendMaturityPreferenceToServer(false), mMaturityPreferenceConfirmCallback(NULL), - mMaturityPerferenceRequestId(0U), - mMaturityPerferenceResponseId(0U), + mMaturityPreferenceRequestId(0U), + mMaturityPreferenceResponseId(0U), + mMaturityPreferenceNumRetries(0U), mLastKnownRequestMaturity(SIM_ACCESS_MIN), mLastKnownResponseMaturity(SIM_ACCESS_MIN), - mPreferredMaturityValidateSlot(), - mPreferredMaturityCommitSlot(), mTeleportState( TELEPORT_NONE ), mRegionp(NULL), @@ -431,10 +430,10 @@ void LLAgent::init() *mEffectColor = LLUIColorTable::instance().getColor("EffectColor"); - mPreferredMaturityValidateSlot = gSavedSettings.getControl("PreferredMaturity")->getValidateSignal()->connect(boost::bind(&LLAgent::validateMaturity, this, _2)); - mPreferredMaturityCommitSlot = gSavedSettings.getControl("PreferredMaturity")->getSignal()->connect(boost::bind(&LLAgent::handleMaturity, this, _2, _3)); - mLastKnownRequestMaturity = static_cast(gSavedSettings.getU32("PreferredMaturity")); - mLastKnownResponseMaturity = mLastKnownRequestMaturity; + gSavedSettings.getControl("PreferredMaturity")->getValidateSignal()->connect(boost::bind(&LLAgent::validateMaturity, this, _2)); + gSavedSettings.getControl("PreferredMaturity")->getSignal()->connect(boost::bind(&LLAgent::handleMaturity, this, _2)); + mLastKnownResponseMaturity = static_cast(gSavedSettings.getU32("PreferredMaturity")); + mLastKnownRequestMaturity = mLastKnownResponseMaturity; mIsDoSendMaturityPreferenceToServer = true; if (!mTeleportFinishedSlot.connected()) @@ -2501,7 +2500,7 @@ int LLAgent::convertTextToMaturity(char text) class LLMaturityPreferencesResponder : public LLHTTPClient::Responder { public: - LLMaturityPreferencesResponder(LLAgent *pAgent, unsigned int pRequestId, U8 pPreferredMaturity, U8 pPreviousMaturity, LLAgent::maturity_preferences_callback_t pMaturityPreferencesCallback); + LLMaturityPreferencesResponder(LLAgent *pAgent, U8 pPreferredMaturity, U8 pPreviousMaturity, LLAgent::maturity_preferences_callback_t pMaturityPreferencesCallback); virtual ~LLMaturityPreferencesResponder(); virtual void result(const LLSD &pContent); @@ -2513,16 +2512,14 @@ private: U8 parseMaturityFromServerResponse(const LLSD &pContent); LLAgent *mAgent; - unsigned int mRequestId; U8 mPreferredMaturity; U8 mPreviousMaturity; LLAgent::maturity_preferences_callback_t mMaturityPreferencesCallback; }; -LLMaturityPreferencesResponder::LLMaturityPreferencesResponder(LLAgent *pAgent, unsigned int pRequestId, U8 pPreferredMaturity, U8 pPreviousMaturity, LLAgent::maturity_preferences_callback_t pMaturityPreferencesCallback) +LLMaturityPreferencesResponder::LLMaturityPreferencesResponder(LLAgent *pAgent, U8 pPreferredMaturity, U8 pPreviousMaturity, LLAgent::maturity_preferences_callback_t pMaturityPreferencesCallback) : LLHTTPClient::Responder(), mAgent(pAgent), - mRequestId(pRequestId), mPreferredMaturity(pPreferredMaturity), mPreviousMaturity(pPreviousMaturity), mMaturityPreferencesCallback(pMaturityPreferencesCallback) @@ -2537,22 +2534,14 @@ void LLMaturityPreferencesResponder::result(const LLSD &pContent) { U8 actualMaturity = parseMaturityFromServerResponse(pContent); - if (actualMaturity == mPreferredMaturity) - { - llinfos << "succesfully changed maturity preference from '" << LLViewerRegion::accessToString(mPreviousMaturity) - << "' to '" << LLViewerRegion::accessToString(mPreferredMaturity) << "', the server responded with '" - << LLViewerRegion::accessToString(actualMaturity) << "' [value:" << static_cast(actualMaturity) << ", llsd:" - << pContent << "]" << llendl; - mAgent->handlePreferredMaturityResult(mRequestId, actualMaturity); - } - else + if (actualMaturity != mPreferredMaturity) { llwarns << "while attempting to change maturity preference from '" << LLViewerRegion::accessToString(mPreviousMaturity) << "' to '" << LLViewerRegion::accessToString(mPreferredMaturity) << "', the server responded with '" << LLViewerRegion::accessToString(actualMaturity) << "' [value:" << static_cast(actualMaturity) << ", llsd:" << pContent << "]" << llendl; - mAgent->handlePreferredMaturityUnexpectedResult(mRequestId, mPreferredMaturity, mPreviousMaturity, actualMaturity); } + mAgent->handlePreferredMaturityResult(actualMaturity); if (!mMaturityPreferencesCallback.empty()) { @@ -2565,7 +2554,7 @@ void LLMaturityPreferencesResponder::error(U32 pStatus, const std::string& pReas llwarns << "while attempting to change maturity preference from '" << LLViewerRegion::accessToString(mPreviousMaturity) << "' to '" << LLViewerRegion::accessToString(mPreferredMaturity) << "', we got an error because '" << pReason << "' [status:" << pStatus << "]" << llendl; - mAgent->handlePreferredMaturityError(mRequestId, mPreferredMaturity, mPreviousMaturity); + mAgent->handlePreferredMaturityError(); if (!mMaturityPreferencesCallback.empty()) { mMaturityPreferencesCallback(mPreviousMaturity); @@ -2637,88 +2626,123 @@ void LLAgent::setMaturityPreferenceAndConfirm(U32 preferredMaturity, maturity_pr mMaturityPreferenceConfirmCallback = NULL; } -void LLAgent::handlePreferredMaturityResult(unsigned int pRequestId, U8 pServerMaturity) +void LLAgent::handlePreferredMaturityResult(U8 pServerMaturity) { - ++mMaturityPerferenceResponseId; + // Update the number of responses received + ++mMaturityPreferenceResponseId; + llassert(mMaturityPreferenceResponseId <= mMaturityPreferenceRequestId); + + // Update the last known server maturity response mLastKnownResponseMaturity = pServerMaturity; - llassert(mMaturityPerferenceResponseId <= mMaturityPerferenceRequestId); - if (mMaturityPerferenceResponseId == mMaturityPerferenceRequestId) + + // Ignore all responses if we know there are more unanswered requests that are expected + if (mMaturityPreferenceResponseId == mMaturityPreferenceRequestId) { - U8 localMaturity = static_cast(gSavedSettings.getU32("PreferredMaturity")); - if (localMaturity != mLastKnownResponseMaturity) + // If we received a response that matches the last known request, then we are good + if (mLastKnownRequestMaturity == mLastKnownResponseMaturity) + { + mMaturityPreferenceNumRetries = 0; + llassert(static_cast(gSavedSettings.getU32("PreferredMaturity")) == mLastKnownResponseMaturity); + } + // Else, the viewer is out of sync with the server, so let's try to re-sync with the + // server by re-sending our last known request. Cap the re-tries at 3 just to be safe. + else if (++mMaturityPreferenceNumRetries <= 3) { - bool tmpIsDoSendMaturityPreferenceToServer = mIsDoSendMaturityPreferenceToServer; - mIsDoSendMaturityPreferenceToServer = false; - llinfos << "Setting viewer preferred maturity to '" << LLViewerRegion::accessToString(pServerMaturity) << "'" << llendl; - gSavedSettings.setU32("PreferredMaturity", static_cast(pServerMaturity)); - mIsDoSendMaturityPreferenceToServer = tmpIsDoSendMaturityPreferenceToServer; + llinfos << "Retrying attempt #" << mMaturityPreferenceNumRetries << " to set viewer preferred maturity to '" + << LLViewerRegion::accessToString(mLastKnownRequestMaturity) << "'" << llendl; + sendMaturityPreferenceToServer(mLastKnownRequestMaturity); } - if (mLastKnownRequestMaturity != mLastKnownResponseMaturity) + // Else, the viewer is style out of sync with the server after 3 retries, so inform the user + else { - llwarns << "Last known requested maturity '" << LLViewerRegion::accessToString(mLastKnownRequestMaturity) - << "' does not match last known response maturity '" << LLViewerRegion::accessToString(mLastKnownResponseMaturity) - << "'" << llendl; + mMaturityPreferenceNumRetries = 0; + reportPreferredMaturityError(); } } } -void LLAgent::handlePreferredMaturityError(unsigned int pRequestId, U8 pPreferredMaturity, U8 pPreviousMaturity) +void LLAgent::handlePreferredMaturityError() { - ++mMaturityPerferenceResponseId; - llassert(mMaturityPerferenceResponseId <= mMaturityPerferenceRequestId); - if (mMaturityPerferenceResponseId == mMaturityPerferenceRequestId) + // Update the number of responses received + ++mMaturityPreferenceResponseId; + llassert(mMaturityPreferenceResponseId <= mMaturityPreferenceRequestId); + + // Ignore all responses if we know there are more unanswered requests that are expected + if (mMaturityPreferenceResponseId == mMaturityPreferenceRequestId) { - U8 localMaturity = static_cast(gSavedSettings.getU32("PreferredMaturity")); - if (localMaturity != mLastKnownResponseMaturity) + mMaturityPreferenceNumRetries = 0; + + // If we received a response that matches the last known request, then we are synced with + // the server, but not quite sure why we are + if (mLastKnownRequestMaturity == mLastKnownResponseMaturity) + { + llwarns << "Got an error but maturity preference '" << LLViewerRegion::accessToString(mLastKnownRequestMaturity) + << "' seems to be in sync with the server" << llendl; + mMaturityPreferenceNumRetries = 0; + } + // Else, the more likely case is that the last request does not match the last response, + // so inform the user + else { - bool tmpIsDoSendMaturityPreferenceToServer = mIsDoSendMaturityPreferenceToServer; - mIsDoSendMaturityPreferenceToServer = false; - llinfos << "Setting viewer preferred maturity to '" << LLViewerRegion::accessToString(mLastKnownResponseMaturity) << "'" << llendl; - gSavedSettings.setU32("PreferredMaturity", static_cast(mLastKnownResponseMaturity)); - mIsDoSendMaturityPreferenceToServer = tmpIsDoSendMaturityPreferenceToServer; + reportPreferredMaturityError(); } } } -void LLAgent::handlePreferredMaturityUnexpectedResult(unsigned int pRequestId, U8 pPreferredMaturity, U8 pPreviousMaturity, U8 pServerMaturity) +void LLAgent::reportPreferredMaturityError() { - ++mMaturityPerferenceResponseId; - mLastKnownResponseMaturity = pServerMaturity; - llassert(mMaturityPerferenceResponseId <= mMaturityPerferenceRequestId); - if (mMaturityPerferenceResponseId == mMaturityPerferenceRequestId) + // Get the last known maturity request from the user activity + std::string preferredMaturity = LLViewerRegion::accessToString(mLastKnownRequestMaturity); + LLStringUtil::toLower(preferredMaturity); + + // Get the last known maturity response from the server + std::string actualMaturity = LLViewerRegion::accessToString(mLastKnownResponseMaturity); + LLStringUtil::toLower(actualMaturity); + + // Notify the user + LLSD args = LLSD::emptyMap(); + args["PREFERRED_MATURITY"] = preferredMaturity; + args["ACTUAL_MATURITY"] = actualMaturity; + LLNotificationsUtil::add("MaturityChangeError", args); + + // Check the saved settings to ensure that we are consistent. If we are not consistent, update + // the viewer, but do not send anything to server + U8 localMaturity = static_cast(gSavedSettings.getU32("PreferredMaturity")); + if (localMaturity != mLastKnownResponseMaturity) { - U8 localMaturity = static_cast(gSavedSettings.getU32("PreferredMaturity")); - if (localMaturity != mLastKnownResponseMaturity) - { - bool tmpIsDoSendMaturityPreferenceToServer = mIsDoSendMaturityPreferenceToServer; - mIsDoSendMaturityPreferenceToServer = false; - llinfos << "Setting viewer preferred maturity to '" << LLViewerRegion::accessToString(pServerMaturity) << "'" << llendl; - gSavedSettings.setU32("PreferredMaturity", static_cast(pServerMaturity)); - mIsDoSendMaturityPreferenceToServer = tmpIsDoSendMaturityPreferenceToServer; - } - if (mLastKnownRequestMaturity != mLastKnownResponseMaturity) - { - llwarns << "Last known requested maturity '" << LLViewerRegion::accessToString(mLastKnownRequestMaturity) - << "' does not match last known response maturity '" << LLViewerRegion::accessToString(mLastKnownResponseMaturity) - << "'" << llendl; - } + bool tmpIsDoSendMaturityPreferenceToServer = mIsDoSendMaturityPreferenceToServer; + mIsDoSendMaturityPreferenceToServer = false; + llinfos << "Setting viewer preferred maturity to '" << LLViewerRegion::accessToString(mLastKnownResponseMaturity) << "'" << llendl; + gSavedSettings.setU32("PreferredMaturity", static_cast(mLastKnownResponseMaturity)); + mIsDoSendMaturityPreferenceToServer = tmpIsDoSendMaturityPreferenceToServer; } } -void LLAgent::sendMaturityPreferenceToServer(U8 pPreferredMaturity, U8 pPreviousMaturity) +void LLAgent::sendMaturityPreferenceToServer(U8 pPreferredMaturity) { + // Only send maturity preference to the server if enabled if (mIsDoSendMaturityPreferenceToServer) { + // Increment the number of requests. The handlers manage a separate count of responses. + ++mMaturityPreferenceRequestId; + + // Update the last know maturity request mLastKnownRequestMaturity = pPreferredMaturity; - LLHTTPClient::ResponderPtr responderPtr = LLHTTPClient::ResponderPtr(new LLMaturityPreferencesResponder(this, ++mMaturityPerferenceRequestId, pPreferredMaturity, pPreviousMaturity, mMaturityPreferenceConfirmCallback)); + + // Create a response handler + LLHTTPClient::ResponderPtr responderPtr = LLHTTPClient::ResponderPtr(new LLMaturityPreferencesResponder(this, pPreferredMaturity, mLastKnownResponseMaturity, mMaturityPreferenceConfirmCallback)); + + // If we don't have a region, report it as an error if (getRegion() == NULL) { responderPtr->error(0U, "region is not defined"); } else { - // Update agent access preference on the server + // Find the capability to send maturity preference std::string url = getRegion()->getCapability("UpdateAgentInformation"); + + // If the capability is not defined, report it as an error if (url.empty()) { responderPtr->error(0U, "capability 'UpdateAgentInformation' is not defined for region"); @@ -2731,8 +2755,8 @@ void LLAgent::sendMaturityPreferenceToServer(U8 pPreferredMaturity, U8 pPrevious LLSD body = LLSD::emptyMap(); body["access_prefs"] = access_prefs; - llinfos << "Sending access prefs update to " << (access_prefs["max"].asString()) << " via capability to: " - << url << llendl; + llinfos << "Sending viewer preferred maturity to '" << LLViewerRegion::accessToString(pPreferredMaturity) + << "' via capability to: " << url << llendl; LLSD headers; LLHTTPClient::post(url, body, responderPtr, headers, 30.0f); } @@ -2770,9 +2794,9 @@ bool LLAgent::validateMaturity(const LLSD& newvalue) return mAgentAccess->canSetMaturity(newvalue.asInteger()); } -void LLAgent::handleMaturity(const LLSD &pNewValue, const LLSD &pPreviousValue) +void LLAgent::handleMaturity(const LLSD &pNewValue) { - sendMaturityPreferenceToServer(static_cast(pNewValue.asInteger()), static_cast(pPreviousValue.asInteger())); + sendMaturityPreferenceToServer(static_cast(pNewValue.asInteger())); } //---------------------------------------------------------------------------- -- cgit v1.2.3 From 8ff00d6ecfb733876126fb5a2ebae6fe20e38f6f Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Tue, 29 May 2012 16:15:25 -0700 Subject: EXP-1942,EXP-1945: Ensuring that the teleport process waits for the maturity preferences to be synced between viewer and server. --- indra/newview/llagent.cpp | 135 +++++++++++++++++++++++++++------------------- 1 file changed, 79 insertions(+), 56 deletions(-) (limited to 'indra/newview/llagent.cpp') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 6e32f3358f..481abdceff 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -116,9 +116,20 @@ LLAgent gAgent; class LLTeleportRequest { public: + enum EStatus + { + kPending, + kStarted, + kFailed, + kRestartPending + }; + LLTeleportRequest(); virtual ~LLTeleportRequest(); + EStatus getStatus() const {return mStatus;}; + void setStatus(EStatus pStatus) {mStatus = pStatus;}; + virtual bool canRestartTeleport(); virtual void startTeleport() = 0; @@ -127,7 +138,7 @@ public: protected: private: - + EStatus mStatus; }; class LLTeleportRequestViaLandmark : public LLTeleportRequest @@ -334,14 +345,12 @@ LLAgent::LLAgent() : mAgentAccess(new LLAgentAccess(gSavedSettings)), mCanEditParcel(false), mTeleportSourceSLURL(new LLSLURL), - mCurrentTeleportRequest(), - mFailedTeleportRequest(), + mTeleportRequest(), mTeleportFinishedSlot(), mTeleportFailedSlot(), mIsMaturityRatingChangingDuringTeleport(false), mMaturityRatingChange(0U), mIsDoSendMaturityPreferenceToServer(false), - mMaturityPreferenceConfirmCallback(NULL), mMaturityPreferenceRequestId(0U), mMaturityPreferenceResponseId(0U), mMaturityPreferenceNumRetries(0U), @@ -2500,7 +2509,7 @@ int LLAgent::convertTextToMaturity(char text) class LLMaturityPreferencesResponder : public LLHTTPClient::Responder { public: - LLMaturityPreferencesResponder(LLAgent *pAgent, U8 pPreferredMaturity, U8 pPreviousMaturity, LLAgent::maturity_preferences_callback_t pMaturityPreferencesCallback); + LLMaturityPreferencesResponder(LLAgent *pAgent, U8 pPreferredMaturity, U8 pPreviousMaturity); virtual ~LLMaturityPreferencesResponder(); virtual void result(const LLSD &pContent); @@ -2514,15 +2523,13 @@ private: LLAgent *mAgent; U8 mPreferredMaturity; U8 mPreviousMaturity; - LLAgent::maturity_preferences_callback_t mMaturityPreferencesCallback; }; -LLMaturityPreferencesResponder::LLMaturityPreferencesResponder(LLAgent *pAgent, U8 pPreferredMaturity, U8 pPreviousMaturity, LLAgent::maturity_preferences_callback_t pMaturityPreferencesCallback) +LLMaturityPreferencesResponder::LLMaturityPreferencesResponder(LLAgent *pAgent, U8 pPreferredMaturity, U8 pPreviousMaturity) : LLHTTPClient::Responder(), mAgent(pAgent), mPreferredMaturity(pPreferredMaturity), - mPreviousMaturity(pPreviousMaturity), - mMaturityPreferencesCallback(pMaturityPreferencesCallback) + mPreviousMaturity(pPreviousMaturity) { } @@ -2542,11 +2549,6 @@ void LLMaturityPreferencesResponder::result(const LLSD &pContent) << pContent << "]" << llendl; } mAgent->handlePreferredMaturityResult(actualMaturity); - - if (!mMaturityPreferencesCallback.empty()) - { - mMaturityPreferencesCallback(actualMaturity); - } } void LLMaturityPreferencesResponder::error(U32 pStatus, const std::string& pReason) @@ -2555,10 +2557,6 @@ void LLMaturityPreferencesResponder::error(U32 pStatus, const std::string& pReas << "' to '" << LLViewerRegion::accessToString(mPreferredMaturity) << "', we got an error because '" << pReason << "' [status:" << pStatus << "]" << llendl; mAgent->handlePreferredMaturityError(); - if (!mMaturityPreferencesCallback.empty()) - { - mMaturityPreferencesCallback(mPreviousMaturity); - } } U8 LLMaturityPreferencesResponder::parseMaturityFromServerResponse(const LLSD &pContent) @@ -2613,19 +2611,6 @@ U8 LLMaturityPreferencesResponder::parseMaturityFromServerResponse(const LLSD &p return maturity; } -void LLAgent::setMaturityPreferenceAndConfirm(U32 preferredMaturity, maturity_preferences_callback_t pMaturityPreferencesCallback) -{ - llassert(mMaturityPreferenceConfirmCallback == NULL); - mMaturityPreferenceConfirmCallback = pMaturityPreferencesCallback; - - gSavedSettings.setU32("PreferredMaturity", static_cast(preferredMaturity)); - // PreferredMaturity has a signal hook on change that will call LLAgent::sendMaturityPreferenceToServer - // sendMaturityPreferenceToServer will use mMaturityPreferenceConfirmCallback in the LLHTTPResponder - // This allows for confirmation that the server has officially received the maturity preference change - - mMaturityPreferenceConfirmCallback = NULL; -} - void LLAgent::handlePreferredMaturityResult(U8 pServerMaturity) { // Update the number of responses received @@ -2642,6 +2627,7 @@ void LLAgent::handlePreferredMaturityResult(U8 pServerMaturity) if (mLastKnownRequestMaturity == mLastKnownResponseMaturity) { mMaturityPreferenceNumRetries = 0; + reportPreferredMaturitySuccess(); llassert(static_cast(gSavedSettings.getU32("PreferredMaturity")) == mLastKnownResponseMaturity); } // Else, the viewer is out of sync with the server, so let's try to re-sync with the @@ -2689,6 +2675,14 @@ void LLAgent::handlePreferredMaturityError() } } +void LLAgent::reportPreferredMaturitySuccess() +{ + if (hasPendingTeleportRequest()) + { + startTeleportRequest(); + } +} + void LLAgent::reportPreferredMaturityError() { // Get the last known maturity request from the user activity @@ -2718,6 +2712,11 @@ void LLAgent::reportPreferredMaturityError() } } +bool LLAgent::isMaturityPreferenceSyncedWithServer() const +{ + return (mMaturityPreferenceRequestId == mMaturityPreferenceResponseId); +} + void LLAgent::sendMaturityPreferenceToServer(U8 pPreferredMaturity) { // Only send maturity preference to the server if enabled @@ -2730,7 +2729,7 @@ void LLAgent::sendMaturityPreferenceToServer(U8 pPreferredMaturity) mLastKnownRequestMaturity = pPreferredMaturity; // Create a response handler - LLHTTPClient::ResponderPtr responderPtr = LLHTTPClient::ResponderPtr(new LLMaturityPreferencesResponder(this, pPreferredMaturity, mLastKnownResponseMaturity, mMaturityPreferenceConfirmCallback)); + LLHTTPClient::ResponderPtr responderPtr = LLHTTPClient::ResponderPtr(new LLMaturityPreferencesResponder(this, pPreferredMaturity, mLastKnownResponseMaturity)); // If we don't have a region, report it as an error if (getRegion() == NULL) @@ -3808,23 +3807,22 @@ bool LLAgent::teleportCore(bool is_local) bool LLAgent::hasRestartableFailedTeleportRequest() { - return hasFailedTeleportRequest() && mFailedTeleportRequest->canRestartTeleport(); + return ((mTeleportRequest != NULL) && (mTeleportRequest->getStatus() == LLTeleportRequest::kFailed) && + mTeleportRequest->canRestartTeleport()); } void LLAgent::restartFailedTeleportRequest() { if (hasRestartableFailedTeleportRequest()) { - mFailedTeleportRequest->restartTeleport(); + mTeleportRequest->setStatus(LLTeleportRequest::kRestartPending); + startTeleportRequest(); } } -void LLAgent::clearFailedTeleportRequest() +void LLAgent::clearTeleportRequest() { - if (hasFailedTeleportRequest()) - { - mFailedTeleportRequest.reset(); - } + mTeleportRequest.reset(); } void LLAgent::setMaturityRatingChangeDuringTeleport(U8 pMaturityRatingChange) @@ -3833,16 +3831,38 @@ void LLAgent::setMaturityRatingChangeDuringTeleport(U8 pMaturityRatingChange) mMaturityRatingChange = pMaturityRatingChange; } -void LLAgent::handleTeleportFinished() +bool LLAgent::hasPendingTeleportRequest() { - if (hasCurrentTeleportRequest()) - { - mCurrentTeleportRequest.reset(); - } - if (hasFailedTeleportRequest()) + return ((mTeleportRequest != NULL) && + ((mTeleportRequest->getStatus() == LLTeleportRequest::kPending) || + (mTeleportRequest->getStatus() == LLTeleportRequest::kRestartPending))); +} + +void LLAgent::startTeleportRequest() +{ + if (hasPendingTeleportRequest() && isMaturityPreferenceSyncedWithServer()) { - clearFailedTeleportRequest(); + switch (mTeleportRequest->getStatus()) + { + case LLTeleportRequest::kPending : + mTeleportRequest->setStatus(LLTeleportRequest::kStarted); + mTeleportRequest->startTeleport(); + break; + case LLTeleportRequest::kRestartPending : + llassert(mTeleportRequest->canRestartTeleport()); + mTeleportRequest->setStatus(LLTeleportRequest::kStarted); + mTeleportRequest->restartTeleport(); + break; + default : + llassert(0); + break; + } } +} + +void LLAgent::handleTeleportFinished() +{ + clearTeleportRequest(); if (mIsMaturityRatingChangingDuringTeleport) { // notify user that the maturity preference has been changed @@ -3857,9 +3877,10 @@ void LLAgent::handleTeleportFinished() void LLAgent::handleTeleportFailed() { - if (hasCurrentTeleportRequest()) + llassert(mTeleportRequest != NULL); + if (mTeleportRequest != NULL) { - mFailedTeleportRequest = mCurrentTeleportRequest; + mTeleportRequest->setStatus(LLTeleportRequest::kFailed); } if (mIsMaturityRatingChangingDuringTeleport) { @@ -3905,8 +3926,8 @@ void LLAgent::teleportRequest( // Landmark ID = LLUUID::null means teleport home void LLAgent::teleportViaLandmark(const LLUUID& landmark_asset_id) { - mCurrentTeleportRequest = LLTeleportRequestPtr(new LLTeleportRequestViaLandmark(landmark_asset_id)); - mCurrentTeleportRequest->startTeleport(); + mTeleportRequest = LLTeleportRequestPtr(new LLTeleportRequestViaLandmark(landmark_asset_id)); + startTeleportRequest(); } void LLAgent::doTeleportViaLandmark(const LLUUID& landmark_asset_id) @@ -3926,8 +3947,8 @@ void LLAgent::doTeleportViaLandmark(const LLUUID& landmark_asset_id) void LLAgent::teleportViaLure(const LLUUID& lure_id, BOOL godlike) { - mCurrentTeleportRequest = LLTeleportRequestPtr(new LLTeleportRequestViaLure(lure_id, godlike)); - mCurrentTeleportRequest->startTeleport(); + mTeleportRequest = LLTeleportRequestPtr(new LLTeleportRequestViaLure(lure_id, godlike)); + startTeleportRequest(); } void LLAgent::doTeleportViaLure(const LLUUID& lure_id, BOOL godlike) @@ -3963,6 +3984,7 @@ void LLAgent::doTeleportViaLure(const LLUUID& lure_id, BOOL godlike) // James Cook, July 28, 2005 void LLAgent::teleportCancel() { + clearTeleportRequest(); LLViewerRegion* regionp = getRegion(); if(regionp) { @@ -3981,8 +4003,8 @@ void LLAgent::teleportCancel() void LLAgent::teleportViaLocation(const LLVector3d& pos_global) { - mCurrentTeleportRequest = LLTeleportRequestPtr(new LLTeleportRequestViaLocation(pos_global)); - mCurrentTeleportRequest->startTeleport(); + mTeleportRequest = LLTeleportRequestPtr(new LLTeleportRequestViaLocation(pos_global)); + startTeleportRequest(); } void LLAgent::doTeleportViaLocation(const LLVector3d& pos_global) @@ -4029,8 +4051,8 @@ void LLAgent::doTeleportViaLocation(const LLVector3d& pos_global) // Teleport to global position, but keep facing in the same direction void LLAgent::teleportViaLocationLookAt(const LLVector3d& pos_global) { - mCurrentTeleportRequest = LLTeleportRequestPtr(new LLTeleportRequestViaLocationLookAt(pos_global)); - mCurrentTeleportRequest->startTeleport(); + mTeleportRequest = LLTeleportRequestPtr(new LLTeleportRequestViaLocationLookAt(pos_global)); + startTeleportRequest(); } void LLAgent::doTeleportViaLocationLookAt(const LLVector3d& pos_global) @@ -4473,6 +4495,7 @@ LLAgentQueryManager::~LLAgentQueryManager() //----------------------------------------------------------------------------- LLTeleportRequest::LLTeleportRequest() + : mStatus(kPending) { } -- cgit v1.2.3 From fbf01e9c2a919fb51df2c6d71fa9d673ca69c1a8 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Tue, 29 May 2012 18:02:38 -0700 Subject: EXP-1942,EXP-1945: Pulling down the teleport screen in the scenario of waiting for a maturity preference change that is still being posted to the server. --- indra/newview/llagent.cpp | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) (limited to 'indra/newview/llagent.cpp') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 481abdceff..24a71f100a 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -3727,7 +3727,7 @@ void LLAgent::clearVisualParams(void *data) // protected bool LLAgent::teleportCore(bool is_local) { - if(TELEPORT_NONE != mTeleportState) + if ((TELEPORT_NONE != mTeleportState) && (mTeleportState != TELEPORT_PENDING)) { llwarns << "Attempt to teleport when already teleporting." << llendl; return false; @@ -3840,22 +3840,30 @@ bool LLAgent::hasPendingTeleportRequest() void LLAgent::startTeleportRequest() { - if (hasPendingTeleportRequest() && isMaturityPreferenceSyncedWithServer()) + if (hasPendingTeleportRequest()) { - switch (mTeleportRequest->getStatus()) + if (!isMaturityPreferenceSyncedWithServer()) { - case LLTeleportRequest::kPending : - mTeleportRequest->setStatus(LLTeleportRequest::kStarted); - mTeleportRequest->startTeleport(); - break; - case LLTeleportRequest::kRestartPending : - llassert(mTeleportRequest->canRestartTeleport()); - mTeleportRequest->setStatus(LLTeleportRequest::kStarted); - mTeleportRequest->restartTeleport(); - break; - default : - llassert(0); - break; + gTeleportDisplay = TRUE; + setTeleportState(TELEPORT_PENDING); + } + else + { + switch (mTeleportRequest->getStatus()) + { + case LLTeleportRequest::kPending : + mTeleportRequest->setStatus(LLTeleportRequest::kStarted); + mTeleportRequest->startTeleport(); + break; + case LLTeleportRequest::kRestartPending : + llassert(mTeleportRequest->canRestartTeleport()); + mTeleportRequest->setStatus(LLTeleportRequest::kStarted); + mTeleportRequest->restartTeleport(); + break; + default : + llassert(0); + break; + } } } } -- cgit v1.2.3 From f133a5ae7b4dcb8b27949f050c3e3b8b66b12a8b Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Tue, 29 May 2012 19:46:21 -0700 Subject: Re-adding a line of code that was unintentionally removed. --- indra/newview/llagent.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llagent.cpp') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 24a71f100a..f7575be75d 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -445,6 +445,8 @@ void LLAgent::init() mLastKnownRequestMaturity = mLastKnownResponseMaturity; mIsDoSendMaturityPreferenceToServer = true; + LLViewerParcelMgr::getInstance()->addAgentParcelChangedCallback(boost::bind(&LLAgent::parcelChangedCallback)); + if (!mTeleportFinishedSlot.connected()) { mTeleportFinishedSlot = LLViewerParcelMgr::getInstance()->setTeleportFinishedCallback(boost::bind(&LLAgent::handleTeleportFinished, this)); -- cgit v1.2.3 From 938f42ded789dd70b31820d29694256cec3a1572 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Thu, 31 May 2012 12:22:47 -0700 Subject: Reloading the the pathfinding object floaters when the god level is changed. --- indra/newview/llagent.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'indra/newview/llagent.cpp') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 3870a3be2e..d94e01ee47 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -243,6 +243,7 @@ LLAgent::LLAgent() : mbTeleportKeepsLookAt(false), mAgentAccess(new LLAgentAccess(gSavedSettings)), + mGodLevelChangeSignal(), mCanEditParcel(false), mTeleportSourceSLURL(new LLSLURL), mTeleportState( TELEPORT_NONE ), @@ -2434,6 +2435,12 @@ void LLAgent::setAdminOverride(BOOL b) void LLAgent::setGodLevel(U8 god_level) { mAgentAccess->setGodLevel(god_level); + mGodLevelChangeSignal(god_level); +} + +LLAgent::god_level_change_slot_t LLAgent::registerGodLevelChanageListener(god_level_change_callback_t pGodLevelChangeCallback) +{ + return mGodLevelChangeSignal.connect(pGodLevelChangeCallback); } void LLAgent::setAOTransition() -- cgit v1.2.3 From 0a90524439351e93881216344f04dcd8e3171289 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Fri, 1 Jun 2012 15:16:28 -0700 Subject: EXP-1942: Ensuring that the teleport cancel works in the case of restarting a teleport. Also, ensuring to pull down the teleport screen if we time out of a maturity request with a pending teleport queued. --- indra/newview/llagent.cpp | 38 +++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) (limited to 'indra/newview/llagent.cpp') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index f7575be75d..12d0de0347 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -2666,7 +2666,7 @@ void LLAgent::handlePreferredMaturityError() { llwarns << "Got an error but maturity preference '" << LLViewerRegion::accessToString(mLastKnownRequestMaturity) << "' seems to be in sync with the server" << llendl; - mMaturityPreferenceNumRetries = 0; + reportPreferredMaturitySuccess(); } // Else, the more likely case is that the last request does not match the last response, // so inform the user @@ -2679,6 +2679,8 @@ void LLAgent::handlePreferredMaturityError() void LLAgent::reportPreferredMaturitySuccess() { + // If there is a pending teleport request waiting for the maturity preference to be synced with + // the server, let's start the pending request if (hasPendingTeleportRequest()) { startTeleportRequest(); @@ -2687,6 +2689,14 @@ void LLAgent::reportPreferredMaturitySuccess() void LLAgent::reportPreferredMaturityError() { + // If there is a pending teleport request waiting for the maturity preference to be synced with + // the server, we were unable to successfully sync with the server on maturity preference, so let's + // just raise the screen. + if (hasPendingTeleportRequest()) + { + setTeleportState(LLAgent::TELEPORT_NONE); + } + // Get the last known maturity request from the user activity std::string preferredMaturity = LLViewerRegion::accessToString(mLastKnownRequestMaturity); LLStringUtil::toLower(preferredMaturity); @@ -3994,19 +4004,21 @@ void LLAgent::doTeleportViaLure(const LLUUID& lure_id, BOOL godlike) // James Cook, July 28, 2005 void LLAgent::teleportCancel() { - clearTeleportRequest(); - LLViewerRegion* regionp = getRegion(); - if(regionp) + if (!hasPendingTeleportRequest()) { - // send the message - LLMessageSystem* msg = gMessageSystem; - msg->newMessage("TeleportCancel"); - msg->nextBlockFast(_PREHASH_Info); - msg->addUUIDFast(_PREHASH_AgentID, getID()); - msg->addUUIDFast(_PREHASH_SessionID, getSessionID()); - sendReliableMessage(); - } - gTeleportDisplay = FALSE; + LLViewerRegion* regionp = getRegion(); + if(regionp) + { + // send the message + LLMessageSystem* msg = gMessageSystem; + msg->newMessage("TeleportCancel"); + msg->nextBlockFast(_PREHASH_Info); + msg->addUUIDFast(_PREHASH_AgentID, getID()); + msg->addUUIDFast(_PREHASH_SessionID, getSessionID()); + sendReliableMessage(); + } + } + clearTeleportRequest(); gAgent.setTeleportState( LLAgent::TELEPORT_NONE ); } -- cgit v1.2.3 From 9aeae2a87e79a8e612fa052a5db2866489cb6fae Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Tue, 5 Jun 2012 11:53:53 -0700 Subject: EXP-1942: BUGFIX Ensuring to clear the flag indicating that maturity changed during teleport when the maturity level change fails. --- indra/newview/llagent.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llagent.cpp') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 12d0de0347..1767522255 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -2692,6 +2692,7 @@ void LLAgent::reportPreferredMaturityError() // If there is a pending teleport request waiting for the maturity preference to be synced with // the server, we were unable to successfully sync with the server on maturity preference, so let's // just raise the screen. + mIsMaturityRatingChangingDuringTeleport = false; if (hasPendingTeleportRequest()) { setTeleportState(LLAgent::TELEPORT_NONE); -- cgit v1.2.3 From e41dde44f00fd494417f0ca11abed7aa98ccf32d Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Wed, 13 Jun 2012 18:15:54 -0700 Subject: EXP-1959: Marking the teleport entry access notifications as unique so they do not stack. --- indra/newview/llagent.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/llagent.cpp') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 1767522255..347cde6975 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -3898,7 +3898,6 @@ void LLAgent::handleTeleportFinished() void LLAgent::handleTeleportFailed() { - llassert(mTeleportRequest != NULL); if (mTeleportRequest != NULL) { mTeleportRequest->setStatus(LLTeleportRequest::kFailed); -- cgit v1.2.3 From e4aa2038812c2cf2cfed1b17a437ba620929f84f Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Tue, 19 Jun 2012 17:20:24 -0700 Subject: PATH-702: Positioning the rebake navmesh button to align with the Stand/StopFlying buttons. Also, parenting the buttons to the toolbar UI elements. --- indra/newview/llagent.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview/llagent.cpp') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index d94e01ee47..14772b11d6 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -56,6 +56,7 @@ #include "llnavigationbar.h" // to show/hide navigation bar when changing mouse look state #include "llnearbychatbar.h" #include "llnotificationsutil.h" +#include "llpanelnavmeshrebake.h" #include "llpaneltopinfobar.h" #include "llparcel.h" #include "llrendersphere.h" @@ -1870,6 +1871,7 @@ void LLAgent::endAnimationUpdateUI() LLChicletBar::getInstance()->setVisible(TRUE); LLPanelStandStopFlying::getInstance()->setVisible(TRUE); + LLPanelNavMeshRebake::getInstance()->setVisible(TRUE); LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset); @@ -1979,6 +1981,7 @@ void LLAgent::endAnimationUpdateUI() LLChicletBar::getInstance()->setVisible(FALSE); LLPanelStandStopFlying::getInstance()->setVisible(FALSE); + LLPanelNavMeshRebake::getInstance()->setVisible(FALSE); // clear out camera lag effect gAgentCamera.clearCameraLag(); -- cgit v1.2.3 From a818cd4f7336ed9b33dacd91fcaf5239a8be813d Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Tue, 26 Jun 2012 18:22:17 -0700 Subject: Renaming the rebake navmesh panel class. --- indra/newview/llagent.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview/llagent.cpp') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index e66df99d76..cf6b0e1562 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -56,7 +56,7 @@ #include "llnavigationbar.h" // to show/hide navigation bar when changing mouse look state #include "llnearbychatbar.h" #include "llnotificationsutil.h" -#include "llpanelnavmeshrebake.h" +#include "llpanelpathfindingrebakenavmesh.h" #include "llpaneltopinfobar.h" #include "llparcel.h" #include "llrendersphere.h" @@ -1871,7 +1871,7 @@ void LLAgent::endAnimationUpdateUI() LLChicletBar::getInstance()->setVisible(TRUE); LLPanelStandStopFlying::getInstance()->setVisible(TRUE); - LLPanelNavMeshRebake::getInstance()->setVisible(TRUE); + LLPanelPathfindingRebakeNavmesh::getInstance()->setVisible(TRUE); LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset); @@ -1981,7 +1981,7 @@ void LLAgent::endAnimationUpdateUI() LLChicletBar::getInstance()->setVisible(FALSE); LLPanelStandStopFlying::getInstance()->setVisible(FALSE); - LLPanelNavMeshRebake::getInstance()->setVisible(FALSE); + LLPanelPathfindingRebakeNavmesh::getInstance()->setVisible(FALSE); // clear out camera lag effect gAgentCamera.clearCameraLag(); -- cgit v1.2.3