summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermessage.cpp
diff options
context:
space:
mode:
authorTodd Stinson <stinson@lindenlab.com>2012-05-29 16:15:25 -0700
committerTodd Stinson <stinson@lindenlab.com>2012-05-29 16:15:25 -0700
commit8ff00d6ecfb733876126fb5a2ebae6fe20e38f6f (patch)
tree4d5370d7220f428d4bd62b333bfcef91d8b370f2 /indra/newview/llviewermessage.cpp
parentb8bc62a514786121ac34857c0e052040e603d4e4 (diff)
EXP-1942,EXP-1945: Ensuring that the teleport process waits for the maturity preferences to be synced between viewer and server.
Diffstat (limited to 'indra/newview/llviewermessage.cpp')
-rwxr-xr-xindra/newview/llviewermessage.cpp99
1 files changed, 10 insertions, 89 deletions
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<U8>(notification["payload"]["_region_access"].asInteger());
- gAgent.setMaturityPreferenceAndConfirm(static_cast<U32>(preferredMaturity), boost::bind(&handle_maturity_preference_change_and_reteleport, _1, preferredMaturity));
+ gSavedSettings.setU32("PreferredMaturity", static_cast<U32>(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;
}