From ac2fcbe224d4877dccc4d73e9c58771e40a4ae1c Mon Sep 17 00:00:00 2001
From: CasperW
Date: Thu, 26 Nov 2009 15:17:44 +0100
Subject: Improvements to rAdmin admin_shutdown and admin_restart. Both methods
can now accept a parameter of noticetype = dialog in order to display a blue
persistant dropdown instead of a short notice. Added an optional and
configurable delay to the restart method, defaulting at 30 seconds as before.
Both methods can also accept a noticetype = none dialog in order to act
silently.
---
OpenSim/Region/Framework/Scenes/Scene.cs | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 4ffa1a2..be1d4bf 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -873,6 +873,15 @@ namespace OpenSim.Region.Framework.Scenes
/// float indicating duration before restart.
public virtual void Restart(float seconds)
{
+ Restart(seconds, true);
+ }
+
+ ///
+ /// Given float seconds, this will restart the region. showDialog will optionally alert the users.
+ ///
+ /// float indicating duration before restart.
+ public virtual void Restart(float seconds, bool showDialog)
+ {
// notifications are done in 15 second increments
// so .. if the number of seconds is less then 15 seconds, it's not really a restart request
// It's a 'Cancel restart' request.
@@ -893,8 +902,11 @@ namespace OpenSim.Region.Framework.Scenes
m_restartTimer.Elapsed += new ElapsedEventHandler(RestartTimer_Elapsed);
m_log.Info("[REGION]: Restarting Region in " + (seconds / 60) + " minutes");
m_restartTimer.Start();
- m_dialogModule.SendNotificationToUsersInRegion(
- UUID.Random(), String.Empty, RegionInfo.RegionName + ": Restarting in 2 Minutes");
+ if (showDialog)
+ {
+ m_dialogModule.SendNotificationToUsersInRegion(
+ UUID.Random(), String.Empty, RegionInfo.RegionName + ": Restarting in " + (seconds / 60).ToString() + " Minutes");
+ }
}
}
--
cgit v1.1