diff options
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 69 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneBase.cs | 20 |
2 files changed, 10 insertions, 79 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index d3a4678..e479628 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -915,72 +915,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
915 | return new GridRegion(RegionInfo); | 915 | return new GridRegion(RegionInfo); |
916 | } | 916 | } |
917 | 917 | ||
918 | /// <summary> | ||
919 | /// Given float seconds, this will restart the region. | ||
920 | /// </summary> | ||
921 | /// <param name="seconds">float indicating duration before restart.</param> | ||
922 | public virtual void Restart(float seconds) | ||
923 | { | ||
924 | Restart(seconds, true); | ||
925 | } | ||
926 | |||
927 | /// <summary> | ||
928 | /// Given float seconds, this will restart the region. showDialog will optionally alert the users. | ||
929 | /// </summary> | ||
930 | /// <param name="seconds">float indicating duration before restart.</param> | ||
931 | public virtual void Restart(float seconds, bool showDialog) | ||
932 | { | ||
933 | // notifications are done in 15 second increments | ||
934 | // so .. if the number of seconds is less then 15 seconds, it's not really a restart request | ||
935 | // It's a 'Cancel restart' request. | ||
936 | |||
937 | // RestartNow() does immediate restarting. | ||
938 | if (seconds < 15) | ||
939 | { | ||
940 | m_restartTimer.Stop(); | ||
941 | m_dialogModule.SendGeneralAlert("Restart Aborted"); | ||
942 | } | ||
943 | else | ||
944 | { | ||
945 | // Now we figure out what to set the timer to that does the notifications and calls, RestartNow() | ||
946 | m_restartTimer.Interval = 15000; | ||
947 | m_incrementsof15seconds = (int)seconds / 15; | ||
948 | m_RestartTimerCounter = 0; | ||
949 | m_restartTimer.AutoReset = true; | ||
950 | m_restartTimer.Elapsed += new ElapsedEventHandler(RestartTimer_Elapsed); | ||
951 | m_log.Info("[REGION]: Restarting Region in " + (seconds / 60) + " minutes"); | ||
952 | m_restartTimer.Start(); | ||
953 | if (showDialog) | ||
954 | { | ||
955 | m_dialogModule.SendNotificationToUsersInRegion( | ||
956 | UUID.Random(), String.Empty, RegionInfo.RegionName + String.Format(": Restarting in {0} Minutes", (int)(seconds / 60.0))); | ||
957 | } | ||
958 | } | ||
959 | } | ||
960 | |||
961 | // The Restart timer has occured. | ||
962 | // We have to figure out if this is a notification or if the number of seconds specified in Restart | ||
963 | // have elapsed. | ||
964 | // If they have elapsed, call RestartNow() | ||
965 | public void RestartTimer_Elapsed(object sender, ElapsedEventArgs e) | ||
966 | { | ||
967 | m_RestartTimerCounter++; | ||
968 | if (m_RestartTimerCounter <= m_incrementsof15seconds) | ||
969 | { | ||
970 | if (m_RestartTimerCounter == 4 || m_RestartTimerCounter == 6 || m_RestartTimerCounter == 7) | ||
971 | m_dialogModule.SendNotificationToUsersInRegion( | ||
972 | UUID.Random(), | ||
973 | String.Empty, | ||
974 | RegionInfo.RegionName + ": Restarting in " + ((8 - m_RestartTimerCounter) * 15) + " seconds"); | ||
975 | } | ||
976 | else | ||
977 | { | ||
978 | m_restartTimer.Stop(); | ||
979 | m_restartTimer.AutoReset = false; | ||
980 | RestartNow(); | ||
981 | } | ||
982 | } | ||
983 | |||
984 | // This causes the region to restart immediatley. | 918 | // This causes the region to restart immediatley. |
985 | public void RestartNow() | 919 | public void RestartNow() |
986 | { | 920 | { |
@@ -1003,7 +937,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1003 | Close(); | 937 | Close(); |
1004 | 938 | ||
1005 | m_log.Error("[REGION]: Firing Region Restart Message"); | 939 | m_log.Error("[REGION]: Firing Region Restart Message"); |
1006 | base.Restart(0); | 940 | |
941 | base.Restart(); | ||
1007 | } | 942 | } |
1008 | 943 | ||
1009 | // This is a helper function that notifies root agents in this region that a new sim near them has come up | 944 | // This is a helper function that notifies root agents in this region that a new sim near them has come up |
diff --git a/OpenSim/Region/Framework/Scenes/SceneBase.cs b/OpenSim/Region/Framework/Scenes/SceneBase.cs index c71aefa..f343bc8 100644 --- a/OpenSim/Region/Framework/Scenes/SceneBase.cs +++ b/OpenSim/Region/Framework/Scenes/SceneBase.cs | |||
@@ -218,18 +218,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
218 | 218 | ||
219 | #region admin stuff | 219 | #region admin stuff |
220 | 220 | ||
221 | /// <summary> | ||
222 | /// Region Restart - Seconds till restart. | ||
223 | /// </summary> | ||
224 | /// <param name="seconds"></param> | ||
225 | public virtual void Restart(int seconds) | ||
226 | { | ||
227 | m_log.Error("[REGION]: passing Restart Message up the namespace"); | ||
228 | restart handlerPhysicsCrash = OnRestart; | ||
229 | if (handlerPhysicsCrash != null) | ||
230 | handlerPhysicsCrash(RegionInfo); | ||
231 | } | ||
232 | |||
233 | public virtual bool PresenceChildStatus(UUID avatarID) | 221 | public virtual bool PresenceChildStatus(UUID avatarID) |
234 | { | 222 | { |
235 | return false; | 223 | return false; |
@@ -562,6 +550,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
562 | get { return false; } | 550 | get { return false; } |
563 | } | 551 | } |
564 | 552 | ||
553 | public void Restart() | ||
554 | { | ||
555 | // This has to be here to fire the event | ||
556 | restart handlerPhysicsCrash = OnRestart; | ||
557 | if (handlerPhysicsCrash != null) | ||
558 | handlerPhysicsCrash(RegionInfo); | ||
559 | } | ||
560 | |||
565 | public abstract bool CheckClient(UUID agentID, System.Net.IPEndPoint ep); | 561 | public abstract bool CheckClient(UUID agentID, System.Net.IPEndPoint ep); |
566 | } | 562 | } |
567 | } | 563 | } |