Merge branch 'melanie'

This commit is contained in:
Melanie Thielker
2017-03-31 14:50:14 +01:00
22 changed files with 12271 additions and 100 deletions

View File

@@ -806,6 +806,9 @@ namespace OpenSim.Region.CoreModules.Asset
return;
}
catch (UnauthorizedAccessException e)
{
}
finally
{
if (stream != null)

View File

@@ -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;
}

View File

@@ -2032,6 +2032,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;
@@ -2121,6 +2125,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;

View File

@@ -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 && !sp.IsNPC)
agents++;
}
}
}
else
{
foreach (ScenePresence sp in m_Scene.GetScenePresences())
{
if (!sp.IsChildAgent && !sp.IsNPC)
agents++;
}
}
m_log.InfoFormat("[RESTART MODULE]: Avatars in region: {0}", agents);
return agents;
}
}
}