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 | |
parent | add CanSellObject() permitions check functions (diff) | |
parent | If a DNS resolution fails on an outbound request, simply allow it (diff) | |
download | opensim-SC_OLD-5587ee45005bd99ee01cefd8fb3ae3f2b91bf284.zip opensim-SC_OLD-5587ee45005bd99ee01cefd8fb3ae3f2b91bf284.tar.gz opensim-SC_OLD-5587ee45005bd99ee01cefd8fb3ae3f2b91bf284.tar.bz2 opensim-SC_OLD-5587ee45005bd99ee01cefd8fb3ae3f2b91bf284.tar.xz |
Merge branch 'melanie'
Diffstat (limited to 'OpenSim/Region/CoreModules')
4 files changed, 62 insertions, 3 deletions
diff --git a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs index f8a4461..610e279 100644 --- a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs | |||
@@ -806,6 +806,9 @@ namespace OpenSim.Region.CoreModules.Asset | |||
806 | 806 | ||
807 | return; | 807 | return; |
808 | } | 808 | } |
809 | catch (UnauthorizedAccessException e) | ||
810 | { | ||
811 | } | ||
809 | finally | 812 | finally |
810 | { | 813 | { |
811 | if (stream != null) | 814 | if (stream != null) |
diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs index 51f973a..32cb5a3 100644 --- a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs +++ b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs | |||
@@ -957,9 +957,14 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
957 | 957 | ||
958 | public virtual bool IsLocalGridUser(UUID uuid) | 958 | public virtual bool IsLocalGridUser(UUID uuid) |
959 | { | 959 | { |
960 | UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, uuid); | 960 | lock (m_Scenes) |
961 | if (account == null || (account != null && !account.LocalToGrid)) | 961 | { |
962 | return false; | 962 | if (m_Scenes.Count == 0) |
963 | return true; | ||
964 | UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, uuid); | ||
965 | if (account == null || (account != null && !account.LocalToGrid)) | ||
966 | return false; | ||
967 | } | ||
963 | 968 | ||
964 | return true; | 969 | return true; |
965 | } | 970 | } |
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 | } |