mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 18:25:33 +08:00
Merge branch 'master' into careminster
Conflicts: OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcRouterModule.cs OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
This commit is contained in:
@@ -55,6 +55,16 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
|
||||
private readonly Dictionary<UUID, List<DecodedCallback>> m_notifyList = new Dictionary<UUID, List<DecodedCallback>>();
|
||||
/// <summary>Cache that will store decoded JPEG2000 layer boundary data</summary>
|
||||
private IImprovedAssetCache m_cache;
|
||||
private IImprovedAssetCache Cache
|
||||
{
|
||||
get
|
||||
{
|
||||
if (m_cache == null)
|
||||
m_cache = m_scene.RequestModuleInterface<IImprovedAssetCache>();
|
||||
|
||||
return m_cache;
|
||||
}
|
||||
}
|
||||
/// <summary>Reference to a scene (doesn't matter which one as long as it can load the cache module)</summary>
|
||||
private UUID m_CreatorID = UUID.Zero;
|
||||
private Scene m_scene;
|
||||
@@ -98,7 +108,6 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
|
||||
|
||||
public void PostInitialise()
|
||||
{
|
||||
m_cache = m_scene.RequestModuleInterface<IImprovedAssetCache>();
|
||||
}
|
||||
|
||||
public void Close()
|
||||
@@ -297,7 +306,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
|
||||
{
|
||||
m_decodedCache.AddOrUpdate(AssetId, Layers, TimeSpan.FromMinutes(10));
|
||||
|
||||
if (m_cache != null)
|
||||
if (Cache != null)
|
||||
{
|
||||
string assetID = "j2kCache_" + AssetId.ToString();
|
||||
|
||||
@@ -321,7 +330,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
|
||||
|
||||
#endregion Serialize Layer Data
|
||||
|
||||
m_cache.Cache(layerDecodeAsset);
|
||||
Cache.Cache(layerDecodeAsset);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -331,10 +340,10 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if (m_cache != null)
|
||||
else if (Cache != null)
|
||||
{
|
||||
string assetName = "j2kCache_" + AssetId.ToString();
|
||||
AssetBase layerDecodeAsset = m_cache.Get(assetName);
|
||||
AssetBase layerDecodeAsset = Cache.Get(assetName);
|
||||
|
||||
if (layerDecodeAsset != null)
|
||||
{
|
||||
@@ -346,7 +355,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
|
||||
if (lines.Length == 0)
|
||||
{
|
||||
m_log.Warn("[J2KDecodeCache]: Expiring corrupted layer data (empty) " + assetName);
|
||||
m_cache.Expire(assetName);
|
||||
Cache.Expire(assetName);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -367,7 +376,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
|
||||
catch (FormatException)
|
||||
{
|
||||
m_log.Warn("[J2KDecodeCache]: Expiring corrupted layer data (format) " + assetName);
|
||||
m_cache.Expire(assetName);
|
||||
Cache.Expire(assetName);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -378,7 +387,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
|
||||
else
|
||||
{
|
||||
m_log.Warn("[J2KDecodeCache]: Expiring corrupted layer data (layout) " + assetName);
|
||||
m_cache.Expire(assetName);
|
||||
Cache.Expire(assetName);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,10 +37,12 @@ using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using log4net;
|
||||
using System.Reflection;
|
||||
using Mono.Addins;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture
|
||||
{
|
||||
public class DynamicTextureModule : IRegionModule, IDynamicTextureManager
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "DynamicTextureModule")]
|
||||
public class DynamicTextureModule : ISharedRegionModule, IDynamicTextureManager
|
||||
{
|
||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
@@ -81,6 +83,16 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture
|
||||
/// </remarks>
|
||||
private Cache m_reuseableDynamicTextures;
|
||||
|
||||
/// <summary>
|
||||
/// This constructor is only here because of the Unit Tests...
|
||||
/// Don't use it.
|
||||
/// </summary>
|
||||
public DynamicTextureModule()
|
||||
{
|
||||
m_reuseableDynamicTextures = new Cache(CacheMedium.Memory, CacheStrategy.Conservative);
|
||||
m_reuseableDynamicTextures.DefaultTTL = new TimeSpan(24, 0, 0);
|
||||
}
|
||||
|
||||
#region IDynamicTextureManager Members
|
||||
|
||||
public void RegisterRender(string handleType, IDynamicTextureRender render)
|
||||
@@ -323,17 +335,30 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture
|
||||
|
||||
#endregion
|
||||
|
||||
#region IRegionModule Members
|
||||
#region ISharedRegionModule Members
|
||||
|
||||
public void Initialise(Scene scene, IConfigSource config)
|
||||
public void Initialise(IConfigSource config)
|
||||
{
|
||||
IConfig texturesConfig = config.Configs["Textures"];
|
||||
if (texturesConfig != null)
|
||||
{
|
||||
ReuseTextures = texturesConfig.GetBoolean("ReuseDynamicTextures", false);
|
||||
ReuseLowDataTextures = texturesConfig.GetBoolean("ReuseDynamicLowDataTextures", false);
|
||||
}
|
||||
|
||||
if (ReuseTextures)
|
||||
{
|
||||
m_reuseableDynamicTextures = new Cache(CacheMedium.Memory, CacheStrategy.Conservative);
|
||||
m_reuseableDynamicTextures.DefaultTTL = new TimeSpan(24, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
{
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
if (!RegisteredScenes.ContainsKey(scene.RegionInfo.RegionID))
|
||||
{
|
||||
RegisteredScenes.Add(scene.RegionInfo.RegionID, scene);
|
||||
@@ -341,13 +366,14 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture
|
||||
}
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
if (ReuseTextures)
|
||||
{
|
||||
m_reuseableDynamicTextures = new Cache(CacheMedium.Memory, CacheStrategy.Conservative);
|
||||
m_reuseableDynamicTextures.DefaultTTL = new TimeSpan(24, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
if (RegisteredScenes.ContainsKey(scene.RegionInfo.RegionID))
|
||||
RegisteredScenes.Remove(scene.RegionInfo.RegionID);
|
||||
}
|
||||
|
||||
public void Close()
|
||||
@@ -359,9 +385,9 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture
|
||||
get { return "DynamicTextureModule"; }
|
||||
}
|
||||
|
||||
public bool IsSharedModule
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return true; }
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -37,10 +37,12 @@ using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using Mono.Addins;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.Scripting.EmailModules
|
||||
{
|
||||
public class EmailModule : IRegionModule, IEmailModule
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "EmailModule")]
|
||||
public class EmailModule : ISharedRegionModule, IEmailModule
|
||||
{
|
||||
//
|
||||
// Log
|
||||
@@ -72,31 +74,9 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules
|
||||
|
||||
private bool m_Enabled = false;
|
||||
|
||||
public void InsertEmail(UUID to, Email email)
|
||||
{
|
||||
// It's tempting to create the queue here. Don't; objects which have
|
||||
// not yet called GetNextEmail should have no queue, and emails to them
|
||||
// should be silently dropped.
|
||||
#region ISharedRegionModule
|
||||
|
||||
lock (m_MailQueues)
|
||||
{
|
||||
if (m_MailQueues.ContainsKey(to))
|
||||
{
|
||||
if (m_MailQueues[to].Count >= m_MaxQueueSize)
|
||||
{
|
||||
// fail silently
|
||||
return;
|
||||
}
|
||||
|
||||
lock (m_MailQueues[to])
|
||||
{
|
||||
m_MailQueues[to].Add(email);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Initialise(Scene scene, IConfigSource config)
|
||||
public void Initialise(IConfigSource config)
|
||||
{
|
||||
m_Config = config;
|
||||
IConfig SMTPConfig;
|
||||
@@ -129,36 +109,44 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules
|
||||
SMTP_SERVER_PORT = SMTPConfig.GetInt("SMTP_SERVER_PORT", SMTP_SERVER_PORT);
|
||||
SMTP_SERVER_LOGIN = SMTPConfig.GetString("SMTP_SERVER_LOGIN", SMTP_SERVER_LOGIN);
|
||||
SMTP_SERVER_PASSWORD = SMTPConfig.GetString("SMTP_SERVER_PASSWORD", SMTP_SERVER_PASSWORD);
|
||||
m_MaxEmailSize = SMTPConfig.GetInt("email_max_size", m_MaxEmailSize);
|
||||
m_MaxEmailSize = SMTPConfig.GetInt("email_max_size", m_MaxEmailSize);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.Error("[EMAIL] DefaultEmailModule not configured: "+ e.Message);
|
||||
m_log.Error("[EMAIL] DefaultEmailModule not configured: " + e.Message);
|
||||
m_Enabled = false;
|
||||
return;
|
||||
}
|
||||
|
||||
// It's a go!
|
||||
if (m_Enabled)
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
if (!m_Enabled)
|
||||
return;
|
||||
|
||||
// It's a go!
|
||||
lock (m_Scenes)
|
||||
{
|
||||
lock (m_Scenes)
|
||||
// Claim the interface slot
|
||||
scene.RegisterModuleInterface<IEmailModule>(this);
|
||||
|
||||
// Add to scene list
|
||||
if (m_Scenes.ContainsKey(scene.RegionInfo.RegionHandle))
|
||||
{
|
||||
// Claim the interface slot
|
||||
scene.RegisterModuleInterface<IEmailModule>(this);
|
||||
|
||||
// Add to scene list
|
||||
if (m_Scenes.ContainsKey(scene.RegionInfo.RegionHandle))
|
||||
{
|
||||
m_Scenes[scene.RegionInfo.RegionHandle] = scene;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Scenes.Add(scene.RegionInfo.RegionHandle, scene);
|
||||
}
|
||||
m_Scenes[scene.RegionInfo.RegionHandle] = scene;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Scenes.Add(scene.RegionInfo.RegionHandle, scene);
|
||||
}
|
||||
|
||||
m_log.Info("[EMAIL] Activated DefaultEmailModule");
|
||||
}
|
||||
|
||||
m_log.Info("[EMAIL] Activated DefaultEmailModule");
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
@@ -174,9 +162,39 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules
|
||||
get { return "DefaultEmailModule"; }
|
||||
}
|
||||
|
||||
public bool IsSharedModule
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return true; }
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public void InsertEmail(UUID to, Email email)
|
||||
{
|
||||
// It's tempting to create the queue here. Don't; objects which have
|
||||
// not yet called GetNextEmail should have no queue, and emails to them
|
||||
// should be silently dropped.
|
||||
|
||||
lock (m_MailQueues)
|
||||
{
|
||||
if (m_MailQueues.ContainsKey(to))
|
||||
{
|
||||
if (m_MailQueues[to].Count >= m_MaxQueueSize)
|
||||
{
|
||||
// fail silently
|
||||
return;
|
||||
}
|
||||
|
||||
lock (m_MailQueues[to])
|
||||
{
|
||||
m_MailQueues[to].Add(email);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private bool IsLocal(UUID objectID)
|
||||
|
||||
@@ -41,6 +41,7 @@ using OpenSim.Framework.Servers;
|
||||
using OpenSim.Framework.Servers.HttpServer;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using Mono.Addins;
|
||||
|
||||
/*****************************************************
|
||||
*
|
||||
@@ -87,7 +88,8 @@ using OpenSim.Region.Framework.Scenes;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
|
||||
{
|
||||
public class HttpRequestModule : IRegionModule, IHttpRequestModule
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "HttpRequestModule")]
|
||||
public class HttpRequestModule : ISharedRegionModule, IHttpRequestModule
|
||||
{
|
||||
private object HttpListLock = new object();
|
||||
private int httpTimeout = 30000;
|
||||
@@ -270,24 +272,38 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
|
||||
|
||||
#endregion
|
||||
|
||||
#region IRegionModule Members
|
||||
#region ISharedRegionModule Members
|
||||
|
||||
public void Initialise(Scene scene, IConfigSource config)
|
||||
public void Initialise(IConfigSource config)
|
||||
{
|
||||
m_scene = scene;
|
||||
|
||||
m_scene.RegisterModuleInterface<IHttpRequestModule>(this);
|
||||
|
||||
m_proxyurl = config.Configs["Startup"].GetString("HttpProxy");
|
||||
m_proxyexcepts = config.Configs["Startup"].GetString("HttpProxyExceptions");
|
||||
|
||||
m_pendingRequests = new Dictionary<UUID, HttpRequestClass>();
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
m_scene = scene;
|
||||
|
||||
m_scene.RegisterModuleInterface<IHttpRequestModule>(this);
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
scene.UnregisterModuleInterface<IHttpRequestModule>(this);
|
||||
if (scene == m_scene)
|
||||
m_scene = null;
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
{
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
}
|
||||
@@ -297,9 +313,9 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
|
||||
get { return m_name; }
|
||||
}
|
||||
|
||||
public bool IsSharedModule
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return true; }
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -37,10 +37,12 @@ using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using log4net;
|
||||
using System.Reflection;
|
||||
using Mono.Addins;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.Scripting.LoadImageURL
|
||||
{
|
||||
public class LoadImageURLModule : IRegionModule, IDynamicTextureRender
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "LoadImageURLModule")]
|
||||
public class LoadImageURLModule : ISharedRegionModule, IDynamicTextureRender
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
@@ -104,22 +106,32 @@ namespace OpenSim.Region.CoreModules.Scripting.LoadImageURL
|
||||
|
||||
#endregion
|
||||
|
||||
#region IRegionModule Members
|
||||
#region ISharedRegionModule Members
|
||||
|
||||
public void Initialise(Scene scene, IConfigSource config)
|
||||
public void Initialise(IConfigSource config)
|
||||
{
|
||||
if (m_scene == null)
|
||||
{
|
||||
m_scene = scene;
|
||||
}
|
||||
|
||||
m_proxyurl = config.Configs["Startup"].GetString("HttpProxy");
|
||||
m_proxyexcepts = config.Configs["Startup"].GetString("HttpProxyExceptions");
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
{
|
||||
if (m_scene != null)
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
if (m_scene == null)
|
||||
m_scene = scene;
|
||||
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
if (m_textureManager == null && m_scene == scene)
|
||||
{
|
||||
m_textureManager = m_scene.RequestModuleInterface<IDynamicTextureManager>();
|
||||
if (m_textureManager != null)
|
||||
@@ -138,9 +150,9 @@ namespace OpenSim.Region.CoreModules.Scripting.LoadImageURL
|
||||
get { return m_name; }
|
||||
}
|
||||
|
||||
public bool IsSharedModule
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return true; }
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -172,6 +184,12 @@ namespace OpenSim.Region.CoreModules.Scripting.LoadImageURL
|
||||
|
||||
private void HttpRequestReturn(IAsyncResult result)
|
||||
{
|
||||
if (m_textureManager == null)
|
||||
{
|
||||
m_log.WarnFormat("[LOADIMAGEURLMODULE]: No texture manager. Can't function.");
|
||||
return;
|
||||
}
|
||||
|
||||
RequestState state = (RequestState) result.AsyncState;
|
||||
WebRequest request = (WebRequest) state.Request;
|
||||
Stream stream = null;
|
||||
|
||||
@@ -40,12 +40,14 @@ using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using log4net;
|
||||
using System.Reflection;
|
||||
using Mono.Addins;
|
||||
|
||||
//using Cairo;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.Scripting.VectorRender
|
||||
{
|
||||
public class VectorRenderModule : IRegionModule, IDynamicTextureRender
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "VectorRenderModule")]
|
||||
public class VectorRenderModule : ISharedRegionModule, IDynamicTextureRender
|
||||
{
|
||||
// These fields exist for testing purposes, please do not remove.
|
||||
// private static bool s_flipper;
|
||||
@@ -56,6 +58,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender
|
||||
|
||||
private Scene m_scene;
|
||||
private IDynamicTextureManager m_textureManager;
|
||||
|
||||
private Graphics m_graph;
|
||||
private string m_fontName = "Arial";
|
||||
|
||||
@@ -103,6 +106,11 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender
|
||||
|
||||
public bool AsyncConvertData(UUID id, string bodyData, string extraParams)
|
||||
{
|
||||
if (m_textureManager == null)
|
||||
{
|
||||
m_log.Warn("[VECTORRENDERMODULE]: No texture manager. Can't function");
|
||||
return false;
|
||||
}
|
||||
// XXX: This isn't actually being done asynchronously!
|
||||
m_textureManager.ReturnData(id, ConvertData(bodyData, extraParams));
|
||||
|
||||
@@ -131,45 +139,49 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender
|
||||
|
||||
#endregion
|
||||
|
||||
#region IRegionModule Members
|
||||
#region ISharedRegionModule Members
|
||||
|
||||
public void Initialise(Scene scene, IConfigSource config)
|
||||
public void Initialise(IConfigSource config)
|
||||
{
|
||||
if (m_scene == null)
|
||||
{
|
||||
m_scene = scene;
|
||||
}
|
||||
|
||||
if (m_graph == null)
|
||||
{
|
||||
// We won't dispose of these explicitly since this module is only removed when the entire simulator
|
||||
// is shut down.
|
||||
Bitmap bitmap = new Bitmap(1024, 1024, PixelFormat.Format32bppArgb);
|
||||
m_graph = Graphics.FromImage(bitmap);
|
||||
}
|
||||
|
||||
IConfig cfg = config.Configs["VectorRender"];
|
||||
if (null != cfg)
|
||||
{
|
||||
m_fontName = cfg.GetString("font_name", m_fontName);
|
||||
}
|
||||
m_log.DebugFormat("[VECTORRENDERMODULE]: using font \"{0}\" for text rendering.", m_fontName);
|
||||
|
||||
// We won't dispose of these explicitly since this module is only removed when the entire simulator
|
||||
// is shut down.
|
||||
Bitmap bitmap = new Bitmap(1024, 1024, PixelFormat.Format32bppArgb);
|
||||
m_graph = Graphics.FromImage(bitmap);
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
{
|
||||
m_textureManager = m_scene.RequestModuleInterface<IDynamicTextureManager>();
|
||||
if (m_textureManager != null)
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
if (m_scene == null)
|
||||
{
|
||||
m_textureManager.RegisterRender(GetContentType(), this);
|
||||
m_scene = scene;
|
||||
}
|
||||
}
|
||||
|
||||
// This code exists for testing purposes, please do not remove.
|
||||
// s_asset1Data = m_scene.AssetService.Get("00000000-0000-1111-9999-000000000001").Data;
|
||||
// s_asset1Data = m_scene.AssetService.Get("9f4acf0d-1841-4e15-bdb8-3a12efc9dd8f").Data;
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
if (m_textureManager == null && m_scene == scene)
|
||||
{
|
||||
m_textureManager = m_scene.RequestModuleInterface<IDynamicTextureManager>();
|
||||
if (m_textureManager != null)
|
||||
{
|
||||
m_textureManager.RegisterRender(GetContentType(), this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Terrain dirt - smallest bin/assets file (6004 bytes)
|
||||
// s_asset2Data = m_scene.AssetService.Get("b8d3965a-ad78-bf43-699b-bff8eca6c975").Data;
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
}
|
||||
|
||||
public void Close()
|
||||
@@ -181,9 +193,9 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender
|
||||
get { return "VectorRenderModule"; }
|
||||
}
|
||||
|
||||
public bool IsSharedModule
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return true; }
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -40,6 +40,7 @@ using OpenSim.Framework.Servers;
|
||||
using OpenSim.Framework.Servers.HttpServer;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using Mono.Addins;
|
||||
|
||||
/*****************************************************
|
||||
*
|
||||
@@ -76,7 +77,8 @@ using OpenSim.Region.Framework.Scenes;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.Scripting.XMLRPC
|
||||
{
|
||||
public class XMLRPCModule : IRegionModule, IXMLRPC
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "XMLRPCModule")]
|
||||
public class XMLRPCModule : ISharedRegionModule, IXMLRPC
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
@@ -86,6 +88,10 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC
|
||||
private Dictionary<UUID, RPCChannelInfo> m_openChannels;
|
||||
private Dictionary<UUID, SendRemoteDataRequest> m_pendingSRDResponses;
|
||||
private int m_remoteDataPort = 0;
|
||||
public int Port
|
||||
{
|
||||
get { return m_remoteDataPort; }
|
||||
}
|
||||
|
||||
private Dictionary<UUID, RPCRequestInfo> m_rpcPending;
|
||||
private Dictionary<UUID, RPCRequestInfo> m_rpcPendingResponses;
|
||||
@@ -94,34 +100,24 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC
|
||||
private int RemoteReplyScriptWait = 300;
|
||||
private object XMLRPCListLock = new object();
|
||||
|
||||
#region IRegionModule Members
|
||||
#region ISharedRegionModule Members
|
||||
|
||||
public void Initialise(Scene scene, IConfigSource config)
|
||||
public void Initialise(IConfigSource config)
|
||||
{
|
||||
// We need to create these early because the scripts might be calling
|
||||
// But since this gets called for every region, we need to make sure they
|
||||
// get called only one time (or we lose any open channels)
|
||||
if (null == m_openChannels)
|
||||
{
|
||||
m_openChannels = new Dictionary<UUID, RPCChannelInfo>();
|
||||
m_rpcPending = new Dictionary<UUID, RPCRequestInfo>();
|
||||
m_rpcPendingResponses = new Dictionary<UUID, RPCRequestInfo>();
|
||||
m_pendingSRDResponses = new Dictionary<UUID, SendRemoteDataRequest>();
|
||||
m_openChannels = new Dictionary<UUID, RPCChannelInfo>();
|
||||
m_rpcPending = new Dictionary<UUID, RPCRequestInfo>();
|
||||
m_rpcPendingResponses = new Dictionary<UUID, RPCRequestInfo>();
|
||||
m_pendingSRDResponses = new Dictionary<UUID, SendRemoteDataRequest>();
|
||||
|
||||
try
|
||||
{
|
||||
m_remoteDataPort = config.Configs["XMLRPC"].GetInt("XmlRpcPort", m_remoteDataPort);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
try
|
||||
{
|
||||
m_remoteDataPort = config.Configs["XMLRPC"].GetInt("XmlRpcPort", m_remoteDataPort);
|
||||
}
|
||||
|
||||
if (!m_scenes.Contains(scene))
|
||||
catch (Exception)
|
||||
{
|
||||
m_scenes.Add(scene);
|
||||
|
||||
scene.RegisterModuleInterface<IXMLRPC>(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,15 +127,44 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC
|
||||
{
|
||||
// Start http server
|
||||
// Attach xmlrpc handlers
|
||||
// m_log.InfoFormat(
|
||||
// "[XML RPC MODULE]: Starting up XMLRPC Server on port {0} for llRemoteData commands.",
|
||||
// m_remoteDataPort);
|
||||
// m_log.InfoFormat(
|
||||
// "[XML RPC MODULE]: Starting up XMLRPC Server on port {0} for llRemoteData commands.",
|
||||
// m_remoteDataPort);
|
||||
|
||||
IHttpServer httpServer = MainServer.GetHttpServer((uint)m_remoteDataPort);
|
||||
httpServer.AddXmlRPCHandler("llRemoteData", XmlRpcRemoteData);
|
||||
}
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
if (!IsEnabled())
|
||||
return;
|
||||
|
||||
if (!m_scenes.Contains(scene))
|
||||
{
|
||||
m_scenes.Add(scene);
|
||||
|
||||
scene.RegisterModuleInterface<IXMLRPC>(this);
|
||||
}
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
if (!IsEnabled())
|
||||
return;
|
||||
|
||||
if (m_scenes.Contains(scene))
|
||||
{
|
||||
scene.UnregisterModuleInterface<IXMLRPC>(this);
|
||||
m_scenes.Remove(scene);
|
||||
}
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
}
|
||||
@@ -149,14 +174,9 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC
|
||||
get { return m_name; }
|
||||
}
|
||||
|
||||
public bool IsSharedModule
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
public int Port
|
||||
{
|
||||
get { return m_remoteDataPort; }
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -37,13 +37,17 @@ using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using OpenSim.Services.Interfaces;
|
||||
|
||||
using Mono.Addins;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.World.Permissions
|
||||
{
|
||||
public class PermissionsModule : IRegionModule, IPermissionsModule
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "PermissionsModule")]
|
||||
public class PermissionsModule : INonSharedRegionModule, IPermissionsModule
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
protected Scene m_scene;
|
||||
protected bool m_Enabled;
|
||||
|
||||
private InventoryFolderImpl m_libraryRootFolder;
|
||||
protected InventoryFolderImpl LibraryRootFolder
|
||||
@@ -114,18 +118,44 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
||||
private Dictionary<string, bool> GrantVB = new Dictionary<string, bool>();
|
||||
private Dictionary<string, bool> GrantJS = new Dictionary<string, bool>();
|
||||
private Dictionary<string, bool> GrantYP = new Dictionary<string, bool>();
|
||||
|
||||
private IFriendsModule m_friendsModule;
|
||||
private IFriendsModule FriendsModule
|
||||
{
|
||||
get
|
||||
{
|
||||
if (m_friendsModule == null)
|
||||
m_friendsModule = m_scene.RequestModuleInterface<IFriendsModule>();
|
||||
return m_friendsModule;
|
||||
}
|
||||
}
|
||||
private IGroupsModule m_groupsModule;
|
||||
private IMoapModule m_moapModule;
|
||||
private IGroupsModule GroupsModule
|
||||
{
|
||||
get
|
||||
{
|
||||
if (m_groupsModule == null)
|
||||
m_groupsModule = m_scene.RequestModuleInterface<IGroupsModule>();
|
||||
return m_groupsModule;
|
||||
}
|
||||
}
|
||||
|
||||
private IMoapModule m_moapModule;
|
||||
private IMoapModule MoapModule
|
||||
{
|
||||
get
|
||||
{
|
||||
if (m_moapModule == null)
|
||||
m_moapModule = m_scene.RequestModuleInterface<IMoapModule>();
|
||||
return m_moapModule;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region IRegionModule Members
|
||||
#region INonSharedRegionModule Members
|
||||
|
||||
public void Initialise(Scene scene, IConfigSource config)
|
||||
public void Initialise(IConfigSource config)
|
||||
{
|
||||
m_scene = scene;
|
||||
|
||||
IConfig myConfig = config.Configs["Startup"];
|
||||
|
||||
string permissionModules = myConfig.GetString("permissionmodules", "DefaultPermissionsModule");
|
||||
@@ -135,6 +165,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
||||
if (!modules.Contains("DefaultPermissionsModule"))
|
||||
return;
|
||||
|
||||
m_Enabled = true;
|
||||
|
||||
m_allowGridGods = myConfig.GetBoolean("allow_grid_gods", false);
|
||||
m_bypassPermissions = !myConfig.GetBoolean("serverside_object_permissions", true);
|
||||
m_propagatePermissions = myConfig.GetBoolean("propagate_permissions", true);
|
||||
@@ -144,7 +176,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
||||
|
||||
m_SimpleBuildPermissions = myConfig.GetBoolean("simple_build_permissions", false);
|
||||
|
||||
m_allowedScriptCreators
|
||||
m_allowedScriptCreators
|
||||
= ParseUserSetConfigSetting(myConfig, "allowed_script_creators", m_allowedScriptCreators);
|
||||
m_allowedScriptEditors
|
||||
= ParseUserSetConfigSetting(myConfig, "allowed_script_editors", m_allowedScriptEditors);
|
||||
@@ -154,97 +186,31 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
||||
else
|
||||
m_log.Debug("[PERMISSIONS]: Enabling all region service permission checks");
|
||||
|
||||
scene.RegisterModuleInterface<IPermissionsModule>(this);
|
||||
|
||||
//Register functions with Scene External Checks!
|
||||
m_scene.Permissions.OnBypassPermissions += BypassPermissions;
|
||||
m_scene.Permissions.OnSetBypassPermissions += SetBypassPermissions;
|
||||
m_scene.Permissions.OnPropagatePermissions += PropagatePermissions;
|
||||
m_scene.Permissions.OnGenerateClientFlags += GenerateClientFlags;
|
||||
m_scene.Permissions.OnAbandonParcel += CanAbandonParcel;
|
||||
m_scene.Permissions.OnReclaimParcel += CanReclaimParcel;
|
||||
m_scene.Permissions.OnDeedParcel += CanDeedParcel;
|
||||
m_scene.Permissions.OnDeedObject += CanDeedObject;
|
||||
m_scene.Permissions.OnIsGod += IsGod;
|
||||
m_scene.Permissions.OnIsGridGod += IsGridGod;
|
||||
m_scene.Permissions.OnIsAdministrator += IsAdministrator;
|
||||
m_scene.Permissions.OnDuplicateObject += CanDuplicateObject;
|
||||
m_scene.Permissions.OnDeleteObject += CanDeleteObject; //MAYBE FULLY IMPLEMENTED
|
||||
m_scene.Permissions.OnEditObject += CanEditObject; //MAYBE FULLY IMPLEMENTED
|
||||
m_scene.Permissions.OnEditParcelProperties += CanEditParcelProperties; //MAYBE FULLY IMPLEMENTED
|
||||
m_scene.Permissions.OnInstantMessage += CanInstantMessage;
|
||||
m_scene.Permissions.OnInventoryTransfer += CanInventoryTransfer; //NOT YET IMPLEMENTED
|
||||
m_scene.Permissions.OnIssueEstateCommand += CanIssueEstateCommand; //FULLY IMPLEMENTED
|
||||
m_scene.Permissions.OnMoveObject += CanMoveObject; //MAYBE FULLY IMPLEMENTED
|
||||
m_scene.Permissions.OnObjectEntry += CanObjectEntry;
|
||||
m_scene.Permissions.OnReturnObjects += CanReturnObjects; //NOT YET IMPLEMENTED
|
||||
m_scene.Permissions.OnRezObject += CanRezObject; //MAYBE FULLY IMPLEMENTED
|
||||
m_scene.Permissions.OnRunConsoleCommand += CanRunConsoleCommand;
|
||||
m_scene.Permissions.OnRunScript += CanRunScript; //NOT YET IMPLEMENTED
|
||||
m_scene.Permissions.OnCompileScript += CanCompileScript;
|
||||
m_scene.Permissions.OnSellParcel += CanSellParcel;
|
||||
m_scene.Permissions.OnTakeObject += CanTakeObject;
|
||||
m_scene.Permissions.OnTakeCopyObject += CanTakeCopyObject;
|
||||
m_scene.Permissions.OnTerraformLand += CanTerraformLand;
|
||||
m_scene.Permissions.OnLinkObject += CanLinkObject; //NOT YET IMPLEMENTED
|
||||
m_scene.Permissions.OnDelinkObject += CanDelinkObject; //NOT YET IMPLEMENTED
|
||||
m_scene.Permissions.OnBuyLand += CanBuyLand; //NOT YET IMPLEMENTED
|
||||
|
||||
m_scene.Permissions.OnViewNotecard += CanViewNotecard; //NOT YET IMPLEMENTED
|
||||
m_scene.Permissions.OnViewScript += CanViewScript; //NOT YET IMPLEMENTED
|
||||
m_scene.Permissions.OnEditNotecard += CanEditNotecard; //NOT YET IMPLEMENTED
|
||||
m_scene.Permissions.OnEditScript += CanEditScript; //NOT YET IMPLEMENTED
|
||||
|
||||
m_scene.Permissions.OnCreateObjectInventory += CanCreateObjectInventory;
|
||||
m_scene.Permissions.OnEditObjectInventory += CanEditObjectInventory;//MAYBE FULLY IMPLEMENTED
|
||||
m_scene.Permissions.OnCopyObjectInventory += CanCopyObjectInventory; //NOT YET IMPLEMENTED
|
||||
m_scene.Permissions.OnDeleteObjectInventory += CanDeleteObjectInventory; //NOT YET IMPLEMENTED
|
||||
m_scene.Permissions.OnResetScript += CanResetScript;
|
||||
|
||||
m_scene.Permissions.OnCreateUserInventory += CanCreateUserInventory; //NOT YET IMPLEMENTED
|
||||
m_scene.Permissions.OnCopyUserInventory += CanCopyUserInventory; //NOT YET IMPLEMENTED
|
||||
m_scene.Permissions.OnEditUserInventory += CanEditUserInventory; //NOT YET IMPLEMENTED
|
||||
m_scene.Permissions.OnDeleteUserInventory += CanDeleteUserInventory; //NOT YET IMPLEMENTED
|
||||
|
||||
m_scene.Permissions.OnTeleport += CanTeleport; //NOT YET IMPLEMENTED
|
||||
|
||||
m_scene.Permissions.OnControlPrimMedia += CanControlPrimMedia;
|
||||
m_scene.Permissions.OnInteractWithPrimMedia += CanInteractWithPrimMedia;
|
||||
|
||||
m_scene.AddCommand("Users", this, "bypass permissions",
|
||||
"bypass permissions <true / false>",
|
||||
"Bypass permission checks",
|
||||
HandleBypassPermissions);
|
||||
|
||||
m_scene.AddCommand("Users", this, "force permissions",
|
||||
"force permissions <true / false>",
|
||||
"Force permissions on or off",
|
||||
HandleForcePermissions);
|
||||
|
||||
m_scene.AddCommand("Debug", this, "debug permissions",
|
||||
"debug permissions <true / false>",
|
||||
"Turn on permissions debugging",
|
||||
HandleDebugPermissions);
|
||||
|
||||
string grant = myConfig.GetString("GrantLSL","");
|
||||
if (grant.Length > 0) {
|
||||
foreach (string uuidl in grant.Split(',')) {
|
||||
string grant = myConfig.GetString("GrantLSL", "");
|
||||
if (grant.Length > 0)
|
||||
{
|
||||
foreach (string uuidl in grant.Split(','))
|
||||
{
|
||||
string uuid = uuidl.Trim(" \t".ToCharArray());
|
||||
GrantLSL.Add(uuid, true);
|
||||
}
|
||||
}
|
||||
|
||||
grant = myConfig.GetString("GrantCS","");
|
||||
if (grant.Length > 0) {
|
||||
foreach (string uuidl in grant.Split(',')) {
|
||||
grant = myConfig.GetString("GrantCS", "");
|
||||
if (grant.Length > 0)
|
||||
{
|
||||
foreach (string uuidl in grant.Split(','))
|
||||
{
|
||||
string uuid = uuidl.Trim(" \t".ToCharArray());
|
||||
GrantCS.Add(uuid, true);
|
||||
}
|
||||
}
|
||||
|
||||
grant = myConfig.GetString("GrantVB","");
|
||||
if (grant.Length > 0) {
|
||||
foreach (string uuidl in grant.Split(',')) {
|
||||
grant = myConfig.GetString("GrantVB", "");
|
||||
if (grant.Length > 0)
|
||||
{
|
||||
foreach (string uuidl in grant.Split(','))
|
||||
{
|
||||
string uuid = uuidl.Trim(" \t".ToCharArray());
|
||||
GrantVB.Add(uuid, true);
|
||||
}
|
||||
@@ -269,9 +235,119 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
||||
GrantYP.Add(uuid, true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
if (!m_Enabled)
|
||||
return;
|
||||
|
||||
m_scene = scene;
|
||||
|
||||
scene.RegisterModuleInterface<IPermissionsModule>(this);
|
||||
|
||||
//Register functions with Scene External Checks!
|
||||
m_scene.Permissions.OnBypassPermissions += BypassPermissions;
|
||||
m_scene.Permissions.OnSetBypassPermissions += SetBypassPermissions;
|
||||
m_scene.Permissions.OnPropagatePermissions += PropagatePermissions;
|
||||
m_scene.Permissions.OnGenerateClientFlags += GenerateClientFlags;
|
||||
m_scene.Permissions.OnAbandonParcel += CanAbandonParcel;
|
||||
m_scene.Permissions.OnReclaimParcel += CanReclaimParcel;
|
||||
m_scene.Permissions.OnDeedParcel += CanDeedParcel;
|
||||
m_scene.Permissions.OnDeedObject += CanDeedObject;
|
||||
m_scene.Permissions.OnIsGod += IsGod;
|
||||
m_scene.Permissions.OnIsGridGod += IsGridGod;
|
||||
m_scene.Permissions.OnIsAdministrator += IsAdministrator;
|
||||
m_scene.Permissions.OnDuplicateObject += CanDuplicateObject;
|
||||
m_scene.Permissions.OnDeleteObject += CanDeleteObject;
|
||||
m_scene.Permissions.OnEditObject += CanEditObject;
|
||||
m_scene.Permissions.OnEditParcelProperties += CanEditParcelProperties;
|
||||
m_scene.Permissions.OnInstantMessage += CanInstantMessage;
|
||||
m_scene.Permissions.OnInventoryTransfer += CanInventoryTransfer;
|
||||
m_scene.Permissions.OnIssueEstateCommand += CanIssueEstateCommand;
|
||||
m_scene.Permissions.OnMoveObject += CanMoveObject;
|
||||
m_scene.Permissions.OnObjectEntry += CanObjectEntry;
|
||||
m_scene.Permissions.OnReturnObjects += CanReturnObjects;
|
||||
m_scene.Permissions.OnRezObject += CanRezObject;
|
||||
m_scene.Permissions.OnRunConsoleCommand += CanRunConsoleCommand;
|
||||
m_scene.Permissions.OnRunScript += CanRunScript;
|
||||
m_scene.Permissions.OnCompileScript += CanCompileScript;
|
||||
m_scene.Permissions.OnSellParcel += CanSellParcel;
|
||||
m_scene.Permissions.OnTakeObject += CanTakeObject;
|
||||
m_scene.Permissions.OnTakeCopyObject += CanTakeCopyObject;
|
||||
m_scene.Permissions.OnTerraformLand += CanTerraformLand;
|
||||
m_scene.Permissions.OnLinkObject += CanLinkObject;
|
||||
m_scene.Permissions.OnDelinkObject += CanDelinkObject;
|
||||
m_scene.Permissions.OnBuyLand += CanBuyLand;
|
||||
|
||||
m_scene.Permissions.OnViewNotecard += CanViewNotecard;
|
||||
m_scene.Permissions.OnViewScript += CanViewScript;
|
||||
m_scene.Permissions.OnEditNotecard += CanEditNotecard;
|
||||
m_scene.Permissions.OnEditScript += CanEditScript;
|
||||
|
||||
m_scene.Permissions.OnCreateObjectInventory += CanCreateObjectInventory;
|
||||
m_scene.Permissions.OnEditObjectInventory += CanEditObjectInventory;
|
||||
m_scene.Permissions.OnCopyObjectInventory += CanCopyObjectInventory;
|
||||
m_scene.Permissions.OnDeleteObjectInventory += CanDeleteObjectInventory;
|
||||
m_scene.Permissions.OnResetScript += CanResetScript;
|
||||
|
||||
m_scene.Permissions.OnCreateUserInventory += CanCreateUserInventory;
|
||||
m_scene.Permissions.OnCopyUserInventory += CanCopyUserInventory;
|
||||
m_scene.Permissions.OnEditUserInventory += CanEditUserInventory;
|
||||
m_scene.Permissions.OnDeleteUserInventory += CanDeleteUserInventory;
|
||||
|
||||
m_scene.Permissions.OnTeleport += CanTeleport;
|
||||
|
||||
m_scene.Permissions.OnControlPrimMedia += CanControlPrimMedia;
|
||||
m_scene.Permissions.OnInteractWithPrimMedia += CanInteractWithPrimMedia;
|
||||
|
||||
m_scene.AddCommand("Users", this, "bypass permissions",
|
||||
"bypass permissions <true / false>",
|
||||
"Bypass permission checks",
|
||||
HandleBypassPermissions);
|
||||
|
||||
m_scene.AddCommand("Users", this, "force permissions",
|
||||
"force permissions <true / false>",
|
||||
"Force permissions on or off",
|
||||
HandleForcePermissions);
|
||||
|
||||
m_scene.AddCommand("Debug", this, "debug permissions",
|
||||
"debug permissions <true / false>",
|
||||
"Turn on permissions debugging",
|
||||
HandleDebugPermissions);
|
||||
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
if (!m_Enabled)
|
||||
return;
|
||||
|
||||
m_scene.UnregisterModuleInterface<IPermissionsModule>(this);
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get { return "PermissionsModule"; }
|
||||
}
|
||||
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Console command handlers
|
||||
|
||||
public void HandleBypassPermissions(string module, string[] args)
|
||||
{
|
||||
if (m_scene.ConsoleScene() != null &&
|
||||
@@ -290,7 +366,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
||||
m_bypassPermissions = val;
|
||||
|
||||
m_log.InfoFormat(
|
||||
"[PERMISSIONS]: Set permissions bypass to {0} for {1}",
|
||||
"[PERMISSIONS]: Set permissions bypass to {0} for {1}",
|
||||
m_bypassPermissions, m_scene.RegionInfo.RegionName);
|
||||
}
|
||||
}
|
||||
@@ -343,39 +419,6 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
||||
}
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
{
|
||||
m_friendsModule = m_scene.RequestModuleInterface<IFriendsModule>();
|
||||
|
||||
if (m_friendsModule == null)
|
||||
m_log.Debug("[PERMISSIONS]: Friends module not found, friend permissions will not work");
|
||||
|
||||
m_groupsModule = m_scene.RequestModuleInterface<IGroupsModule>();
|
||||
|
||||
if (m_groupsModule == null)
|
||||
m_log.Debug("[PERMISSIONS]: Groups module not found, group permissions will not work");
|
||||
|
||||
m_moapModule = m_scene.RequestModuleInterface<IMoapModule>();
|
||||
|
||||
// This log line will be commented out when no longer required for debugging
|
||||
// if (m_moapModule == null)
|
||||
// m_log.Warn("[PERMISSIONS]: Media on a prim module not found, media on a prim permissions will not work");
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get { return "DefaultPermissionsModule"; }
|
||||
}
|
||||
|
||||
public bool IsSharedModule
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Helper Functions
|
||||
@@ -400,10 +443,10 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
||||
/// <returns></returns>
|
||||
protected bool IsGroupMember(UUID groupID, UUID userID, ulong powers)
|
||||
{
|
||||
if (null == m_groupsModule)
|
||||
if (null == GroupsModule)
|
||||
return false;
|
||||
|
||||
GroupMembershipData gmd = m_groupsModule.GetMembershipData(groupID, userID);
|
||||
GroupMembershipData gmd = GroupsModule.GetMembershipData(groupID, userID);
|
||||
|
||||
if (gmd != null)
|
||||
{
|
||||
@@ -503,10 +546,10 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
||||
if (user == UUID.Zero)
|
||||
return false;
|
||||
|
||||
if (m_friendsModule == null)
|
||||
if (FriendsModule == null)
|
||||
return false;
|
||||
|
||||
int friendPerms = m_friendsModule.GetRightsGrantedByFriend(user, objectOwner);
|
||||
int friendPerms = FriendsModule.GetRightsGrantedByFriend(user, objectOwner);
|
||||
return (friendPerms & (int)FriendRights.CanModifyObjects) != 0;
|
||||
}
|
||||
|
||||
@@ -1915,14 +1958,14 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
||||
// "[PERMISSONS]: Performing CanControlPrimMedia check with agentID {0}, primID {1}, face {2}",
|
||||
// agentID, primID, face);
|
||||
|
||||
if (null == m_moapModule)
|
||||
if (null == MoapModule)
|
||||
return false;
|
||||
|
||||
SceneObjectPart part = m_scene.GetSceneObjectPart(primID);
|
||||
if (null == part)
|
||||
return false;
|
||||
|
||||
MediaEntry me = m_moapModule.GetMediaEntry(part, face);
|
||||
MediaEntry me = MoapModule.GetMediaEntry(part, face);
|
||||
|
||||
// If there is no existing media entry then it can be controlled (in this context, created).
|
||||
if (null == me)
|
||||
@@ -1941,14 +1984,14 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
||||
// "[PERMISSONS]: Performing CanInteractWithPrimMedia check with agentID {0}, primID {1}, face {2}",
|
||||
// agentID, primID, face);
|
||||
|
||||
if (null == m_moapModule)
|
||||
if (null == MoapModule)
|
||||
return false;
|
||||
|
||||
SceneObjectPart part = m_scene.GetSceneObjectPart(primID);
|
||||
if (null == part)
|
||||
return false;
|
||||
|
||||
MediaEntry me = m_moapModule.GetMediaEntry(part, face);
|
||||
MediaEntry me = MoapModule.GetMediaEntry(part, face);
|
||||
|
||||
// If there is no existing media entry then it can be controlled (in this context, created).
|
||||
if (null == me)
|
||||
|
||||
Reference in New Issue
Block a user