summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermessage.cpp
diff options
context:
space:
mode:
authorsimon <none@none>2014-02-10 16:11:50 -0800
committersimon <none@none>2014-02-10 16:11:50 -0800
commitcb2045fcd5106b5e0028869fc6a3e080d3f8e779 (patch)
tree8270c7d248f542107472fff9f2eb10f30721e1ee /indra/newview/llviewermessage.cpp
parent8e5da5125de2bc9f8ce5ed2677556953e008c59d (diff)
parent4acc2dc2736621952b6ee0e808640dcf79e341c6 (diff)
Merge downstream code with viewer-release
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 c532134763..2dbdceed66 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>
@@ -5743,7 +5744,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";
@@ -5913,6 +5913,7 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem)
(notificationID == "RegionEntryAccessBlocked") ||
(notificationID == "LandClaimAccessBlocked") ||
(notificationID == "LandBuyAccessBlocked")
+
)
{
/*---------------------------------------------------------------------
@@ -5954,7 +5955,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;
}
@@ -6014,7 +6049,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))
@@ -6038,7 +6072,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)
{
@@ -6074,26 +6107,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)
{