diff options
author | Melanie Thielker | 2017-02-24 01:31:32 +0000 |
---|---|---|
committer | Melanie Thielker | 2017-03-31 14:38:41 +0100 |
commit | 41d21190b18e1b14fe4f56bde69e7e9a9ee60723 (patch) | |
tree | 839999175c89c4afe8dc97d9fc8cd3553cbdb32a | |
parent | Change a misleading message that could lead users to believe a grid is down (diff) | |
download | opensim-SC_OLD-41d21190b18e1b14fe4f56bde69e7e9a9ee60723.zip opensim-SC_OLD-41d21190b18e1b14fe4f56bde69e7e9a9ee60723.tar.gz opensim-SC_OLD-41d21190b18e1b14fe4f56bde69e7e9a9ee60723.tar.bz2 opensim-SC_OLD-41d21190b18e1b14fe4f56bde69e7e9a9ee60723.tar.xz |
Skip region restart messages and delays when there are no root agents
-rw-r--r-- | OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index 597b439..e5fbc69 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | |||
@@ -359,6 +359,42 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
359 | notice = false; | 359 | notice = false; |
360 | } | 360 | } |
361 | 361 | ||
362 | if (startupConfig.GetBoolean("SkipDelayOnEmptyRegion", false)) | ||
363 | { | ||
364 | m_log.Info("[RADMIN]: Counting affected avatars"); | ||
365 | int agents = 0; | ||
366 | |||
367 | if (restartAll) | ||
368 | { | ||
369 | foreach (Scene s in m_application.SceneManager.Scenes) | ||
370 | { | ||
371 | foreach (ScenePresence sp in s.GetScenePresences()) | ||
372 | { | ||
373 | if (!sp.IsChildAgent) | ||
374 | agents++; | ||
375 | } | ||
376 | } | ||
377 | } | ||
378 | else | ||
379 | { | ||
380 | foreach (ScenePresence sp in rebootedScene.GetScenePresences()) | ||
381 | { | ||
382 | if (!sp.IsChildAgent) | ||
383 | agents++; | ||
384 | } | ||
385 | } | ||
386 | |||
387 | m_log.InfoFormat("[RADMIN]: Avatars in region: {0}", agents); | ||
388 | |||
389 | if (agents == 0) | ||
390 | { | ||
391 | m_log.Info("[RADMIN]: No avatars detected, shutting down without delay"); | ||
392 | |||
393 | times.Clear(); | ||
394 | times.Add(0); | ||
395 | } | ||
396 | } | ||
397 | |||
362 | List<Scene> restartList; | 398 | List<Scene> restartList; |
363 | 399 | ||
364 | if (restartAll) | 400 | if (restartAll) |
@@ -376,10 +412,10 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
376 | } | 412 | } |
377 | catch (Exception e) | 413 | catch (Exception e) |
378 | { | 414 | { |
379 | // m_log.ErrorFormat("[RADMIN]: Restart region: failed: {0} {1}", e.Message, e.StackTrace); | 415 | m_log.ErrorFormat("[RADMIN]: Restart region: failed: {0} {1}", e.Message, e.StackTrace); |
380 | responseData["rebooting"] = false; | 416 | responseData["rebooting"] = false; |
381 | 417 | ||
382 | throw e; | 418 | throw; |
383 | } | 419 | } |
384 | 420 | ||
385 | m_log.Info("[RADMIN]: Restart Region request complete"); | 421 | m_log.Info("[RADMIN]: Restart Region request complete"); |