From e6e51dfcc6e55c3f428e567ab1e824120dbc6c6b Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Thu, 10 May 2012 15:25:55 -0700 Subject: Adding a project viewer for the adult check build. --- BuildParams | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/BuildParams b/BuildParams index 1c39dd7cc7..6e64714c26 100644 --- a/BuildParams +++ b/BuildParams @@ -111,6 +111,17 @@ viewer-mesh.login_channel = "Project Viewer - Mesh" viewer-mesh.viewer_grid = aditi viewer-mesh.email = shining@lists.lindenlab.com +# ======================================== +# viewer-adult-check +# ======================================== + +viewer-adult-check.viewer_channel = "Project Viewer - AdultCheck" +viewer-adult-check.login_channel = "Project Viewer - AdultCheck" +viewer-adult-check.viewer_grid = agni +viewer-adult-check.build_debug_release_separately = true +viewer-adult-check.build_CYGWIN_Debug = false +viewer-adult-check.build_viewer_update_version_manager = false + # ================ # oz # ================ -- 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 +++++++++++++++++++++++++++++++++++++++++++++- indra/newview/llagent.h | 22 +++++- 2 files changed, 210 insertions(+), 4 deletions(-) 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 diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index 740770bbdf..3b27d48928 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -35,6 +35,7 @@ #include "llcoordframe.h" // for mFrameAgent #include "llvoavatardefines.h" +#include #include extern const BOOL ANIMATE; @@ -56,6 +57,9 @@ class LLAgentAccess; class LLSLURL; class LLPauseRequestHandle; class LLUIColor; +class LLTeleportRequest; + +typedef boost::shared_ptr LLTeleportRequestPtr; //-------------------------------------------------------------------- // Types @@ -556,9 +560,6 @@ private: // Teleport Actions //-------------------------------------------------------------------- public: - void teleportRequest(const U64& region_handle, - const LLVector3& pos_local, // Go to a named location home - bool look_at_from_camera = false); void teleportViaLandmark(const LLUUID& landmark_id); // Teleport to a landmark void teleportHome() { teleportViaLandmark(LLUUID::null); } // Go home void teleportViaLure(const LLUUID& lure_id, BOOL godlike); // To an invited location @@ -569,6 +570,20 @@ public: protected: bool teleportCore(bool is_local = false); // Stuff for all teleports; returns true if the teleport can proceed +private: + friend class LLTeleportRequest; + friend class LLTeleportRequestViaLandmark; + friend class LLTeleportRequestViaLure; + friend class LLTeleportRequestViaLocation; + friend class LLTeleportRequestViaLocationLookAt; + void teleportRequest(const U64& region_handle, + const LLVector3& pos_local, // Go to a named location home + bool look_at_from_camera = false); + void doTeleportViaLandmark(const LLUUID& landmark_id); // Teleport to a landmark + void doTeleportViaLure(const LLUUID& lure_id, BOOL godlike); // To an invited location + void doTeleportViaLocation(const LLVector3d& pos_global); // To a global location - this will probably need to be deprecated + void doTeleportViaLocationLookAt(const LLVector3d& pos_global);// To a global location, preserving camera rotation + //-------------------------------------------------------------------- // Teleport State //-------------------------------------------------------------------- @@ -577,6 +592,7 @@ public: void setTeleportState(ETeleportState state); private: ETeleportState mTeleportState; + LLTeleportRequestPtr mTeleportRequest; //-------------------------------------------------------------------- // Teleport Message -- 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 ++++++++++++++++++++++++++++++++++---- indra/newview/llagent.h | 31 +++++++- indra/newview/llviewermessage.cpp | 32 +++++--- 3 files changed, 185 insertions(+), 29 deletions(-) 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: diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index 3b27d48928..07ceaf11b1 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -35,6 +35,7 @@ #include "llcoordframe.h" // for mFrameAgent #include "llvoavatardefines.h" +#include #include #include @@ -570,12 +571,32 @@ public: protected: bool teleportCore(bool is_local = false); // Stuff for all teleports; returns true if the teleport can proceed + //-------------------------------------------------------------------- + // Teleport State + //-------------------------------------------------------------------- + +public: + inline bool hasCurrentTeleportRequest() {return (mCurrentTeleportRequest != NULL);}; + inline bool hasFailedTeleportRequest() {return (mFailedTeleportRequest != NULL);}; + void restartFailedTeleportRequest(); + void clearFailedTeleportRequest(); + void setMaturityRatingChangeDuringTeleport(int pMaturityRatingChange); + private: friend class LLTeleportRequest; friend class LLTeleportRequestViaLandmark; friend class LLTeleportRequestViaLure; friend class LLTeleportRequestViaLocation; friend class LLTeleportRequestViaLocationLookAt; + + LLTeleportRequestPtr mCurrentTeleportRequest; + LLTeleportRequestPtr mFailedTeleportRequest; + boost::signals2::connection mTeleportFinishedSlot; + boost::signals2::connection mTeleportFailedSlot; + + bool mIsMaturityRatingChangingDuringTeleport; + int mMaturityRatingChange; + void teleportRequest(const U64& region_handle, const LLVector3& pos_local, // Go to a named location home bool look_at_from_camera = false); @@ -584,6 +605,9 @@ private: void doTeleportViaLocation(const LLVector3d& pos_global); // To a global location - this will probably need to be deprecated void doTeleportViaLocationLookAt(const LLVector3d& pos_global);// To a global location, preserving camera rotation + void handleTeleportFinished(); + void handleTeleportFailed(); + //-------------------------------------------------------------------- // Teleport State //-------------------------------------------------------------------- @@ -592,7 +616,6 @@ public: void setTeleportState(ETeleportState state); private: ETeleportState mTeleportState; - LLTeleportRequestPtr mTeleportRequest; //-------------------------------------------------------------------- // Teleport Message @@ -668,8 +691,10 @@ public: bool isAdult() const; void setTeen(bool teen); void setMaturity(char text); - static int convertTextToMaturity(char text); - bool sendMaturityPreferenceToServer(int preferredMaturity); // ! "U8" instead of "int"? + static int convertTextToMaturity(char text); + + typedef boost::function maturity_preferences_callback_t; + bool sendMaturityPreferenceToServer(int preferredMaturity, maturity_preferences_callback_t pMaturityPreferencesCallback = NULL); // ! "U8" instead of "int"? // Maturity callbacks for PreferredMaturity control variable void handleMaturity(const LLSD& newvalue); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 2917fee62e..3712e56f7c 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5385,7 +5385,20 @@ static void process_money_balance_reply_extended(LLMessageSystem* msg) } } - +void handle_maturity_preference_change(const LLSD &pResponse, int pMaturityRatingChange) +{ + if (pResponse.isUndefined()) + { + // XXX stinson 05/11/2012 llinfos << "Maturity response ==> " << llendl; + gAgent.clearFailedTeleportRequest(); + } + else + { + // XXX stinson 05/11/2012 linfos << "Maturity response ==> '" << pResponse << "'" << llendl; + gAgent.setMaturityRatingChangeDuringTeleport(pMaturityRatingChange); + gAgent.restartFailedTeleportRequest(); + } +} bool handle_special_notification_callback(const LLSD& notification, const LLSD& response) { @@ -5396,12 +5409,11 @@ bool handle_special_notification_callback(const LLSD& notification, const LLSD& // set the preference to the maturity of the region we're calling int preferredMaturity = notification["payload"]["_region_access"].asInteger(); gSavedSettings.setU32("PreferredMaturity", preferredMaturity); - gAgent.sendMaturityPreferenceToServer(preferredMaturity); - - // notify user that the maturity preference has been changed - LLSD args; - args["RATING"] = LLViewerRegion::accessToString(preferredMaturity); - LLNotificationsUtil::add("PreferredMaturityChanged", args); + gAgent.sendMaturityPreferenceToServer(preferredMaturity, boost::bind(&handle_maturity_preference_change, _1, preferredMaturity)); + } + else + { + gAgent.clearFailedTeleportRequest(); } return false; @@ -6147,6 +6159,9 @@ void process_teleport_failed(LLMessageSystem *msg, void**) std::string big_reason; LLSD args; + // Let the interested parties know that teleport failed. + LLViewerParcelMgr::getInstance()->onTeleportFailed(); + // if we have additional alert data if (msg->has(_PREHASH_AlertInfo) && msg->getSizeFast(_PREHASH_AlertInfo, _PREHASH_Message) > 0) { @@ -6205,9 +6220,6 @@ void process_teleport_failed(LLMessageSystem *msg, void**) LLNotificationsUtil::add("CouldNotTeleportReason", args); - // Let the interested parties know that teleport failed. - LLViewerParcelMgr::getInstance()->onTeleportFailed(); - if( gAgent.getTeleportState() != LLAgent::TELEPORT_NONE ) { gAgent.setTeleportState( LLAgent::TELEPORT_NONE ); -- 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 +--------- indra/newview/llviewermessage.cpp | 3 +-- 2 files changed, 2 insertions(+), 11 deletions(-) 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(); } diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 3712e56f7c..56522bc819 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5389,12 +5389,11 @@ void handle_maturity_preference_change(const LLSD &pResponse, int pMaturityRatin { if (pResponse.isUndefined()) { - // XXX stinson 05/11/2012 llinfos << "Maturity response ==> " << llendl; + // XXX stinson 05/15/2012 : should report some notification that the preference has not changed gAgent.clearFailedTeleportRequest(); } else { - // XXX stinson 05/11/2012 linfos << "Maturity response ==> '" << pResponse << "'" << llendl; gAgent.setMaturityRatingChangeDuringTeleport(pMaturityRatingChange); gAgent.restartFailedTeleportRequest(); } -- 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(-) 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 6809b5068ffd0e0daece06af5dad56c32dfe2966 Mon Sep 17 00:00:00 2001 From: William Todd Stinson Date: Wed, 16 May 2012 01:24:44 -0700 Subject: EXP-1928: Changing the actual copy for the teleport and maturity preference notifications. --- indra/newview/skins/default/xui/en/notifications.xml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 59dd17ea9d..517da99a84 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -4111,28 +4111,30 @@ You are not allowed in that region due to your maturity Rating. type="alertmodal"> fail confirm -You are not allowed in that Region due to your maturity Rating preference. - -To enter the desired region, please change your maturity Rating preference. This will allow you to search for and access [REGIONMATURITY] content. To undo any changes, go to Me > Preferences > General. +The region you're trying to visit contains [REGIONMATURITY] content, but your current preferences are set to exclude [REGIONMATURITY] content. We can change your preferences, or you can cancel this teleport.