From a6fc0f63bff7f329cb77e86677af92a1cf5efb47 Mon Sep 17 00:00:00 2001 From: callum Date: Tue, 10 Apr 2012 15:31:05 -0700 Subject: MAINT-922 FIX Client side code to catch the SCRIPT_PERMISSION_TELEPORT request from similator and display a notification Reviewed by Simon --- indra/newview/llviewermessage.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index acddd3efe7..9875a61ffa 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -155,7 +155,8 @@ const std::string SCRIPT_QUESTIONS[SCRIPT_PERMISSION_EOF] = "AddAndRemoveJoints", "ChangePermissions", "TrackYourCamera", - "ControlYourCamera" + "ControlYourCamera", + "TeleportYourAgent" }; const BOOL SCRIPT_QUESTION_IS_CAUTION[SCRIPT_PERMISSION_EOF] = @@ -170,7 +171,8 @@ const BOOL SCRIPT_QUESTION_IS_CAUTION[SCRIPT_PERMISSION_EOF] = FALSE, // AddAndRemoveJoints FALSE, // ChangePermissions FALSE, // TrackYourCamera, - FALSE // ControlYourCamera + FALSE, // ControlYourCamera + FALSE // TeleportYourAgent }; bool friendship_offer_callback(const LLSD& notification, const LLSD& response) -- cgit v1.2.3 From f78039fd9509642296f2ff9c298c9828b6613975 Mon Sep 17 00:00:00 2001 From: Paul ProductEngine Date: Fri, 13 Apr 2012 17:14:56 +0300 Subject: MAINT-926 FIXED ([PUBLIC]IMs from objects appear only as notifications, not in local chat history, in some circumstances, making the sending prim untraceable (and impossible to mute)) - Improved detection of CHAT_SOURCE_SYSTEM type messages --- indra/newview/llviewermessage.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 9875a61ffa..65ffd3d494 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -2748,7 +2748,11 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) chat.mSourceType = CHAT_SOURCE_OBJECT; - if(SYSTEM_FROM == name) + // To conclude that the source type of message is CHAT_SOURCE_SYSTEM it's not + // enough to check only from name (i.e. fromName = "Second Life"). For example + // source type of messages from objects called "Second Life" should not be CHAT_SOURCE_SYSTEM. + bool chat_from_system = (SYSTEM_FROM == name) && region_id.isNull() && position.isNull(); + if(chat_from_system) { // System's UUID is NULL (fixes EXT-4766) chat.mFromID = LLUUID::null; @@ -2773,7 +2777,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) // Note: lie to Nearby Chat, pretending that this is NOT an IM, because // IMs from obejcts don't open IM sessions. LLNearbyChat* nearby_chat = LLNearbyChat::getInstance(); - if(SYSTEM_FROM != name && nearby_chat) + if(!chat_from_system && nearby_chat) { chat.mOwnerID = from_id; LLSD args; @@ -2792,7 +2796,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) //Object IMs send with from name: 'Second Life' need to be displayed also in notification toasts (EXT-1590) - if (SYSTEM_FROM != name) break; + if (!chat_from_system) break; LLSD substitutions; substitutions["NAME"] = name; -- cgit v1.2.3 From d9b915f09b4f9db0aa16d88dd4a7d5fb4980dc34 Mon Sep 17 00:00:00 2001 From: AlexanderP ProductEngine Date: Thu, 3 May 2012 19:40:45 +0300 Subject: MAINT-869 FIXED The object is marked as dead before it was removed from the selection. --- indra/newview/llviewermessage.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 18efeaf9e3..ce0e3067fb 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -4299,8 +4299,6 @@ void process_kill_object(LLMessageSystem *mesgsys, void **user_data) LL_DEBUGS("Messaging") << "Kill message for local " << local_id << LL_ENDL; } - LLSelectMgr::getInstance()->removeObjectFromSelections(id); - // ...don't kill the avatar if (!(id == gAgentID)) { @@ -4323,6 +4321,12 @@ void process_kill_object(LLMessageSystem *mesgsys, void **user_data) gObjectList.mNumUnknownKills++; } } + + // We should remove the object from selection after it is marked dead by gObjectList to make LLToolGrab, + // which is using the object, release the mouse capture correctly when the object dies. + // See LLToolGrab::handleHoverActive() and LLToolGrab::handleHoverNonPhysical(). + LLSelectMgr::getInstance()->removeObjectFromSelections(id); + } } -- cgit v1.2.3 From cbbbbcb6c31bca07b3453e622ab5905ea9e193b8 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Mon, 2 Apr 2012 20:36:52 +0300 Subject: MAINT-180 FIXED Reject group and ad-hoc chat messages from lindens when we are busy. --- indra/newview/llviewermessage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 3c6770df43..acddd3efe7 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -2682,7 +2682,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) case IM_SESSION_SEND: { - if (!is_linden && is_busy) + if (is_busy) { return; } -- 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/llviewermessage.cpp | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') 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/llviewermessage.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') 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 dd631786a6ec72714d7e9d8e2f6937598f73c39c Mon Sep 17 00:00:00 2001 From: "simon@Simon-PC.lindenlab.com" Date: Wed, 16 May 2012 17:06:21 -0700 Subject: MAINT-1079: Viewer should throttle AgentUpdate messages based on the simulator FPS. Bug not fixed, but added commented-out log messages that were useful when discovering the problem. Reviewed by Kelly --- indra/newview/llviewermessage.cpp | 37 ++++++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index ce0e3067fb..d72f6cfb59 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -4066,6 +4066,8 @@ void send_agent_update(BOOL force_send, BOOL send_reliable) head_rot_chg = dot(last_head_rot, head_rotation); + //static S32 msg_number = 0; // Used for diagnostic log messages + if (force_send || (cam_center_chg.magVec() > TRANSLATE_THRESHOLD) || (head_rot_chg < THRESHOLD_HEAD_ROT_QDOT) || @@ -4074,19 +4076,20 @@ void send_agent_update(BOOL force_send, BOOL send_reliable) control_flag_change != 0 || flag_change != 0) { -/* + /* Diagnotics to show why we send the AgentUpdate message. Also un-commment the msg_number code above and below this block + msg_number += 1; if (head_rot_chg < THRESHOLD_HEAD_ROT_QDOT) { - //LL_INFOS("Messaging") << "head rot " << head_rotation << LL_ENDL; - LL_INFOS("Messaging") << "head_rot_chg = " << head_rot_chg << LL_ENDL; + //LL_INFOS("Messaging") << " head rot " << head_rotation << LL_ENDL; + LL_INFOS("Messaging") << "msg " << msg_number << ", frame " << LLFrameTimer::getFrameCount() << ", head_rot_chg " << head_rot_chg << LL_ENDL; } if (cam_rot_chg.magVec() > ROTATION_THRESHOLD) { - LL_INFOS("Messaging") << "cam rot " << cam_rot_chg.magVec() << LL_ENDL; + LL_INFOS("Messaging") << "msg " << msg_number << ", frame " << LLFrameTimer::getFrameCount() << ", cam rot " << cam_rot_chg.magVec() << LL_ENDL; } if (cam_center_chg.magVec() > TRANSLATE_THRESHOLD) { - LL_INFOS("Messaging") << "cam center " << cam_center_chg.magVec() << LL_ENDL; + LL_INFOS("Messaging") << "msg " << msg_number << ", frame " << LLFrameTimer::getFrameCount() << ", cam center " << cam_center_chg.magVec() << LL_ENDL; } // if (drag_delta_chg.magVec() > TRANSLATE_THRESHOLD) // { @@ -4094,9 +4097,9 @@ void send_agent_update(BOOL force_send, BOOL send_reliable) // } if (control_flag_change) { - LL_INFOS("Messaging") << "dcf = " << control_flag_change << LL_ENDL; + LL_INFOS("Messaging") << "msg " << msg_number << ", frame " << LLFrameTimer::getFrameCount() << ", dcf = " << control_flag_change << LL_ENDL; } -*/ + */ duplicate_count = 0; } @@ -4131,6 +4134,26 @@ void send_agent_update(BOOL force_send, BOOL send_reliable) if (duplicate_count < DUP_MSGS && !gDisconnected) { + /* More diagnostics to count AgentUpdate messages + static S32 update_sec = 0; + static S32 update_count = 0; + static S32 max_update_count = 0; + S32 cur_sec = lltrunc( LLTimer::getTotalSeconds() ); + update_count += 1; + if (cur_sec != update_sec) + { + if (update_sec != 0) + { + update_sec = cur_sec; + //msg_number = 0; + max_update_count = llmax(max_update_count, update_count); + llinfos << "Sent " << update_count << " AgentUpdate messages per second, max is " << max_update_count << llendl; + } + update_sec = cur_sec; + update_count = 0; + } + */ + LLFastTimer t(FTM_AGENT_UPDATE_SEND); // Build the message msg->newMessageFast(_PREHASH_AgentUpdate); -- cgit v1.2.3 From 8f930cf296230306ae59574945106d7fd67826a1 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Thu, 17 May 2012 11:38:39 -0700 Subject: EXP-1928: Adding functionality to show either a modal notification dialog or the toast-style notification if a teleport fails due to maturity preferences. --- indra/newview/llviewermessage.cpp | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 56522bc819..d88a6f1a9b 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5424,36 +5424,42 @@ bool handle_special_notification(std::string notificationID, LLSD& llsdBlock) int regionAccess = llsdBlock["_region_access"].asInteger(); llsdBlock["REGIONMATURITY"] = LLViewerRegion::accessToString(regionAccess); - // we're going to throw the LLSD in there in case anyone ever wants to use it - LLNotificationsUtil::add(notificationID+"_Notify", llsdBlock); - + bool returnValue = false; + LLNotificationPtr maturityLevelNotification; if (regionAccess == SIM_ACCESS_MATURE) { if (gAgent.isTeen()) { - LLNotificationsUtil::add(notificationID+"_KB", llsdBlock); - return true; + maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_KB", llsdBlock); + returnValue = true; } else if (gAgent.prefersPG()) { - LLNotificationsUtil::add(notificationID+"_Change", llsdBlock, llsdBlock, handle_special_notification_callback); - return true; + maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_Change", llsdBlock, llsdBlock, handle_special_notification_callback); + returnValue = true; } } else if (regionAccess == SIM_ACCESS_ADULT) { if (!gAgent.isAdult()) { - LLNotificationsUtil::add(notificationID+"_KB", llsdBlock); - return true; + maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_KB", llsdBlock); + returnValue = true; } else if (gAgent.prefersPG() || gAgent.prefersMature()) { - LLNotificationsUtil::add(notificationID+"_Change", llsdBlock, llsdBlock, handle_special_notification_callback); - return true; + maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_Change", llsdBlock, llsdBlock, handle_special_notification_callback); + returnValue = true; } } - return false; + + if ((maturityLevelNotification == NULL) || maturityLevelNotification->isIgnored()) + { + // Given a simple notification if no maturityLevelNotification is set or it is ignore + LLNotificationsUtil::add(notificationID+"_Notify", llsdBlock); + } + + return returnValue; } bool attempt_standard_notification(LLMessageSystem* msgsystem) -- 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/llviewermessage.cpp | 102 +++++++++++++++++++++++++++++++++++--- 1 file changed, 94 insertions(+), 8 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index d88a6f1a9b..84de54986f 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -42,6 +42,7 @@ #include "llinventorydefines.h" #include "lllslconstants.h" #include "llregionhandle.h" +#include "llsd.h" #include "llsdserialize.h" #include "llteleportflags.h" #include "lltransactionflags.h" @@ -107,6 +108,7 @@ #include "llagentui.h" #include "llpanelblockedlist.h" #include "llpanelplaceprofile.h" +#include "llviewerregion.h" #include // #include @@ -5385,18 +5387,102 @@ static void process_money_balance_reply_extended(LLMessageSystem* msg) } } -void handle_maturity_preference_change(const LLSD &pResponse, int pMaturityRatingChange) +void handle_maturity_preference_change(const LLSD &pResponse, U8 pMaturityRatingChange) { - if (pResponse.isUndefined()) + bool isMaturityPreferenceElevated = false; + U8 actualPrefValue = SIM_ACCESS_MIN; + + llassert(!pResponse.isUndefined()); + llassert(pResponse.isMap()); + llassert(pResponse.has("access_prefs")); + llassert(pResponse.get("access_prefs").isMap()); + llassert(pResponse.get("access_prefs").has("max")); + llassert(pResponse.get("access_prefs").get("max").isString()); + + if (!pResponse.isUndefined() && pResponse.isMap() && pResponse.has("access_prefs") && + pResponse.get("access_prefs").isMap() && pResponse.get("access_prefs").has("max") && + pResponse.get("access_prefs").get("max").isString()) { - // XXX stinson 05/15/2012 : should report some notification that the preference has not changed - gAgent.clearFailedTeleportRequest(); + LLSD::String actualPreference = pResponse.get("access_prefs").get("max").asString(); + LLStringUtil::trim(actualPreference); + actualPrefValue = LLViewerRegion::shortStringToAccess(actualPreference); } - else + + switch (actualPrefValue) + { + case SIM_ACCESS_MIN : + switch (pMaturityRatingChange) + { + case SIM_ACCESS_MIN : + isMaturityPreferenceElevated = true; + break; + case SIM_ACCESS_PG : + case SIM_ACCESS_MATURE : + case SIM_ACCESS_ADULT : + default : + isMaturityPreferenceElevated = false; + break; + } + break; + case SIM_ACCESS_PG : + switch (pMaturityRatingChange) + { + case SIM_ACCESS_MIN : + case SIM_ACCESS_PG : + isMaturityPreferenceElevated = true; + break; + case SIM_ACCESS_MATURE : + case SIM_ACCESS_ADULT : + default : + isMaturityPreferenceElevated = false; + break; + } + break; + case SIM_ACCESS_MATURE : + switch (pMaturityRatingChange) + { + case SIM_ACCESS_MIN : + case SIM_ACCESS_PG : + case SIM_ACCESS_MATURE : + isMaturityPreferenceElevated = true; + break; + case SIM_ACCESS_ADULT : + default : + isMaturityPreferenceElevated = false; + break; + } + break; + case SIM_ACCESS_ADULT : + switch (pMaturityRatingChange) + { + case SIM_ACCESS_MIN : + case SIM_ACCESS_PG : + case SIM_ACCESS_MATURE : + case SIM_ACCESS_ADULT : + isMaturityPreferenceElevated = true; + break; + default : + isMaturityPreferenceElevated = false; + break; + } + break; + default : + isMaturityPreferenceElevated = false; + break; + } + + if (isMaturityPreferenceElevated) { gAgent.setMaturityRatingChangeDuringTeleport(pMaturityRatingChange); gAgent.restartFailedTeleportRequest(); } + else + { + LLSD args; + args["RATING"] = LLViewerRegion::accessToString(pMaturityRatingChange); + LLNotificationsUtil::add("MaturityCouldNotBeChanged", args); + gAgent.clearFailedTeleportRequest(); + } } bool handle_special_notification_callback(const LLSD& notification, const LLSD& response) @@ -5406,8 +5492,8 @@ bool handle_special_notification_callback(const LLSD& notification, const LLSD& if (0 == option) { // set the preference to the maturity of the region we're calling - int preferredMaturity = notification["payload"]["_region_access"].asInteger(); - gSavedSettings.setU32("PreferredMaturity", preferredMaturity); + U8 preferredMaturity = static_cast(notification["payload"]["_region_access"].asInteger()); + gSavedSettings.setU32("PreferredMaturity", static_cast(preferredMaturity)); gAgent.sendMaturityPreferenceToServer(preferredMaturity, boost::bind(&handle_maturity_preference_change, _1, preferredMaturity)); } else @@ -5421,7 +5507,7 @@ bool handle_special_notification_callback(const LLSD& notification, const LLSD& // some of the server notifications need special handling. This is where we do that. bool handle_special_notification(std::string notificationID, LLSD& llsdBlock) { - int regionAccess = llsdBlock["_region_access"].asInteger(); + U8 regionAccess = static_cast(llsdBlock["_region_access"].asInteger()); llsdBlock["REGIONMATURITY"] = LLViewerRegion::accessToString(regionAccess); bool returnValue = false; -- 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/llviewermessage.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 84de54986f..a2054c1244 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5508,7 +5508,9 @@ bool handle_special_notification_callback(const LLSD& notification, const LLSD& bool handle_special_notification(std::string notificationID, LLSD& llsdBlock) { U8 regionAccess = static_cast(llsdBlock["_region_access"].asInteger()); - llsdBlock["REGIONMATURITY"] = LLViewerRegion::accessToString(regionAccess); + std::string regionMaturity = LLViewerRegion::accessToString(regionAccess); + LLStringUtil::toLower(regionMaturity); + llsdBlock["REGIONMATURITY"] = regionMaturity; bool returnValue = false; LLNotificationPtr maturityLevelNotification; -- 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/llviewermessage.cpp | 45 +++++++++++++++++++++++++++++++++------ 1 file changed, 38 insertions(+), 7 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index a2054c1244..f84ada18ab 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5387,7 +5387,7 @@ static void process_money_balance_reply_extended(LLMessageSystem* msg) } } -void handle_maturity_preference_change(const LLSD &pResponse, U8 pMaturityRatingChange) +void handle_maturity_preference_change_and_reteleport(const LLSD &pResponse, U8 pMaturityRatingChange) { bool isMaturityPreferenceElevated = false; U8 actualPrefValue = SIM_ACCESS_MIN; @@ -5485,7 +5485,7 @@ void handle_maturity_preference_change(const LLSD &pResponse, U8 pMaturityRating } } -bool handle_special_notification_callback(const LLSD& notification, const LLSD& response) +bool handle_prompt_for_maturity_level_change_callback(const LLSD& notification, const LLSD& response) { S32 option = LLNotificationsUtil::getSelectedOption(notification, response); @@ -5494,7 +5494,22 @@ bool handle_special_notification_callback(const LLSD& notification, const LLSD& // set the preference to the maturity of the region we're calling U8 preferredMaturity = static_cast(notification["payload"]["_region_access"].asInteger()); gSavedSettings.setU32("PreferredMaturity", static_cast(preferredMaturity)); - gAgent.sendMaturityPreferenceToServer(preferredMaturity, boost::bind(&handle_maturity_preference_change, _1, preferredMaturity)); + gAgent.sendMaturityPreferenceToServer(preferredMaturity); + } + + return false; +} + +bool handle_prompt_for_maturity_level_change_and_reteleport_callback(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + + if (0 == option) + { + // set the preference to the maturity of the region we're calling + U8 preferredMaturity = static_cast(notification["payload"]["_region_access"].asInteger()); + gSavedSettings.setU32("PreferredMaturity", static_cast(preferredMaturity)); + gAgent.sendMaturityPreferenceToServer(preferredMaturity, boost::bind(&handle_maturity_preference_change_and_reteleport, _1, preferredMaturity)); } else { @@ -5523,8 +5538,16 @@ bool handle_special_notification(std::string notificationID, LLSD& llsdBlock) } else if (gAgent.prefersPG()) { - maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_Change", llsdBlock, llsdBlock, handle_special_notification_callback); - returnValue = true; + if (gAgent.hasRestartableFailedTeleportRequest()) + { + maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_ChangeAndReTeleport", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_and_reteleport_callback); + returnValue = true; + } + else + { + maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_ChangeOnly", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback); + returnValue = true; + } } } else if (regionAccess == SIM_ACCESS_ADULT) @@ -5536,8 +5559,16 @@ bool handle_special_notification(std::string notificationID, LLSD& llsdBlock) } else if (gAgent.prefersPG() || gAgent.prefersMature()) { - maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_Change", llsdBlock, llsdBlock, handle_special_notification_callback); - returnValue = true; + if (gAgent.hasRestartableFailedTeleportRequest()) + { + maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_ChangeAndReTeleport", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_and_reteleport_callback); + returnValue = true; + } + else + { + maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_ChangeOnly", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback); + returnValue = true; + } } } -- cgit v1.2.3 From ffdd6812ca7ee0d497766aff04c91b30d1bbc63d Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Thu, 17 May 2012 18:01:42 -0700 Subject: EPX-1938: Adding a special behavior for the NotAgeVerified notification to display either an ignorable modal dialog or a toast-style notification. Also, altering the copy for the notifications. --- indra/newview/llviewermessage.cpp | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index f84ada18ab..bb48391fe0 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5683,6 +5683,30 @@ void process_alert_message(LLMessageSystem *msgsystem, void **user_data) } } +bool handle_not_age_verified_alert(const std::string &pAlertName) +{ + LLNotificationPtr notification = LLNotificationsUtil::add(pAlertName); + if ((notification == NULL) || notification->isIgnored()) + { + LLNotificationsUtil::add(pAlertName + "_Notify"); + } + + return true; +} + +bool handle_special_alerts(const std::string &pAlertName) +{ + bool isHandled = false; + + if (LLStringUtil::compareStrings(pAlertName, "NotAgeVerified") == 0) + { + + isHandled = handle_not_age_verified_alert(pAlertName); + } + + return isHandled; +} + void process_alert_core(const std::string& message, BOOL modal) { // HACK -- handle callbacks for specific alerts. It also is localized in notifications.xml @@ -5706,7 +5730,10 @@ void process_alert_core(const std::string& message, BOOL modal) // Allow the server to spawn a named alert so that server alerts can be // translated out of English. std::string alert_name(message.substr(ALERT_PREFIX.length())); - LLNotificationsUtil::add(alert_name); + if (!handle_special_alerts(alert_name)) + { + LLNotificationsUtil::add(alert_name); + } } else if (message.find(NOTIFY_PREFIX) == 0) { -- 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/llviewermessage.cpp | 37 +++++++++---------------------------- 1 file changed, 9 insertions(+), 28 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index bb48391fe0..3c2949d9ee 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5387,31 +5387,14 @@ static void process_money_balance_reply_extended(LLMessageSystem* msg) } } -void handle_maturity_preference_change_and_reteleport(const LLSD &pResponse, U8 pMaturityRatingChange) +void handle_maturity_preference_change_and_reteleport(U8 pActualMaturityRating, U8 pRequestedMaturityRating) { bool isMaturityPreferenceElevated = false; - U8 actualPrefValue = SIM_ACCESS_MIN; - llassert(!pResponse.isUndefined()); - llassert(pResponse.isMap()); - llassert(pResponse.has("access_prefs")); - llassert(pResponse.get("access_prefs").isMap()); - llassert(pResponse.get("access_prefs").has("max")); - llassert(pResponse.get("access_prefs").get("max").isString()); - - if (!pResponse.isUndefined() && pResponse.isMap() && pResponse.has("access_prefs") && - pResponse.get("access_prefs").isMap() && pResponse.get("access_prefs").has("max") && - pResponse.get("access_prefs").get("max").isString()) - { - LLSD::String actualPreference = pResponse.get("access_prefs").get("max").asString(); - LLStringUtil::trim(actualPreference); - actualPrefValue = LLViewerRegion::shortStringToAccess(actualPreference); - } - - switch (actualPrefValue) + switch (pActualMaturityRating) { case SIM_ACCESS_MIN : - switch (pMaturityRatingChange) + switch (pRequestedMaturityRating) { case SIM_ACCESS_MIN : isMaturityPreferenceElevated = true; @@ -5425,7 +5408,7 @@ void handle_maturity_preference_change_and_reteleport(const LLSD &pResponse, U8 } break; case SIM_ACCESS_PG : - switch (pMaturityRatingChange) + switch (pRequestedMaturityRating) { case SIM_ACCESS_MIN : case SIM_ACCESS_PG : @@ -5439,7 +5422,7 @@ void handle_maturity_preference_change_and_reteleport(const LLSD &pResponse, U8 } break; case SIM_ACCESS_MATURE : - switch (pMaturityRatingChange) + switch (pRequestedMaturityRating) { case SIM_ACCESS_MIN : case SIM_ACCESS_PG : @@ -5453,7 +5436,7 @@ void handle_maturity_preference_change_and_reteleport(const LLSD &pResponse, U8 } break; case SIM_ACCESS_ADULT : - switch (pMaturityRatingChange) + switch (pRequestedMaturityRating) { case SIM_ACCESS_MIN : case SIM_ACCESS_PG : @@ -5473,13 +5456,13 @@ void handle_maturity_preference_change_and_reteleport(const LLSD &pResponse, U8 if (isMaturityPreferenceElevated) { - gAgent.setMaturityRatingChangeDuringTeleport(pMaturityRatingChange); + gAgent.setMaturityRatingChangeDuringTeleport(pActualMaturityRating); gAgent.restartFailedTeleportRequest(); } else { LLSD args; - args["RATING"] = LLViewerRegion::accessToString(pMaturityRatingChange); + args["RATING"] = LLViewerRegion::accessToString(pRequestedMaturityRating); LLNotificationsUtil::add("MaturityCouldNotBeChanged", args); gAgent.clearFailedTeleportRequest(); } @@ -5494,7 +5477,6 @@ bool handle_prompt_for_maturity_level_change_callback(const LLSD& notification, // set the preference to the maturity of the region we're calling U8 preferredMaturity = static_cast(notification["payload"]["_region_access"].asInteger()); gSavedSettings.setU32("PreferredMaturity", static_cast(preferredMaturity)); - gAgent.sendMaturityPreferenceToServer(preferredMaturity); } return false; @@ -5508,8 +5490,7 @@ bool handle_prompt_for_maturity_level_change_and_reteleport_callback(const LLSD& { // set the preference to the maturity of the region we're calling U8 preferredMaturity = static_cast(notification["payload"]["_region_access"].asInteger()); - gSavedSettings.setU32("PreferredMaturity", static_cast(preferredMaturity)); - gAgent.sendMaturityPreferenceToServer(preferredMaturity, boost::bind(&handle_maturity_preference_change_and_reteleport, _1, preferredMaturity)); + gAgent.setMaturityPreferenceAndConfirm(static_cast(preferredMaturity), boost::bind(&handle_maturity_preference_change_and_reteleport, _1, preferredMaturity)); } else { -- cgit v1.2.3 From d9cf4691a7369004a1ceeb11ca8d3262648c05e7 Mon Sep 17 00:00:00 2001 From: Paul ProductEngine Date: Fri, 18 May 2012 21:01:10 +0300 Subject: MAINT-938 ADDITIONAL FIX (Make debit-permissions dialog give a stronger warning) - Requested permissions are added dynamically to the dialog's footer - And the footer is not shown when it is empty --- indra/newview/llviewermessage.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 2917fee62e..7d6370676e 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5972,16 +5972,21 @@ void process_script_question(LLMessageSystem *msg, void **user_data) args["OBJECTNAME"] = object_name; args["NAME"] = LLCacheName::cleanFullName(owner_name); + BOOL has_not_only_debit = questions ^ LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_DEBIT]; // check the received permission flags against each permission for (S32 i = 0; i < SCRIPT_PERMISSION_EOF; i++) { if (questions & LSCRIPTRunTimePermissionBits[i]) { count++; - script_question += " " + LLTrans::getString(SCRIPT_QUESTIONS[i]) + "\n"; // check whether permission question should cause special caution dialog caution |= (SCRIPT_QUESTION_IS_CAUTION[i]); + + if (("ScriptTakeMoney" == SCRIPT_QUESTIONS[i]) && has_not_only_debit) + continue; + + script_question += " " + LLTrans::getString(SCRIPT_QUESTIONS[i]) + "\n"; } } args["QUESTIONS"] = script_question; @@ -5997,6 +6002,10 @@ void process_script_question(LLMessageSystem *msg, void **user_data) // check whether cautions are even enabled or not if (gSavedSettings.getBOOL("PermissionsCautionEnabled")) { + if (caution) + { + args["FOOTERTEXT"] = (count > 1) ? LLTrans::getString("AdditionalPermissionsRequestHeader") + "\n\n" + script_question : ""; + } // display the caution permissions prompt LLNotificationsUtil::add(caution ? "ScriptQuestionCaution" : "ScriptQuestion", args, payload); } -- cgit v1.2.3 From 2720449daa4b07188fd9a2f24246817f963c6d5c Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Mon, 21 May 2012 12:26:45 -0700 Subject: EXP-1928: Restoring the flow for non-teleport-failure messages through the special notification handler. --- indra/newview/llviewermessage.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 3c2949d9ee..be3357041a 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5514,19 +5514,22 @@ bool handle_special_notification(std::string notificationID, LLSD& llsdBlock) { if (gAgent.isTeen()) { + gAgent.clearFailedTeleportRequest(); maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_KB", llsdBlock); returnValue = true; } else if (gAgent.prefersPG()) { - if (gAgent.hasRestartableFailedTeleportRequest()) + if ((LLStringUtil::compareStrings(notificationID, "RegionEntryAccessBlocked") == 0) && + gAgent.hasRestartableFailedTeleportRequest()) { maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_ChangeAndReTeleport", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_and_reteleport_callback); returnValue = true; } else { - maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_ChangeOnly", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback); + gAgent.clearFailedTeleportRequest(); + maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_Change", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback); returnValue = true; } } @@ -5535,19 +5538,22 @@ bool handle_special_notification(std::string notificationID, LLSD& llsdBlock) { if (!gAgent.isAdult()) { + gAgent.clearFailedTeleportRequest(); maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_KB", llsdBlock); returnValue = true; } else if (gAgent.prefersPG() || gAgent.prefersMature()) { - if (gAgent.hasRestartableFailedTeleportRequest()) + if ((LLStringUtil::compareStrings(notificationID, "RegionEntryAccessBlocked") == 0) && + gAgent.hasRestartableFailedTeleportRequest()) { maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_ChangeAndReTeleport", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_and_reteleport_callback); returnValue = true; } else { - maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_ChangeOnly", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback); + gAgent.clearFailedTeleportRequest(); + maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_Change", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback); returnValue = true; } } -- cgit v1.2.3 From 49b48ed0b98efa1c006ebab51d729b74326ebc9b Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Tue, 22 May 2012 17:49:56 -0700 Subject: EXP1-1945: Adding in a flow to catch other cases of teleportation failures due to maturity levels and bad network access. Still need better copy for the error message. --- indra/newview/llviewermessage.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index be3357041a..c68e86d7e9 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5533,6 +5533,12 @@ bool handle_special_notification(std::string notificationID, LLSD& llsdBlock) returnValue = true; } } + else if (LLStringUtil::compareStrings(notificationID, "RegionEntryAccessBlocked") == 0) + { + gAgent.clearFailedTeleportRequest(); + maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_PreferencesOutOfSync", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback); + returnValue = true; + } } else if (regionAccess == SIM_ACCESS_ADULT) { @@ -5557,6 +5563,12 @@ bool handle_special_notification(std::string notificationID, LLSD& llsdBlock) returnValue = true; } } + else if (LLStringUtil::compareStrings(notificationID, "RegionEntryAccessBlocked") == 0) + { + gAgent.clearFailedTeleportRequest(); + maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_PreferencesOutOfSync", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback); + returnValue = true; + } } if ((maturityLevelNotification == NULL) || maturityLevelNotification->isIgnored()) -- cgit v1.2.3 From b83647fb0c3ce721e24b7773bfa557d9fbbaab14 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Wed, 23 May 2012 15:52:48 -0700 Subject: EXP-1947: Altering notification toasts in the case of a teen user. --- indra/newview/llviewermessage.cpp | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index c68e86d7e9..91f0ad86bc 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5510,13 +5510,16 @@ bool handle_special_notification(std::string notificationID, LLSD& llsdBlock) bool returnValue = false; LLNotificationPtr maturityLevelNotification; + std::string notifySuffix = "_Notify"; if (regionAccess == SIM_ACCESS_MATURE) { if (gAgent.isTeen()) { gAgent.clearFailedTeleportRequest(); - maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_KB", llsdBlock); + maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_AdultsOnlyContent", llsdBlock); returnValue = true; + + notifySuffix = "_NotifyAdultsOnly"; } else if (gAgent.prefersPG()) { @@ -5545,8 +5548,10 @@ bool handle_special_notification(std::string notificationID, LLSD& llsdBlock) if (!gAgent.isAdult()) { gAgent.clearFailedTeleportRequest(); - maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_KB", llsdBlock); + maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_AdultsOnlyContent", llsdBlock); returnValue = true; + + notifySuffix = "_NotifyAdultsOnly"; } else if (gAgent.prefersPG() || gAgent.prefersMature()) { @@ -5574,7 +5579,7 @@ bool handle_special_notification(std::string notificationID, LLSD& llsdBlock) if ((maturityLevelNotification == NULL) || maturityLevelNotification->isIgnored()) { // Given a simple notification if no maturityLevelNotification is set or it is ignore - LLNotificationsUtil::add(notificationID+"_Notify", llsdBlock); + LLNotificationsUtil::add(notificationID + notifySuffix, llsdBlock); } return returnValue; @@ -5621,16 +5626,20 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem) RegionEntryAccessBlocked RegionEntryAccessBlocked_Notify + RegionEntryAccessBlocked_NotifyAdultsOnly RegionEntryAccessBlocked_Change - RegionEntryAccessBlocked_KB + RegionEntryAccessBlocked_AdultsOnlyContent + RegionEntryAccessBlocked_ChangeAndReTeleport LandClaimAccessBlocked LandClaimAccessBlocked_Notify + LandClaimAccessBlocked_NotifyAdultsOnly LandClaimAccessBlocked_Change - LandClaimAccessBlocked_KB + LandClaimAccessBlocked_AdultsOnlyContent LandBuyAccessBlocked LandBuyAccessBlocked_Notify + LandBuyAccessBlocked_NotifyAdultsOnly LandBuyAccessBlocked_Change - LandBuyAccessBlocked_KB + LandBuyAccessBlocked_AdultsOnlyContent -----------------------------------------------------------------------*/ if (handle_special_notification(notificationID, llsdBlock)) -- 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/llviewermessage.cpp | 99 ++++----------------------------------- 1 file changed, 10 insertions(+), 89 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 932735971e..74cd635a75 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5391,87 +5391,6 @@ static void process_money_balance_reply_extended(LLMessageSystem* msg) } } -void handle_maturity_preference_change_and_reteleport(U8 pActualMaturityRating, U8 pRequestedMaturityRating) -{ - bool isMaturityPreferenceElevated = false; - - switch (pActualMaturityRating) - { - case SIM_ACCESS_MIN : - switch (pRequestedMaturityRating) - { - case SIM_ACCESS_MIN : - isMaturityPreferenceElevated = true; - break; - case SIM_ACCESS_PG : - case SIM_ACCESS_MATURE : - case SIM_ACCESS_ADULT : - default : - isMaturityPreferenceElevated = false; - break; - } - break; - case SIM_ACCESS_PG : - switch (pRequestedMaturityRating) - { - case SIM_ACCESS_MIN : - case SIM_ACCESS_PG : - isMaturityPreferenceElevated = true; - break; - case SIM_ACCESS_MATURE : - case SIM_ACCESS_ADULT : - default : - isMaturityPreferenceElevated = false; - break; - } - break; - case SIM_ACCESS_MATURE : - switch (pRequestedMaturityRating) - { - case SIM_ACCESS_MIN : - case SIM_ACCESS_PG : - case SIM_ACCESS_MATURE : - isMaturityPreferenceElevated = true; - break; - case SIM_ACCESS_ADULT : - default : - isMaturityPreferenceElevated = false; - break; - } - break; - case SIM_ACCESS_ADULT : - switch (pRequestedMaturityRating) - { - case SIM_ACCESS_MIN : - case SIM_ACCESS_PG : - case SIM_ACCESS_MATURE : - case SIM_ACCESS_ADULT : - isMaturityPreferenceElevated = true; - break; - default : - isMaturityPreferenceElevated = false; - break; - } - break; - default : - isMaturityPreferenceElevated = false; - break; - } - - if (isMaturityPreferenceElevated) - { - gAgent.setMaturityRatingChangeDuringTeleport(pActualMaturityRating); - gAgent.restartFailedTeleportRequest(); - } - else - { - LLSD args; - args["RATING"] = LLViewerRegion::accessToString(pRequestedMaturityRating); - LLNotificationsUtil::add("MaturityCouldNotBeChanged", args); - gAgent.clearFailedTeleportRequest(); - } -} - bool handle_prompt_for_maturity_level_change_callback(const LLSD& notification, const LLSD& response) { S32 option = LLNotificationsUtil::getSelectedOption(notification, response); @@ -5494,11 +5413,13 @@ bool handle_prompt_for_maturity_level_change_and_reteleport_callback(const LLSD& { // set the preference to the maturity of the region we're calling U8 preferredMaturity = static_cast(notification["payload"]["_region_access"].asInteger()); - gAgent.setMaturityPreferenceAndConfirm(static_cast(preferredMaturity), boost::bind(&handle_maturity_preference_change_and_reteleport, _1, preferredMaturity)); + gSavedSettings.setU32("PreferredMaturity", static_cast(preferredMaturity)); + gAgent.setMaturityRatingChangeDuringTeleport(preferredMaturity); + gAgent.restartFailedTeleportRequest(); } else { - gAgent.clearFailedTeleportRequest(); + gAgent.clearTeleportRequest(); } return false; @@ -5519,7 +5440,7 @@ bool handle_special_notification(std::string notificationID, LLSD& llsdBlock) { if (gAgent.isTeen()) { - gAgent.clearFailedTeleportRequest(); + gAgent.clearTeleportRequest(); maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_AdultsOnlyContent", llsdBlock); returnValue = true; @@ -5535,14 +5456,14 @@ bool handle_special_notification(std::string notificationID, LLSD& llsdBlock) } else { - gAgent.clearFailedTeleportRequest(); + gAgent.clearTeleportRequest(); maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_Change", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback); returnValue = true; } } else if (LLStringUtil::compareStrings(notificationID, "RegionEntryAccessBlocked") == 0) { - gAgent.clearFailedTeleportRequest(); + gAgent.clearTeleportRequest(); maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_PreferencesOutOfSync", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback); returnValue = true; } @@ -5551,7 +5472,7 @@ bool handle_special_notification(std::string notificationID, LLSD& llsdBlock) { if (!gAgent.isAdult()) { - gAgent.clearFailedTeleportRequest(); + gAgent.clearTeleportRequest(); maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_AdultsOnlyContent", llsdBlock); returnValue = true; @@ -5567,14 +5488,14 @@ bool handle_special_notification(std::string notificationID, LLSD& llsdBlock) } else { - gAgent.clearFailedTeleportRequest(); + gAgent.clearTeleportRequest(); maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_Change", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback); returnValue = true; } } else if (LLStringUtil::compareStrings(notificationID, "RegionEntryAccessBlocked") == 0) { - gAgent.clearFailedTeleportRequest(); + gAgent.clearTeleportRequest(); maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_PreferencesOutOfSync", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback); returnValue = true; } -- cgit v1.2.3 From 8f4848ca2ea02bb60caaf9fd08c9f55075dbcd9a Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Tue, 29 May 2012 19:10:13 -0700 Subject: EXP-1950: Breaking out the dialogs into 2 paths so that teleports can report messages with slightly different wordings. --- indra/newview/llviewermessage.cpp | 76 +++++++++++++++++++++++++++++++++++---- 1 file changed, 69 insertions(+), 7 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 74cd635a75..4a0de81eb1 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5448,8 +5448,71 @@ bool handle_special_notification(std::string notificationID, LLSD& llsdBlock) } else if (gAgent.prefersPG()) { - if ((LLStringUtil::compareStrings(notificationID, "RegionEntryAccessBlocked") == 0) && - gAgent.hasRestartableFailedTeleportRequest()) + maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_Change", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback); + returnValue = true; + } + else if (LLStringUtil::compareStrings(notificationID, "RegionEntryAccessBlocked") == 0) + { + maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_PreferencesOutOfSync", llsdBlock, llsdBlock); + returnValue = true; + } + } + else if (regionAccess == SIM_ACCESS_ADULT) + { + if (!gAgent.isAdult()) + { + gAgent.clearTeleportRequest(); + maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_AdultsOnlyContent", llsdBlock); + returnValue = true; + + notifySuffix = "_NotifyAdultsOnly"; + } + else if (gAgent.prefersPG() || gAgent.prefersMature()) + { + maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_Change", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback); + returnValue = true; + } + else if (LLStringUtil::compareStrings(notificationID, "RegionEntryAccessBlocked") == 0) + { + maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_PreferencesOutOfSync", llsdBlock, llsdBlock); + returnValue = true; + } + } + + if ((maturityLevelNotification == NULL) || maturityLevelNotification->isIgnored()) + { + // Given a simple notification if no maturityLevelNotification is set or it is ignore + LLNotificationsUtil::add(notificationID + notifySuffix, llsdBlock); + } + + return returnValue; +} + +// some of the server notifications need special handling. This is where we do that. +bool handle_teleport_access_blocked(LLSD& llsdBlock) +{ + std::string notificationID("TeleportEntryAccessBlocked"); + U8 regionAccess = static_cast(llsdBlock["_region_access"].asInteger()); + std::string regionMaturity = LLViewerRegion::accessToString(regionAccess); + LLStringUtil::toLower(regionMaturity); + llsdBlock["REGIONMATURITY"] = regionMaturity; + + bool returnValue = false; + LLNotificationPtr maturityLevelNotification; + std::string notifySuffix = "_Notify"; + if (regionAccess == SIM_ACCESS_MATURE) + { + if (gAgent.isTeen()) + { + gAgent.clearTeleportRequest(); + maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_AdultsOnlyContent", llsdBlock); + returnValue = true; + + notifySuffix = "_NotifyAdultsOnly"; + } + else if (gAgent.prefersPG()) + { + if (gAgent.hasRestartableFailedTeleportRequest()) { maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_ChangeAndReTeleport", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_and_reteleport_callback); returnValue = true; @@ -5461,7 +5524,7 @@ bool handle_special_notification(std::string notificationID, LLSD& llsdBlock) returnValue = true; } } - else if (LLStringUtil::compareStrings(notificationID, "RegionEntryAccessBlocked") == 0) + else { gAgent.clearTeleportRequest(); maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_PreferencesOutOfSync", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback); @@ -5480,8 +5543,7 @@ bool handle_special_notification(std::string notificationID, LLSD& llsdBlock) } else if (gAgent.prefersPG() || gAgent.prefersMature()) { - if ((LLStringUtil::compareStrings(notificationID, "RegionEntryAccessBlocked") == 0) && - gAgent.hasRestartableFailedTeleportRequest()) + if (gAgent.hasRestartableFailedTeleportRequest()) { maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_ChangeAndReTeleport", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_and_reteleport_callback); returnValue = true; @@ -5493,7 +5555,7 @@ bool handle_special_notification(std::string notificationID, LLSD& llsdBlock) returnValue = true; } } - else if (LLStringUtil::compareStrings(notificationID, "RegionEntryAccessBlocked") == 0) + else { gAgent.clearTeleportRequest(); maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_PreferencesOutOfSync", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback); @@ -6275,7 +6337,7 @@ void process_teleport_failed(LLMessageSystem *msg, void**) else { // change notification name in this special case - if (handle_special_notification("RegionEntryAccessBlocked", llsd_block)) + if (handle_teleport_access_blocked(llsd_block)) { if( gAgent.getTeleportState() != LLAgent::TELEPORT_NONE ) { -- cgit v1.2.3 From 29737cb9c00cc46059e3a77bce06d45e45fe4d9f Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Wed, 30 May 2012 17:07:17 -0400 Subject: STORM-1812 First pass at adding teleport started signal --- indra/newview/llviewermessage.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 3c6770df43..33ce8a79e1 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -3441,6 +3441,11 @@ void process_teleport_start(LLMessageSystem *msg, void**) } } +boost::signals2::connection LLViewerMessage::setTeleportStartedCallback(teleport_started_callback_t cb) +{ + return mTeleportStartedSignal.connect(cb); +} + void process_teleport_progress(LLMessageSystem* msg, void**) { LLUUID agent_id; -- cgit v1.2.3 From 8e6202ad53415695f0c0f40a366b4f329ff8b714 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Thu, 31 May 2012 06:20:12 -0400 Subject: STORM-1812 Added teleport started callback --- indra/newview/llviewermessage.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 33ce8a79e1..536d3d2056 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -3417,6 +3417,9 @@ void process_teleport_start(LLMessageSystem *msg, void**) LL_DEBUGS("Messaging") << "Got TeleportStart with TeleportFlags=" << teleport_flags << ". gTeleportDisplay: " << gTeleportDisplay << ", gAgent.mTeleportState: " << gAgent.getTeleportState() << LL_ENDL; + // *NOTE: The server sends two StartTeleport packets when you are teleporting to a LM + LLViewerMessage::getInstance()->mTeleportStartedSignal(); + if (teleport_flags & TELEPORT_FLAGS_DISABLE_CANCEL) { gViewerWindow->setProgressCancelButtonVisible(FALSE); @@ -3436,6 +3439,7 @@ void process_teleport_start(LLMessageSystem *msg, void**) make_ui_sound("UISndTeleportOut"); LL_INFOS("Messaging") << "Teleport initiated by remote TeleportStart message with TeleportFlags: " << teleport_flags << LL_ENDL; + // Don't call LLFirstUse::useTeleport here because this could be // due to being killed, which would send you home, not to a Telehub } -- cgit v1.2.3 From 68c3d1bb2ef19550d1549342b4bd597938c473b7 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Fri, 8 Jun 2012 18:28:19 -0700 Subject: EXP-1953: First pass at implementing the maturity flow during a teleport via lure. --- indra/newview/llviewermessage.cpp | 193 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 185 insertions(+), 8 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 4a0de81eb1..7891e98cff 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1994,6 +1994,46 @@ bool lure_callback(const LLSD& notification, const LLSD& response) } static LLNotificationFunctorRegistration lure_callback_reg("TeleportOffered", lure_callback); +bool mature_lure_callback(const LLSD& notification, const LLSD& response) +{ + S32 option = 0; + if (response.isInteger()) + { + option = response.asInteger(); + } + else + { + option = LLNotificationsUtil::getSelectedOption(notification, response); + } + + LLUUID from_id = notification["payload"]["from_id"].asUUID(); + LLUUID lure_id = notification["payload"]["lure_id"].asUUID(); + BOOL godlike = notification["payload"]["godlike"].asBoolean(); + U8 region_access = static_cast(notification["payload"]["region_maturity"].asInteger()); + + switch(option) + { + case 0: + { + // accept + gSavedSettings.setU32("PreferredMaturity", static_cast(region_access)); + gAgent.setMaturityRatingChangeDuringTeleport(region_access); + gAgent.teleportViaLure(lure_id, godlike); + } + break; + case 1: + default: + // decline + send_simple_im(from_id, + LLStringUtil::null, + IM_LURE_DECLINED, + lure_id); + break; + } + return false; +} +static LLNotificationFunctorRegistration mature_lure_callback_reg("TeleportOffered_MaturityExceeded", mature_lure_callback); + bool goto_url_callback(const LLSD& notification, const LLSD& response) { std::string url = notification["payload"]["url"].asString(); @@ -2881,15 +2921,54 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) { LLVector3 pos, look_at; U64 region_handle(0); - U8 region_access(0); + U8 region_access(SIM_ACCESS_MIN); std::string region_info = ll_safe_string((char*)binary_bucket, binary_bucket_size); std::string region_access_str = LLStringUtil::null; std::string region_access_icn = LLStringUtil::null; + std::string region_access_lc = LLStringUtil::null; + + bool canUserAccessDstRegion = true; + bool doesUserRequireMaturityIncrease = false; if (parse_lure_bucket(region_info, region_handle, pos, look_at, region_access)) { region_access_str = LLViewerRegion::accessToString(region_access); region_access_icn = LLViewerRegion::getAccessIcon(region_access); + region_access_lc = region_access_str; + LLStringUtil::toLower(region_access_lc); + + if (!gAgent.isGodlike()) + { + switch (region_access) + { + case SIM_ACCESS_MIN : + case SIM_ACCESS_PG : + break; + case SIM_ACCESS_MATURE : + if (gAgent.isTeen()) + { + canUserAccessDstRegion = false; + } + else if (gAgent.prefersPG()) + { + doesUserRequireMaturityIncrease = true; + } + break; + case SIM_ACCESS_ADULT : + if (!gAgent.isAdult()) + { + canUserAccessDstRegion = false; + } + else if (!gAgent.prefersAdult()) + { + doesUserRequireMaturityIncrease = true; + } + break; + default : + llassert(0); + break; + } + } } LLSD args; @@ -2898,28 +2977,126 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) args["MESSAGE"] = message; args["MATURITY_STR"] = region_access_str; args["MATURITY_ICON"] = region_access_icn; + args["REGION_CONTENT_MATURITY"] = region_access_lc; LLSD payload; payload["from_id"] = from_id; payload["lure_id"] = session_id; payload["godlike"] = FALSE; + payload["region_maturity"] = region_access; + + if (!canUserAccessDstRegion) + { + LLNotification::Params params("TeleportOffered_MaturityBlocked"); + params.substitutions = args; + params.payload = payload; + LLPostponedNotification::add( params, from_id, false); + } + else if (doesUserRequireMaturityIncrease) + { + LLNotification::Params params("TeleportOffered_MaturityExceeded"); + params.substitutions = args; + params.payload = payload; + LLPostponedNotification::add( params, from_id, false); + } + else + { + LLNotification::Params params("TeleportOffered"); + params.substitutions = args; + params.payload = payload; + LLPostponedNotification::add( params, from_id, false); + } - LLNotification::Params params("TeleportOffered"); - params.substitutions = args; - params.payload = payload; - LLPostponedNotification::add( params, from_id, false); } } break; case IM_GODLIKE_LURE_USER: { + LLVector3 pos, look_at; + U64 region_handle(0); + U8 region_access(SIM_ACCESS_MIN); + std::string region_info = ll_safe_string((char*)binary_bucket, binary_bucket_size); + std::string region_access_str = LLStringUtil::null; + std::string region_access_icn = LLStringUtil::null; + std::string region_access_lc = LLStringUtil::null; + + bool canUserAccessDstRegion = true; + bool doesUserRequireMaturityIncrease = false; + + if (parse_lure_bucket(region_info, region_handle, pos, look_at, region_access)) + { + region_access_str = LLViewerRegion::accessToString(region_access); + region_access_icn = LLViewerRegion::getAccessIcon(region_access); + region_access_lc = region_access_str; + LLStringUtil::toLower(region_access_lc); + + if (!gAgent.isGodlike()) + { + switch (region_access) + { + case SIM_ACCESS_MIN : + case SIM_ACCESS_PG : + break; + case SIM_ACCESS_MATURE : + if (gAgent.isTeen()) + { + canUserAccessDstRegion = false; + } + else if (gAgent.prefersPG()) + { + doesUserRequireMaturityIncrease = true; + } + break; + case SIM_ACCESS_ADULT : + if (!gAgent.isAdult()) + { + canUserAccessDstRegion = false; + } + else if (!gAgent.prefersAdult()) + { + doesUserRequireMaturityIncrease = true; + } + break; + default : + llassert(0); + break; + } + } + } + + LLSD args; + // *TODO: Translate -> [FIRST] [LAST] (maybe) + args["NAME_SLURL"] = LLSLURL("agent", from_id, "about").getSLURLString(); + args["MESSAGE"] = message; + args["MATURITY_STR"] = region_access_str; + args["MATURITY_ICON"] = region_access_icn; + args["REGION_CONTENT_MATURITY"] = region_access_lc; LLSD payload; payload["from_id"] = from_id; payload["lure_id"] = session_id; payload["godlike"] = TRUE; - // do not show a message box, because you're about to be - // teleported. - LLNotifications::instance().forceResponse(LLNotification::Params("TeleportOffered").payload(payload), 0); + payload["region_maturity"] = region_access; + + if (!canUserAccessDstRegion) + { + LLNotification::Params params("TeleportOffered_MaturityBlocked"); + params.substitutions = args; + params.payload = payload; + LLPostponedNotification::add( params, from_id, false); + } + else if (doesUserRequireMaturityIncrease) + { + LLNotification::Params params("TeleportOffered_MaturityExceeded"); + params.substitutions = args; + params.payload = payload; + LLPostponedNotification::add( params, from_id, false); + } + else + { + // do not show a message box, because you're about to be + // teleported. + LLNotifications::instance().forceResponse(LLNotification::Params("TeleportOffered").payload(payload), 0); + } } break; -- cgit v1.2.3 From 047ff479b7c87a80121c34c04137c113c7a02203 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Fri, 8 Jun 2012 19:05:33 -0700 Subject: EXP-1953: Sending an automated IM back to the user who offered the teleport lure informing the inviter that the guest cannot access the region because of their maturity level. --- indra/newview/llviewermessage.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 7891e98cff..be76b72891 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -2990,6 +2990,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) params.substitutions = args; params.payload = payload; LLPostponedNotification::add( params, from_id, false); + send_simple_im(from_id, LLTrans::getString("TeleportMaturityExceeded"), IM_NOTHING_SPECIAL, session_id); } else if (doesUserRequireMaturityIncrease) { @@ -3083,6 +3084,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) params.substitutions = args; params.payload = payload; LLPostponedNotification::add( params, from_id, false); + send_simple_im(from_id, LLTrans::getString("TeleportMaturityExceeded"), IM_NOTHING_SPECIAL, session_id); } else if (doesUserRequireMaturityIncrease) { -- cgit v1.2.3 From b73563f9fa84aa9372880c7d855ed0a8bac6ffb9 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Fri, 8 Jun 2012 19:13:26 -0700 Subject: EXP-1953: Ensuring to send the IM_LURE_DECLINED message back to the inviter. --- indra/newview/llviewermessage.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index be76b72891..3c7760eca7 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -2991,6 +2991,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) params.payload = payload; LLPostponedNotification::add( params, from_id, false); send_simple_im(from_id, LLTrans::getString("TeleportMaturityExceeded"), IM_NOTHING_SPECIAL, session_id); + send_simple_im(from_id, LLStringUtil::null, IM_LURE_DECLINED, session_id); } else if (doesUserRequireMaturityIncrease) { @@ -3085,6 +3086,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) params.payload = payload; LLPostponedNotification::add( params, from_id, false); send_simple_im(from_id, LLTrans::getString("TeleportMaturityExceeded"), IM_NOTHING_SPECIAL, session_id); + send_simple_im(from_id, LLStringUtil::null, IM_LURE_DECLINED, session_id); } else if (doesUserRequireMaturityIncrease) { -- cgit v1.2.3