summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermessage.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2014-02-11 16:04:31 -0500
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2014-02-11 16:04:31 -0500
commit969cb45920c568aeebf145480b7beacb2a157bcf (patch)
tree63dfb29d5e0226b054094d88358bec6ede68c197 /indra/newview/llviewermessage.cpp
parentd8f627d8bd45cc356583e2251500c23bed836b16 (diff)
parent413be91cf5044889ade97dcbec4b17fceff122e3 (diff)
merge
Diffstat (limited to 'indra/newview/llviewermessage.cpp')
-rwxr-xr-xindra/newview/llviewermessage.cpp68
1 files changed, 46 insertions, 22 deletions
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index d4a35c6cc7..9ecce37609 100755
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -111,6 +111,7 @@
#include "llpanelblockedlist.h"
#include "llpanelplaceprofile.h"
#include "llviewerregion.h"
+#include "llfloaterregionrestarting.h"
#include <boost/algorithm/string/split.hpp> //
#include <boost/regex.hpp>
@@ -5750,7 +5751,6 @@ bool handle_special_notification(std::string notificationID, LLSD& llsdBlock)
std::string regionMaturity = LLViewerRegion::accessToString(regionAccess);
LLStringUtil::toLower(regionMaturity);
llsdBlock["REGIONMATURITY"] = regionMaturity;
-
bool returnValue = false;
LLNotificationPtr maturityLevelNotification;
std::string notifySuffix = "_Notify";
@@ -5920,6 +5920,7 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem)
(notificationID == "RegionEntryAccessBlocked") ||
(notificationID == "LandClaimAccessBlocked") ||
(notificationID == "LandBuyAccessBlocked")
+
)
{
/*---------------------------------------------------------------------
@@ -5961,7 +5962,41 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem)
snap_filename += SCREEN_HOME_FILENAME;
gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, FALSE);
}
-
+
+ if (notificationID == "RegionRestartMinutes" ||
+ notificationID == "RegionRestartSeconds")
+ {
+ S32 seconds;
+ if (notificationID == "RegionRestartMinutes")
+ {
+ seconds = 60 * static_cast<S32>(llsdBlock["MINUTES"].asInteger());
+ }
+ else
+ {
+ seconds = static_cast<S32>(llsdBlock["SECONDS"].asInteger());
+ }
+
+ LLFloaterRegionRestarting* floaterp = LLFloaterReg::findTypedInstance<LLFloaterRegionRestarting>("region_restarting");
+
+ if (floaterp)
+ {
+ LLFloaterRegionRestarting::updateTime(seconds);
+ }
+ else
+ {
+ LLSD params;
+ params["NAME"] = llsdBlock["NAME"];
+ params["SECONDS"] = (LLSD::Integer)seconds;
+ LLFloaterRegionRestarting* restarting_floater = dynamic_cast<LLFloaterRegionRestarting*>(LLFloaterReg::showInstance("region_restarting", params));
+ if(restarting_floater)
+ {
+ restarting_floater->center();
+ }
+ }
+
+ send_sound_trigger(LLUUID(gSavedSettings.getString("UISndRestart")), 1.0f);
+ }
+
LLNotificationsUtil::add(notificationID, llsdBlock);
return true;
}
@@ -6021,7 +6056,6 @@ void process_alert_message(LLMessageSystem *msgsystem, void **user_data)
std::string message;
msgsystem->getStringFast(_PREHASH_AlertData, _PREHASH_Message, message);
-
process_special_alert_messages(message);
if (!attempt_standard_notification(msgsystem))
@@ -6045,7 +6079,6 @@ bool handle_not_age_verified_alert(const std::string &pAlertName)
bool handle_special_alerts(const std::string &pAlertName)
{
bool isHandled = false;
-
if (LLStringUtil::compareStrings(pAlertName, "NotAgeVerified") == 0)
{
@@ -6081,26 +6114,17 @@ void process_alert_core(const std::string& message, BOOL modal)
// System message is important, show in upper-right box not tip
std::string text(message.substr(1));
LLSD args;
- if (text.substr(0,17) == "RESTART_X_MINUTES")
- {
- S32 mins = 0;
- LLStringUtil::convertToS32(text.substr(18), mins);
- args["MINUTES"] = llformat("%d",mins);
- LLNotificationsUtil::add("RegionRestartMinutes", args);
- }
- else if (text.substr(0,17) == "RESTART_X_SECONDS")
- {
- S32 secs = 0;
- LLStringUtil::convertToS32(text.substr(18), secs);
- args["SECONDS"] = llformat("%d",secs);
- LLNotificationsUtil::add("RegionRestartSeconds", args);
- }
- else
+
+ // *NOTE: If the text from the server ever changes this line will need to be adjusted.
+ std::string restart_cancelled = "Region restart cancelled.";
+ if (text.substr(0, restart_cancelled.length()) == restart_cancelled)
{
- std::string new_msg =LLNotifications::instance().getGlobalString(text);
- args["MESSAGE"] = new_msg;
- LLNotificationsUtil::add("SystemMessage", args);
+ LLFloaterRegionRestarting::close();
}
+
+ std::string new_msg =LLNotifications::instance().getGlobalString(text);
+ args["MESSAGE"] = new_msg;
+ LLNotificationsUtil::add("SystemMessage", args);
}
else if (modal)
{