diff options
author | Melanie Thielker | 2017-03-31 14:50:14 +0100 |
---|---|---|
committer | Melanie Thielker | 2017-03-31 14:50:14 +0100 |
commit | 5587ee45005bd99ee01cefd8fb3ae3f2b91bf284 (patch) | |
tree | 2863324dc4f7832d60c22118268b8a432fb7c1bf /OpenSim/Region/CoreModules/World | |
parent | add CanSellObject() permitions check functions (diff) | |
parent | If a DNS resolution fails on an outbound request, simply allow it (diff) | |
download | opensim-SC-5587ee45005bd99ee01cefd8fb3ae3f2b91bf284.zip opensim-SC-5587ee45005bd99ee01cefd8fb3ae3f2b91bf284.tar.gz opensim-SC-5587ee45005bd99ee01cefd8fb3ae3f2b91bf284.tar.bz2 opensim-SC-5587ee45005bd99ee01cefd8fb3ae3f2b91bf284.tar.xz |
Merge branch 'melanie'
Diffstat (limited to 'OpenSim/Region/CoreModules/World')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | 8 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/World/Region/RestartModule.cs | 43 |
2 files changed, 51 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index 7f2b29a..bc86076 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | |||
@@ -2032,6 +2032,10 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
2032 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 2032 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |
2033 | if (m_bypassPermissions) return m_bypassPermissionsValue; | 2033 | if (m_bypassPermissions) return m_bypassPermissionsValue; |
2034 | 2034 | ||
2035 | // A god is a god is a god | ||
2036 | if (IsAdministrator(user)) | ||
2037 | return true; | ||
2038 | |||
2035 | if (objectID == UUID.Zero) // User inventory | 2039 | if (objectID == UUID.Zero) // User inventory |
2036 | { | 2040 | { |
2037 | IInventoryService invService = m_scene.InventoryService; | 2041 | IInventoryService invService = m_scene.InventoryService; |
@@ -2121,6 +2125,10 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
2121 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 2125 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |
2122 | if (m_bypassPermissions) return m_bypassPermissionsValue; | 2126 | if (m_bypassPermissions) return m_bypassPermissionsValue; |
2123 | 2127 | ||
2128 | // A god is a god is a god | ||
2129 | if (IsAdministrator(user)) | ||
2130 | return true; | ||
2131 | |||
2124 | if (objectID == UUID.Zero) // User inventory | 2132 | if (objectID == UUID.Zero) // User inventory |
2125 | { | 2133 | { |
2126 | IInventoryService invService = m_scene.InventoryService; | 2134 | IInventoryService invService = m_scene.InventoryService; |
diff --git a/OpenSim/Region/CoreModules/World/Region/RestartModule.cs b/OpenSim/Region/CoreModules/World/Region/RestartModule.cs index 8bac9e6..bb3b860 100644 --- a/OpenSim/Region/CoreModules/World/Region/RestartModule.cs +++ b/OpenSim/Region/CoreModules/World/Region/RestartModule.cs | |||
@@ -61,6 +61,8 @@ namespace OpenSim.Region.CoreModules.World.Region | |||
61 | protected IDialogModule m_DialogModule = null; | 61 | protected IDialogModule m_DialogModule = null; |
62 | protected string m_MarkerPath = String.Empty; | 62 | protected string m_MarkerPath = String.Empty; |
63 | private int[] m_CurrentAlerts = null; | 63 | private int[] m_CurrentAlerts = null; |
64 | protected bool m_shortCircuitDelays = false; | ||
65 | protected bool m_rebootAll = false; | ||
64 | 66 | ||
65 | public void Initialise(IConfigSource config) | 67 | public void Initialise(IConfigSource config) |
66 | { | 68 | { |
@@ -69,6 +71,9 @@ namespace OpenSim.Region.CoreModules.World.Region | |||
69 | { | 71 | { |
70 | m_MarkerPath = restartConfig.GetString("MarkerPath", String.Empty); | 72 | m_MarkerPath = restartConfig.GetString("MarkerPath", String.Empty); |
71 | } | 73 | } |
74 | IConfig startupConfig = config.Configs["Startup"]; | ||
75 | m_shortCircuitDelays = startupConfig.GetBoolean("SkipDelayOnEmptyRegion", false); | ||
76 | m_rebootAll = startupConfig.GetBoolean("InworldRestartShutsDown", false); | ||
72 | } | 77 | } |
73 | 78 | ||
74 | public void AddRegion(Scene scene) | 79 | public void AddRegion(Scene scene) |
@@ -250,6 +255,14 @@ namespace OpenSim.Region.CoreModules.World.Region | |||
250 | private void OnTimer(object source, ElapsedEventArgs e) | 255 | private void OnTimer(object source, ElapsedEventArgs e) |
251 | { | 256 | { |
252 | int nextInterval = DoOneNotice(true); | 257 | int nextInterval = DoOneNotice(true); |
258 | if (m_shortCircuitDelays) | ||
259 | { | ||
260 | if (CountAgents() == 0) | ||
261 | { | ||
262 | m_Scene.RestartNow(); | ||
263 | return; | ||
264 | } | ||
265 | } | ||
253 | 266 | ||
254 | SetTimer(nextInterval); | 267 | SetTimer(nextInterval); |
255 | } | 268 | } |
@@ -349,5 +362,35 @@ namespace OpenSim.Region.CoreModules.World.Region | |||
349 | { | 362 | { |
350 | } | 363 | } |
351 | } | 364 | } |
365 | |||
366 | int CountAgents() | ||
367 | { | ||
368 | m_log.Info("[RESTART MODULE]: Counting affected avatars"); | ||
369 | int agents = 0; | ||
370 | |||
371 | if (m_rebootAll) | ||
372 | { | ||
373 | foreach (Scene s in SceneManager.Instance.Scenes) | ||
374 | { | ||
375 | foreach (ScenePresence sp in s.GetScenePresences()) | ||
376 | { | ||
377 | if (!sp.IsChildAgent && !sp.IsNPC) | ||
378 | agents++; | ||
379 | } | ||
380 | } | ||
381 | } | ||
382 | else | ||
383 | { | ||
384 | foreach (ScenePresence sp in m_Scene.GetScenePresences()) | ||
385 | { | ||
386 | if (!sp.IsChildAgent && !sp.IsNPC) | ||
387 | agents++; | ||
388 | } | ||
389 | } | ||
390 | |||
391 | m_log.InfoFormat("[RESTART MODULE]: Avatars in region: {0}", agents); | ||
392 | |||
393 | return agents; | ||
394 | } | ||
352 | } | 395 | } |
353 | } | 396 | } |