diff options
author | simon <none@none> | 2014-07-16 16:00:06 -0400 |
---|---|---|
committer | simon <none@none> | 2014-07-16 16:00:06 -0400 |
commit | f4783697812428e3c0f4c5fba4ed91a6d19d8b34 (patch) | |
tree | 066d1750277e191e53ae8dc2365e83c62394f49e | |
parent | 2b731d5f062c4973df5eca82230491a77c3b191f (diff) |
GAMING-19: clarify messaging when refused region entry
-rwxr-xr-x | indra/newview/llviewermessage.cpp | 140 | ||||
-rwxr-xr-x | indra/newview/skins/default/xui/en/notifications.xml | 21 | ||||
-rwxr-xr-x | indra/newview/skins/default/xui/en/teleport_strings.xml | 5 |
3 files changed, 104 insertions, 62 deletions
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index be24c04dfc..e70bf87d0e 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5742,83 +5742,101 @@ bool handle_special_notification(std::string notificationID, LLSD& llsdBlock) } // some of the server notifications need special handling. This is where we do that. -bool handle_teleport_access_blocked(LLSD& llsdBlock) +bool handle_teleport_access_blocked(LLSD& llsdBlock, const std::string & notificationID, const std::string & defaultMessage) { - std::string notificationID("TeleportEntryAccessBlocked"); U8 regionAccess = static_cast<U8>(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; + LLNotificationPtr tp_failure_notification; + std::string notifySuffix; - notifySuffix = "_NotifyAdultsOnly"; - } - else if (gAgent.prefersPG()) + if (notificationID == std::string("TeleportEntryAccessBlocked")) + { + notifySuffix = "_Notify"; + if (regionAccess == SIM_ACCESS_MATURE) { - if (gAgent.hasRestartableFailedTeleportRequest()) + if (gAgent.isTeen()) { - maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_ChangeAndReTeleport", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_and_reteleport_callback); + gAgent.clearTeleportRequest(); + tp_failure_notification = LLNotificationsUtil::add(notificationID+"_AdultsOnlyContent", llsdBlock); returnValue = true; + + notifySuffix = "_NotifyAdultsOnly"; + } + else if (gAgent.prefersPG()) + { + if (gAgent.hasRestartableFailedTeleportRequest()) + { + tp_failure_notification = LLNotificationsUtil::add(notificationID+"_ChangeAndReTeleport", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_and_reteleport_callback); + returnValue = true; + } + else + { + gAgent.clearTeleportRequest(); + tp_failure_notification = LLNotificationsUtil::add(notificationID+"_Change", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback); + returnValue = true; + } } else { gAgent.clearTeleportRequest(); - maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_Change", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback); + tp_failure_notification = LLNotificationsUtil::add(notificationID+"_PreferencesOutOfSync", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback); returnValue = true; } } - else - { - gAgent.clearTeleportRequest(); - maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_PreferencesOutOfSync", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback); - 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()) + else if (regionAccess == SIM_ACCESS_ADULT) { - if (gAgent.hasRestartableFailedTeleportRequest()) + if (!gAgent.isAdult()) { - maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_ChangeAndReTeleport", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_and_reteleport_callback); + gAgent.clearTeleportRequest(); + tp_failure_notification = LLNotificationsUtil::add(notificationID+"_AdultsOnlyContent", llsdBlock); returnValue = true; + + notifySuffix = "_NotifyAdultsOnly"; + } + else if (gAgent.prefersPG() || gAgent.prefersMature()) + { + if (gAgent.hasRestartableFailedTeleportRequest()) + { + tp_failure_notification = LLNotificationsUtil::add(notificationID+"_ChangeAndReTeleport", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_and_reteleport_callback); + returnValue = true; + } + else + { + gAgent.clearTeleportRequest(); + tp_failure_notification = LLNotificationsUtil::add(notificationID+"_Change", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback); + returnValue = true; + } } else { gAgent.clearTeleportRequest(); - maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_Change", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback); + tp_failure_notification = LLNotificationsUtil::add(notificationID+"_PreferencesOutOfSync", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback); returnValue = true; } } - else + } // End of special handling for "TeleportEntryAccessBlocked" + else + { // Normal case, no message munging + gAgent.clearTeleportRequest(); + if (LLNotifications::getInstance()->templateExists(notificationID)) { - gAgent.clearTeleportRequest(); - maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_PreferencesOutOfSync", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback); - returnValue = true; + tp_failure_notification = LLNotificationsUtil::add(notificationID, llsdBlock, llsdBlock); } + else + { + llsdBlock["MESSAGE"] = defaultMessage; + tp_failure_notification = LLNotificationsUtil::add("GenericAlertOK", llsdBlock); } + returnValue = true; + } - if ((maturityLevelNotification == NULL) || maturityLevelNotification->isIgnored()) + if ((tp_failure_notification == NULL) || tp_failure_notification->isIgnored()) { - // Given a simple notification if no maturityLevelNotification is set or it is ignore + // Given a simple notification if no tp_failure_notification is set or it is ignore LLNotificationsUtil::add(notificationID + notifySuffix, llsdBlock); } @@ -6034,8 +6052,8 @@ void process_alert_core(const std::string& message, BOOL modal) std::string alert_name(message.substr(ALERT_PREFIX.length())); if (!handle_special_alerts(alert_name)) { - LLNotificationsUtil::add(alert_name); - } + LLNotificationsUtil::add(alert_name); + } } else if (message.find(NOTIFY_PREFIX) == 0) { @@ -6057,10 +6075,10 @@ void process_alert_core(const std::string& message, BOOL modal) LLFloaterRegionRestarting::close(); } - std::string new_msg =LLNotifications::instance().getGlobalString(text); - args["MESSAGE"] = new_msg; - LLNotificationsUtil::add("SystemMessage", args); - } + std::string new_msg =LLNotifications::instance().getGlobalString(text); + args["MESSAGE"] = new_msg; + LLNotificationsUtil::add("SystemMessage", args); + } else if (modal) { LLSD args; @@ -6643,8 +6661,8 @@ std::string formatted_time(const time_t& the_time) void process_teleport_failed(LLMessageSystem *msg, void**) { - std::string reason; - std::string big_reason; + std::string message_id; // Tag from server, like "RegionEntryAccessBlocked" + std::string big_reason; // Actual message to display LLSD args; // Let the interested parties know that teleport failed. @@ -6654,16 +6672,16 @@ void process_teleport_failed(LLMessageSystem *msg, void**) if (msg->has(_PREHASH_AlertInfo) && msg->getSizeFast(_PREHASH_AlertInfo, _PREHASH_Message) > 0) { // Get the message ID - msg->getStringFast(_PREHASH_AlertInfo, _PREHASH_Message, reason); - big_reason = LLAgent::sTeleportErrorMessages[reason]; + msg->getStringFast(_PREHASH_AlertInfo, _PREHASH_Message, message_id); + big_reason = LLAgent::sTeleportErrorMessages[message_id]; if ( big_reason.size() > 0 ) { // Substitute verbose reason from the local map args["REASON"] = big_reason; } else { // Nothing found in the map - use what the server returned in the original message block - msg->getStringFast(_PREHASH_Info, _PREHASH_Reason, reason); - args["REASON"] = reason; + msg->getStringFast(_PREHASH_Info, _PREHASH_Reason, big_reason); + args["REASON"] = big_reason; } LLSD llsd_block; @@ -6679,7 +6697,7 @@ void process_teleport_failed(LLMessageSystem *msg, void**) else { // change notification name in this special case - if (handle_teleport_access_blocked(llsd_block)) + if (handle_teleport_access_blocked(llsd_block, message_id, args["REASON"])) { if( gAgent.getTeleportState() != LLAgent::TELEPORT_NONE ) { @@ -6692,17 +6710,17 @@ void process_teleport_failed(LLMessageSystem *msg, void**) } else - { - msg->getStringFast(_PREHASH_Info, _PREHASH_Reason, reason); + { // Extra message payload not found - use what the simulator sent + msg->getStringFast(_PREHASH_Info, _PREHASH_Reason, message_id); - big_reason = LLAgent::sTeleportErrorMessages[reason]; + big_reason = LLAgent::sTeleportErrorMessages[message_id]; if ( big_reason.size() > 0 ) { // Substitute verbose reason from the local map args["REASON"] = big_reason; } else { // Nothing found in the map - use what the server returned - args["REASON"] = reason; + args["REASON"] = message_id; } } diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index f49f300868..20f69e689c 100755 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -169,6 +169,16 @@ No tutorial is currently available. <notification icon="alertmodal.tga" + name="GenericAlertOK" + type="alertmodal"> +[MESSAGE] + <usetemplate + name="okbutton" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" name="BadInstallation" type="alertmodal"> An error occurred while updating [APP_NAME]. Please [http://get.secondlife.com download the latest version] of the Viewer. @@ -4581,6 +4591,17 @@ The region you're trying to visit contains [REGIONMATURITY] content, but your cu <notification icon="alertmodal.tga" + name="RegionTPSpecialUsageBlocked" + type="alertmodal"> + <tag>fail</tag> + Unable to enter region. '[REGION_NAME]' is a Skill Gaming Region, and you must meet certain criteria in order to enter. For details, please review the [http://wiki.secondlife.com/wiki/Linden_Lab_Official:Skill_Gaming_in_Second_Life Skill Gaming FAQ]. + <usetemplate + name="okbutton" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" name="PreferredMaturityChanged" type="alertmodal"> You won't receive any more notifications that you're about to visit a region with [RATING] content. You may change your content preferences in the future by using Me > Preferences > General from the menu bar. diff --git a/indra/newview/skins/default/xui/en/teleport_strings.xml b/indra/newview/skins/default/xui/en/teleport_strings.xml index fdf41991cd..5a9a16d344 100755 --- a/indra/newview/skins/default/xui/en/teleport_strings.xml +++ b/indra/newview/skins/default/xui/en/teleport_strings.xml @@ -48,7 +48,10 @@ Go to 'Welcome Island Public' to repeat the tutorial. <message name="MustGetAgeRegion"> You must be age 18 or over to enter this region. </message> - </message_set> + <message name="RegionTPSpecialUsageBlocked"> + Unable to enter region. '[REGION_NAME]' is a Skill Gaming Region, and you must meet certain criteria in order to enter. For details, please review the [http://wiki.secondlife.com/wiki/Linden_Lab_Official:Skill_Gaming_in_Second_Life Skill Gaming FAQ]. + </message> + </message_set> <message_set name="progress"> <message name="sending_dest"> Sending to destination. |