From 207a5f17b58d58be249387c2195554d58f72a525 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 3 Jun 2012 13:43:39 +0200 Subject: [PATCH] When regions are set to shut down the instance, always send notifications to all affected regions and disregard the region id parameter. --- .../RemoteController/RemoteAdminPlugin.cs | 36 +++++++++++++++---- 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index 9e72a98a76..437d150097 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs @@ -258,10 +258,25 @@ namespace OpenSim.ApplicationPlugins.RemoteController { m_log.Info("[RADMIN]: Request to restart Region."); - CheckRegionParams(requestData, responseData); - Scene rebootedScene = null; - GetSceneFromRegionParams(requestData, responseData, out rebootedScene); + bool restartAll = false; + + IConfig startupConfig = m_configSource.Configs["Startup"]; + if (startupConfig != null) + { + if (startupConfig.GetBoolean("InworldRestartShutsDown", false)) + { + rebootedScene = m_application.SceneManager.CurrentOrFirstScene; + restartAll = true; + } + } + + if (rebootedScene == null) + { + CheckRegionParams(requestData, responseData); + + GetSceneFromRegionParams(requestData, responseData, out rebootedScene); + } IRestartModule restartModule = rebootedScene.RequestModuleInterface(); @@ -324,11 +339,20 @@ namespace OpenSim.ApplicationPlugins.RemoteController notice = false; } - if (restartModule != null) + List restartList; + + if (restartAll) + restartList = m_application.SceneManager.Scenes; + else + restartList = new List() { rebootedScene }; + + foreach (Scene s in m_application.SceneManager.Scenes) { - restartModule.ScheduleRestart(UUID.Zero, message, times.ToArray(), notice); - responseData["success"] = true; + restartModule = s.RequestModuleInterface(); + if (restartModule != null) + restartModule.ScheduleRestart(UUID.Zero, message, times.ToArray(), notice); } + responseData["success"] = true; } catch (Exception e) {