summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermessage.cpp
diff options
context:
space:
mode:
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 3574d37adf..267aa9532c 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>
@@ -5741,7 +5742,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";
@@ -5911,6 +5911,7 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem)
(notificationID == "RegionEntryAccessBlocked") ||
(notificationID == "LandClaimAccessBlocked") ||
(notificationID == "LandBuyAccessBlocked")
+
)
{
/*---------------------------------------------------------------------
@@ -5952,7 +5953,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;
}
@@ -6012,7 +6047,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))
@@ -6036,7 +6070,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)
{
@@ -6072,26 +6105,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)
{