From caaf9f7fc19d6c272f9cab669ed78c486b11fded Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Thu, 9 Feb 2017 23:13:37 +0000 Subject: Squelch an error that happens when the asset cache was mounted RO. Nothing we can do about that, blame Docker. --- OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'OpenSim/Region/CoreModules') 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 return; } + catch (UnauthorizedAccessException e) + { + } finally { if (stream != null) -- cgit v1.1 From 27fdf3094d6bf20325ab261b41d3d4831c14c204 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Thu, 9 Feb 2017 23:14:35 +0000 Subject: A god is a god is a god. Let gods access scripts and NCs Support staff are not of much help if they can't see the script a user has issues with. --- OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index b60cd93..86f0a58 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs @@ -1732,6 +1732,10 @@ namespace OpenSim.Region.CoreModules.World.Permissions DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; + // A god is a god is a god + if (IsAdministrator(user)) + return true; + if (objectID == UUID.Zero) // User inventory { IInventoryService invService = m_scene.InventoryService; @@ -1828,6 +1832,10 @@ namespace OpenSim.Region.CoreModules.World.Permissions DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; + // A god is a god is a god + if (IsAdministrator(user)) + return true; + if (objectID == UUID.Zero) // User inventory { IInventoryService invService = m_scene.InventoryService; -- cgit v1.1 From 3e880cee45ea0d85297c51d3ed87490d47a5bd94 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Thu, 23 Mar 2017 23:00:14 +0000 Subject: Allow short-circuiting region restart delays of there are no users left --- .../CoreModules/World/Region/RestartModule.cs | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/World/Region/RestartModule.cs b/OpenSim/Region/CoreModules/World/Region/RestartModule.cs index 8bac9e6..bf6592f 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 protected IDialogModule m_DialogModule = null; protected string m_MarkerPath = String.Empty; private int[] m_CurrentAlerts = null; + protected bool m_shortCircuitDelays = false; + protected bool m_rebootAll = false; public void Initialise(IConfigSource config) { @@ -69,6 +71,9 @@ namespace OpenSim.Region.CoreModules.World.Region { m_MarkerPath = restartConfig.GetString("MarkerPath", String.Empty); } + IConfig startupConfig = config.Configs["Startup"]; + m_shortCircuitDelays = startupConfig.GetBoolean("SkipDelayOnEmptyRegion", false); + m_rebootAll = startupConfig.GetBoolean("InworldRestartShutsDown", false); } public void AddRegion(Scene scene) @@ -250,6 +255,14 @@ namespace OpenSim.Region.CoreModules.World.Region private void OnTimer(object source, ElapsedEventArgs e) { int nextInterval = DoOneNotice(true); + if (m_shortCircuitDelays) + { + if (CountAgents() == 0) + { + m_Scene.RestartNow(); + return; + } + } SetTimer(nextInterval); } @@ -349,5 +362,35 @@ namespace OpenSim.Region.CoreModules.World.Region { } } + + int CountAgents() + { + m_log.Info("[RESTART MODULE]: Counting affected avatars"); + int agents = 0; + + if (m_rebootAll) + { + foreach (Scene s in SceneManager.Instance.Scenes) + { + foreach (ScenePresence sp in s.GetScenePresences()) + { + if (!sp.IsChildAgent) + agents++; + } + } + } + else + { + foreach (ScenePresence sp in m_Scene.GetScenePresences()) + { + if (!sp.IsChildAgent) + agents++; + } + } + + m_log.InfoFormat("[RESTART MODULE]: Avatars in region: {0}", agents); + + return agents; + } } } -- cgit v1.1 From a6ecedb72a44dbf9c2b9ec4c8f51ec70fce06b78 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Fri, 31 Mar 2017 13:50:28 +0100 Subject: Also ignore NPCs in short-circuiting region restarts --- OpenSim/Region/CoreModules/World/Region/RestartModule.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/World/Region/RestartModule.cs b/OpenSim/Region/CoreModules/World/Region/RestartModule.cs index bf6592f..bb3b860 100644 --- a/OpenSim/Region/CoreModules/World/Region/RestartModule.cs +++ b/OpenSim/Region/CoreModules/World/Region/RestartModule.cs @@ -374,7 +374,7 @@ namespace OpenSim.Region.CoreModules.World.Region { foreach (ScenePresence sp in s.GetScenePresences()) { - if (!sp.IsChildAgent) + if (!sp.IsChildAgent && !sp.IsNPC) agents++; } } @@ -383,7 +383,7 @@ namespace OpenSim.Region.CoreModules.World.Region { foreach (ScenePresence sp in m_Scene.GetScenePresences()) { - if (!sp.IsChildAgent) + if (!sp.IsChildAgent && !sp.IsNPC) agents++; } } -- cgit v1.1 From 59f7cf79c9925ea07a79d975bf480aba7b5d6498 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Fri, 31 Mar 2017 13:51:42 +0100 Subject: Prevent error spew when script send IM to HG users before HG is up --- .../Framework/UserManagement/UserManagementModule.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/CoreModules') 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 public virtual bool IsLocalGridUser(UUID uuid) { - UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, uuid); - if (account == null || (account != null && !account.LocalToGrid)) - return false; + lock (m_Scenes) + { + if (m_Scenes.Count == 0) + return true; + UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, uuid); + if (account == null || (account != null && !account.LocalToGrid)) + return false; + } return true; } -- cgit v1.1