From 74b3ce857228ae948d99ad4b6ef35f35e7742b2c Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 16 Jan 2010 04:57:49 +0000 Subject: Let monitor data be requested using either the short form of the name or the full, namespace qualified version. --- OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs b/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs index 96d65d7..f15f8f6 100644 --- a/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs +++ b/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs @@ -87,7 +87,10 @@ namespace OpenSim.Region.CoreModules.Framework.Monitoring foreach (IMonitor monitor in m_monitors) { - if (monitor.ToString() == monID) + string elemName = monitor.ToString(); + if (elemName.StartsWith(monitor.GetType().Namespace)) + elemName = elemName.Substring(monitor.GetType().Namespace.Length + 1); + if (elemName == monID || monitor.ToString() == monID) { Hashtable ereply3 = new Hashtable(); -- cgit v1.1 From 3ff28e7a8f6a7816dd76307c36153ba8f393dea1 Mon Sep 17 00:00:00 2001 From: CasperW Date: Mon, 18 Jan 2010 17:56:27 +0100 Subject: Fix a major security problem with osSetDynamicTexture which allowed the deletion of /any/ asset. --- .../Scripting/DynamicTexture/DynamicTextureModule.cs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs index f51d0c2..679c871 100644 --- a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs @@ -358,11 +358,18 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture // tmptex.DefaultTexture.Fullbright = true; part.UpdateTexture(tmptex); - } - - if (oldID != UUID.Zero && ((Disp & DISP_EXPIRE) != 0)) - { - scene.AssetService.Delete(oldID.ToString()); + } + + if (oldID != UUID.Zero && ((Disp & DISP_EXPIRE) != 0)) + { + if (oldAsset == null) oldAsset = scene.AssetService.Get(oldID.ToString()); + if (oldAsset != null) + { + if (oldAsset.Temporary == true) + { + scene.AssetService.Delete(oldID.ToString()); + } + } } } -- cgit v1.1 From 5f5fdc36248788b97c1283f65e2188fa1d60a361 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 22 Jan 2010 16:22:23 +0000 Subject: Allow oar loading to work even if an estate module is not present Write bare bones unit test for region setting loads --- .../World/Archiver/ArchiveReadRequest.cs | 6 +- .../World/Archiver/Tests/ArchiverTests.cs | 70 ++++++++++++++++++++++ 2 files changed, 74 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index 52add23..8ed1913 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs @@ -423,9 +423,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver currentRegionSettings.TerrainTexture4 = loadedRegionSettings.TerrainTexture4; currentRegionSettings.UseEstateSun = loadedRegionSettings.UseEstateSun; currentRegionSettings.WaterHeight = loadedRegionSettings.WaterHeight; - + IEstateModule estateModule = m_scene.RequestModuleInterface(); - estateModule.sendRegionHandshakeToAll(); + + if (estateModule != null) + estateModule.sendRegionHandshakeToAll(); return true; } diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs index edac4a4..4f7a137 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs @@ -36,6 +36,7 @@ using OpenMetaverse; using OpenSim.Framework; using OpenSim.Framework.Communications.Cache; using OpenSim.Framework.Serialization; +using OpenSim.Framework.Serialization.External; using OpenSim.Region.CoreModules.World.Serialiser; using OpenSim.Region.CoreModules.World.Terrain; using OpenSim.Region.Framework.Scenes; @@ -270,6 +271,75 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests } /// + /// Test loading the region settings of a V0.2 OpenSim Region Archive. + /// + [Test] + public void TestLoadOarV0_2RegionSettings() + { + TestHelper.InMethod(); + //log4net.Config.XmlConfigurator.Configure(); + + SerialiserModule serialiserModule = new SerialiserModule(); + ArchiverModule archiverModule = new ArchiverModule(); + Scene scene = SceneSetupHelpers.SetupScene(); + SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); + + MemoryStream archiveWriteStream = new MemoryStream(); + TarArchiveWriter tar = new TarArchiveWriter(archiveWriteStream); + + tar.WriteDir(ArchiveConstants.TERRAINS_PATH); + tar.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, ArchiveWriteRequestExecution.Create0p2ControlFile()); + + RegionSettings rs = new RegionSettings(); + rs.AgentLimit = 17; + rs.AllowDamage = true; + rs.AllowLandJoinDivide = true; + rs.AllowLandResell = true; + rs.BlockFly = true; + rs.BlockShowInSearch = true; + rs.BlockTerraform = true; + rs.DisableCollisions = true; + rs.DisablePhysics = true; + rs.DisableScripts = true; + rs.Elevation1NW = 15.9; + rs.Elevation1NE = 45.3; + rs.Elevation1SE = 49; + rs.Elevation1SW = 1.9; + rs.Elevation2NW = 4.5; + rs.Elevation2NE = 19.2; + rs.Elevation2SE = 9.2; + rs.Elevation2SW = 2.1; + rs.FixedSun = true; + rs.ObjectBonus = 1.4; + rs.RestrictPushing = true; + rs.TerrainLowerLimit = 0.4; + rs.TerrainRaiseLimit = 17.9; + rs.TerrainTexture1 = UUID.Parse("00000000-0000-0000-0000-000000000020"); + rs.TerrainTexture2 = UUID.Parse("00000000-0000-0000-0000-000000000040"); + rs.TerrainTexture3 = UUID.Parse("00000000-0000-0000-0000-000000000060"); + rs.TerrainTexture4 = UUID.Parse("00000000-0000-0000-0000-000000000080"); + rs.UseEstateSun = true; + rs.WaterHeight = 23; + + tar.WriteFile(ArchiveConstants.SETTINGS_PATH + "region1.xml", RegionSettingsSerializer.Serialize(rs)); + + tar.Close(); + + MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray()); + + lock (this) + { + scene.EventManager.OnOarFileLoaded += LoadCompleted; + archiverModule.DearchiveRegion(archiveReadStream); + } + + Assert.That(m_lastErrorMessage, Is.Null); + RegionSettings loadedRs = scene.RegionInfo.RegionSettings; + + Assert.That(loadedRs.AgentLimit, Is.EqualTo(17)); + } + + /// /// Test merging a V0.2 OpenSim Region Archive into an existing scene /// //[Test] -- cgit v1.1 From a0e4665077748430ebcb7c02917036fc59794975 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 22 Jan 2010 17:17:25 +0000 Subject: complete assertion checks of all other oar loaded region settings --- .../World/Archiver/Tests/ArchiverTests.cs | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs index 4f7a137..9e9cedd 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs @@ -337,6 +337,34 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests RegionSettings loadedRs = scene.RegionInfo.RegionSettings; Assert.That(loadedRs.AgentLimit, Is.EqualTo(17)); + Assert.That(loadedRs.AllowDamage, Is.True); + Assert.That(loadedRs.AllowLandJoinDivide, Is.True); + Assert.That(loadedRs.AllowLandResell, Is.True); + Assert.That(loadedRs.BlockFly, Is.True); + Assert.That(loadedRs.BlockShowInSearch, Is.True); + Assert.That(loadedRs.BlockTerraform, Is.True); + Assert.That(loadedRs.DisableCollisions, Is.True); + Assert.That(loadedRs.DisablePhysics, Is.True); + Assert.That(loadedRs.DisableScripts, Is.True); + Assert.That(loadedRs.Elevation1NW, Is.EqualTo(15.9)); + Assert.That(loadedRs.Elevation1NE, Is.EqualTo(45.3)); + Assert.That(loadedRs.Elevation1SE, Is.EqualTo(49)); + Assert.That(loadedRs.Elevation1SW, Is.EqualTo(1.9)); + Assert.That(loadedRs.Elevation2NW, Is.EqualTo(4.5)); + Assert.That(loadedRs.Elevation2NE, Is.EqualTo(19.2)); + Assert.That(loadedRs.Elevation2SE, Is.EqualTo(9.2)); + Assert.That(loadedRs.Elevation2SW, Is.EqualTo(2.1)); + Assert.That(loadedRs.FixedSun, Is.True); + Assert.That(loadedRs.ObjectBonus, Is.EqualTo(1.4)); + Assert.That(loadedRs.RestrictPushing, Is.True); + Assert.That(loadedRs.TerrainLowerLimit, Is.EqualTo(0.4)); + Assert.That(loadedRs.TerrainRaiseLimit, Is.EqualTo(17.9)); + Assert.That(loadedRs.TerrainTexture1, Is.EqualTo(UUID.Parse("00000000-0000-0000-0000-000000000020"))); + Assert.That(loadedRs.TerrainTexture2, Is.EqualTo(UUID.Parse("00000000-0000-0000-0000-000000000040"))); + Assert.That(loadedRs.TerrainTexture3, Is.EqualTo(UUID.Parse("00000000-0000-0000-0000-000000000060"))); + Assert.That(loadedRs.TerrainTexture4, Is.EqualTo(UUID.Parse("00000000-0000-0000-0000-000000000080"))); + Assert.That(loadedRs.UseEstateSun, Is.True); + Assert.That(loadedRs.WaterHeight, Is.EqualTo(23)); } /// -- cgit v1.1 From 1df69be9a6d7a1c7c0a5446c11fe9fde2c2b88f7 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 22 Jan 2010 20:32:34 +0000 Subject: Add first part of test for checking restore of task inventory items on oar load Passes but not yet complete --- .../World/Archiver/Tests/ArchiverTests.cs | 50 ++++++++++++++++++++- .../World/Archiver/Tests/Resources/test-sound.wav | Bin 0 -> 211648 bytes 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100755 OpenSim/Region/CoreModules/World/Archiver/Tests/Resources/test-sound.wav (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs index 9e9cedd..1200105 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs @@ -215,7 +215,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests // Also check that direct entries which will also have a file entry containing that directory doesn't // upset load tar.WriteDir(ArchiveConstants.TERRAINS_PATH); - + tar.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, ArchiveWriteRequestExecution.Create0p2ControlFile()); string part1Name = "object1"; @@ -235,6 +235,45 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests UUID.Zero, shape, groupPosition, rotationOffset, offsetPosition); part1.Name = part1Name; SceneObjectGroup object1 = new SceneObjectGroup(part1); + + // Let's put some inventory items into our object + UUID soundItemUuid = UUID.Parse("00000000-0000-0000-0000-000000000002"); + Type type = GetType(); + Assembly assembly = type.Assembly; + string soundDataResourceName = null; + string[] names = assembly.GetManifestResourceNames(); + foreach (string name in names) + { + if (name.EndsWith(".Resources.test-sound.wav")) + soundDataResourceName = name; + } + Assert.That(soundDataResourceName, Is.Not.Null); + + byte[] soundData; + Console.WriteLine("Loading " + soundDataResourceName); + using (Stream resource = assembly.GetManifestResourceStream(soundDataResourceName)) + { + using (BinaryReader br = new BinaryReader(resource)) + { + // FIXME: Use the inspector insteadthere are so many forums and lists already, though admittedly none of them are suitable for cross virtual-enivornemnt discussion + soundData = br.ReadBytes(99999999); + UUID soundUuid = UUID.Parse("00000000-0000-0000-0000-000000000001"); + string soundAssetFileName + = ArchiveConstants.ASSETS_PATH + soundUuid + + ArchiveConstants.ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.SoundWAV]; + tar.WriteFile(soundAssetFileName, soundData); + + /* + AssetBase soundAsset = AssetHelpers.CreateAsset(soundUuid, soundData); + scene.AssetService.Store(soundAsset); + asset1FileName = ArchiveConstants.ASSETS_PATH + soundUuid + ".wav"; + */ + + TaskInventoryItem item1 = new TaskInventoryItem { AssetID = soundUuid, ItemID = soundItemUuid }; + part1.Inventory.AddInventoryItem(item1, true); + } + } + scene.AddNewSceneObject(object1, false); string object1FileName = string.Format( @@ -266,6 +305,15 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests Assert.That( object1PartLoaded.OffsetPosition, Is.EqualTo(offsetPosition), "object1 offset position not equal"); + // Need to implement a method to get the task inventory item by name (since the uuid will have changed on load) + /* + TaskInventoryItem loadedSoundItem = object1PartLoaded.Inventory.GetInventoryItem(soundItemUuid); + Assert.That(loadedSoundItem, Is.Not.Null, "loaded sound item was null"); + AssetBase loadedSoundAsset = scene.AssetService.Get(loadedSoundItem.AssetID.ToString()); + Assert.That(loadedSoundAsset, Is.Not.Null, "loaded sound asset was null"); + Assert.That(loadedSoundAsset.Data, Is.EqualTo(soundData), "saved and loaded sound data do not match"); + */ + // Temporary Console.WriteLine("Successfully completed {0}", MethodBase.GetCurrentMethod()); } diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/Resources/test-sound.wav b/OpenSim/Region/CoreModules/World/Archiver/Tests/Resources/test-sound.wav new file mode 100755 index 0000000..b45ee54 Binary files /dev/null and b/OpenSim/Region/CoreModules/World/Archiver/Tests/Resources/test-sound.wav differ -- cgit v1.1 From ec3c31e61e5e540f822891110df9bc978655bbaf Mon Sep 17 00:00:00 2001 From: Revolution Date: Fri, 22 Jan 2010 18:09:33 -0600 Subject: Updates all IRegionModules to the new style region modules. Signed-off-by: Melanie --- .../AssetTransaction/AssetTransactionModule.cs | 35 +++- .../Agent/Capabilities/CapabilitiesModule.cs | 2 +- .../Region/CoreModules/Agent/IPBan/IPBanModule.cs | 40 ++-- .../Agent/TextureDownload/TextureDownloadModule.cs | 33 +++- .../Agent/TextureSender/J2KDecoderModule.cs | 33 +++- .../Region/CoreModules/Agent/Xfer/XferModule.cs | 30 ++- .../Avatar/AvatarFactory/AvatarFactoryModule.cs | 29 ++- .../CoreModules/Avatar/Combat/CombatModule.cs | 32 +++- .../CoreModules/Avatar/Dialog/DialogModule.cs | 32 +++- .../CoreModules/Avatar/Friends/FriendsModule.cs | 54 ++++-- .../CoreModules/Avatar/Gestures/GesturesModule.cs | 30 ++- .../Region/CoreModules/Avatar/Gods/GodsModule.cs | 28 ++- .../CoreModules/Avatar/Groups/GroupsModule.cs | 35 +++- .../Avatar/InstantMessage/InstantMessageModule.cs | 53 ++++-- .../Avatar/InstantMessage/MessageTransferModule.cs | 54 ++++-- .../Avatar/InstantMessage/MuteListModule.cs | 48 +++-- .../Avatar/InstantMessage/OfflineMessageModule.cs | 76 +++++--- .../Avatar/InstantMessage/PresenceModule.cs | 61 ++++-- .../Inventory/Archiver/InventoryArchiverModule.cs | 35 +++- .../Inventory/Transfer/InventoryTransferModule.cs | 63 ++++-- .../Region/CoreModules/Avatar/Lure/LureModule.cs | 61 ++++-- .../CoreModules/Avatar/ObjectCaps/ObjectAdd.cs | 55 ++++-- .../Avatar/Profiles/AvatarProfilesModule.cs | 32 ++-- .../Framework/EventQueue/EventQueueGetModule.cs | 40 ++-- .../Framework/Monitoring/MonitorModule.cs | 103 ++++++---- .../Hypergrid/HGStandaloneLoginModule.cs | 83 +++++--- OpenSim/Region/CoreModules/InterGrid/OGSRadmin.cs | 31 +-- .../InterGrid/OpenGridProtocolModule.cs | 100 ++++++---- .../DynamicTexture/DynamicTextureModule.cs | 60 ++++-- .../Scripting/EMailModules/EmailModule.cs | 32 +++- .../Scripting/HttpRequest/ScriptsHttpRequests.cs | 36 ++-- .../CoreModules/Scripting/LSLHttp/UrlModule.cs | 2 + .../Scripting/LoadImageURL/LoadImageURLModule.cs | 37 ++-- .../Scripting/VectorRender/VectorRenderModule.cs | 41 ++-- .../Scripting/WorldComm/WorldCommModule.cs | 37 ++-- .../CoreModules/Scripting/XMLRPC/XMLRPCModule.cs | 51 ++++- .../Asset/AssetServiceInConnectorModule.cs | 2 +- .../Grid/HypergridServiceInConnectorModule.cs | 2 +- .../Inventory/InventoryServiceInConnectorModule.cs | 2 +- .../Land/LandServiceInConnectorModule.cs | 2 +- .../Neighbour/NeighbourServiceInConnectorModule.cs | 2 +- .../SimulationServiceInConnectorModule.cs | 2 +- .../Interregion/LocalInterregionComms.cs | 4 +- .../Interregion/RESTInterregionComms.cs | 16 +- .../CoreModules/World/Archiver/ArchiverModule.cs | 1 + .../Region/CoreModules/World/Cloud/CloudModule.cs | 30 ++- .../World/Estate/EstateManagementModule.cs | 58 +++--- .../World/Permissions/PermissionsModule.cs | 212 +++++++++++++-------- .../Region/CoreModules/World/Sound/SoundModule.cs | 33 +++- OpenSim/Region/CoreModules/World/Sun/SunModule.cs | 96 +++++----- .../World/Vegetation/VegetationModule.cs | 27 ++- .../Region/CoreModules/World/Wind/WindModule.cs | 45 +++-- .../CoreModules/World/WorldMap/MapImageModule.cs | 30 ++- .../CoreModules/World/WorldMap/MapSearchModule.cs | 35 +++- 54 files changed, 1492 insertions(+), 711 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs index 1077f4a..7012037 100644 --- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs +++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs @@ -27,6 +27,7 @@ using System; using System.Collections.Generic; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -35,7 +36,8 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Agent.AssetTransaction { - public class AssetTransactionModule : IRegionModule, IAgentAssetTransactions + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class AssetTransactionModule : ISharedRegionModule, IAgentAssetTransactions { private readonly Dictionary RegisteredScenes = new Dictionary(); private bool m_dumpAssetsToFile = false; @@ -59,9 +61,14 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction //m_log.Debug("creating AgentAssetTransactionModule"); } - #region IRegionModule Members + #region ISharedRegionModule Members - public void Initialise(Scene scene, IConfigSource config) + public void Initialise(IConfigSource config) + { + + } + + public void AddRegion(Scene scene) { if (!RegisteredScenes.ContainsKey(scene.RegionInfo.RegionID)) { @@ -79,6 +86,23 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction m_scene = scene; } + public Type ReplaceableInterface + { + get { return null; } + } + + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + if (RegisteredScenes.ContainsKey(scene.RegionInfo.RegionID)) + RegisteredScenes.Remove(scene.RegionInfo.RegionID); + scene.UnregisterModuleInterface(this); + scene.EventManager.OnNewClient -= NewClient; + } + public void PostInitialise() { } @@ -92,11 +116,6 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction get { return "AgentTransactionModule"; } } - public bool IsSharedModule - { - get { return true; } - } - #endregion public void NewClient(IClientAPI client) diff --git a/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs b/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs index 2a1355b..886173f 100644 --- a/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs +++ b/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs @@ -69,7 +69,7 @@ namespace OpenSim.Region.CoreModules.Agent.Capabilities public void RemoveRegion(Scene scene) { - m_scene.UnregisterModuleInterface(this); + scene.UnregisterModuleInterface(this); } public void PostInitialise() {} diff --git a/OpenSim/Region/CoreModules/Agent/IPBan/IPBanModule.cs b/OpenSim/Region/CoreModules/Agent/IPBan/IPBanModule.cs index bfe2a71..f7f2eff 100644 --- a/OpenSim/Region/CoreModules/Agent/IPBan/IPBanModule.cs +++ b/OpenSim/Region/CoreModules/Agent/IPBan/IPBanModule.cs @@ -29,6 +29,7 @@ using System; using System.Collections.Generic; using System.IO; using System.Text; +using Mono.Addins; using Nini.Config; using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; @@ -36,21 +37,27 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Agent.IPBan { - public class IPBanModule : IRegionModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class IPBanModule : ISharedRegionModule { - #region Implementation of IRegionModule + #region Implementation of ISharedRegionModule private List m_bans = new List(); + private Dictionary SceneBanners = new Dictionary(); - public void Initialise(Scene scene, IConfigSource source) + public void Initialise(IConfigSource source) { - new SceneBanner(scene, m_bans); + } + + public void AddRegion(Scene scene) + { + SceneBanners.Add(scene, new SceneBanner(scene, m_bans)); lock (m_bans) { foreach (EstateBan ban in scene.RegionInfo.EstateSettings.EstateBans) { - if (!String.IsNullOrEmpty(ban.BannedHostIPMask)) + if (!String.IsNullOrEmpty(ban.BannedHostIPMask)) m_bans.Add(ban.BannedHostIPMask); if (!String.IsNullOrEmpty(ban.BannedHostNameMask)) m_bans.Add(ban.BannedHostNameMask); @@ -58,7 +65,12 @@ namespace OpenSim.Region.CoreModules.Agent.IPBan } } - public void PostInitialise() + public Type ReplaceableInterface + { + get { return null; } + } + + public void RegionLoaded(Scene scene) { if (File.Exists("bans.txt")) { @@ -70,19 +82,23 @@ namespace OpenSim.Region.CoreModules.Agent.IPBan } } - public void Close() + public void RemoveRegion(Scene scene) { - + if(SceneBanners.ContainsKey(scene)) + SceneBanners.Remove(scene); } - public string Name + public void PostInitialise() + { + } + + public void Close() { - get { return "IPBanModule"; } } - public bool IsSharedModule + public string Name { - get { return true; } + get { return "IPBanModule"; } } #endregion diff --git a/OpenSim/Region/CoreModules/Agent/TextureDownload/TextureDownloadModule.cs b/OpenSim/Region/CoreModules/Agent/TextureDownload/TextureDownloadModule.cs index 71ff28c..c4d84cb 100644 --- a/OpenSim/Region/CoreModules/Agent/TextureDownload/TextureDownloadModule.cs +++ b/OpenSim/Region/CoreModules/Agent/TextureDownload/TextureDownloadModule.cs @@ -30,6 +30,7 @@ using System.Collections.Generic; using System.Reflection; using System.Threading; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -41,7 +42,8 @@ using OpenSim.Services.Interfaces; namespace OpenSim.Region.CoreModules.Agent.TextureDownload { - public class TextureDownloadModule : IRegionModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class TextureDownloadModule : INonSharedRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -65,11 +67,14 @@ namespace OpenSim.Region.CoreModules.Agent.TextureDownload { } - #region IRegionModule Members + #region INonSharedRegionModule Members - public void Initialise(Scene scene, IConfigSource config) + public void Initialise(IConfigSource config) + { + } + + public void AddRegion(Scene scene) { - if (m_scene == null) { //m_log.Debug("Creating Texture download module"); @@ -90,22 +95,30 @@ namespace OpenSim.Region.CoreModules.Agent.TextureDownload } } - public void PostInitialise() + public Type ReplaceableInterface { + get { return null; } } - public void Close() + public void RegionLoaded(Scene scene) { } - public string Name + public void RemoveRegion(Scene scene) { - get { return "TextureDownloadModule"; } + if(m_scenes.Contains(scene)) + m_scenes.Remove(scene); + scene.EventManager.OnNewClient -= NewClient; + scene.EventManager.OnRemovePresence -= EventManager_OnRemovePresence; } - public bool IsSharedModule + public void Close() + { + } + + public string Name { - get { return false; } + get { return "TextureDownloadModule"; } } #endregion diff --git a/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs b/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs index 7ac8bed..ff87493 100644 --- a/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs +++ b/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs @@ -32,6 +32,7 @@ using System.Reflection; using System.Text; using System.Threading; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenMetaverse.Imaging; @@ -45,7 +46,8 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender { public delegate void J2KDecodeDelegate(UUID assetID); - public class J2KDecoderModule : IRegionModule, IJ2KDecoder + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class J2KDecoderModule : ISharedRegionModule, IJ2KDecoder { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -58,16 +60,19 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender /// Reference to a scene (doesn't matter which one as long as it can load the cache module) private Scene m_scene; - #region IRegionModule + #region ISharedRegionModule public string Name { get { return "J2KDecoderModule"; } } - public bool IsSharedModule { get { return true; } } - + public J2KDecoderModule() { } - public void Initialise(Scene scene, IConfigSource source) + public void Initialise(IConfigSource source) + { + } + + public void AddRegion(Scene scene) { if (m_scene == null) m_scene = scene; @@ -75,16 +80,30 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender scene.RegisterModuleInterface(this); } - public void PostInitialise() + public Type ReplaceableInterface + { + get { return null; } + } + + public void RegionLoaded(Scene scene) { m_cache = m_scene.RequestModuleInterface(); } + public void RemoveRegion(Scene scene) + { + scene.UnregisterModuleInterface(this); + } + + public void PostInitialise() + { + } + public void Close() { } - #endregion IRegionModule + #endregion #region IJ2KDecoder diff --git a/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs b/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs index ef7dce8..d062361 100644 --- a/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs +++ b/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs @@ -27,6 +27,7 @@ using System; using System.Collections.Generic; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -35,7 +36,8 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Agent.Xfer { - public class XferModule : IRegionModule, IXfer + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class XferModule : INonSharedRegionModule, IXfer { private Scene m_scene; private Dictionary Requests = new Dictionary(); @@ -52,9 +54,13 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer public DateTime timeStamp; } - #region IRegionModule Members + #region INonSharedRegionModule Members - public void Initialise(Scene scene, IConfigSource config) + public void Initialise(IConfigSource config) + { + } + + public void AddRegion(Scene scene) { m_scene = scene; m_scene.EventManager.OnNewClient += NewClient; @@ -62,22 +68,28 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer m_scene.RegisterModuleInterface(this); } - public void PostInitialise() + public Type ReplaceableInterface { + get { return null; } } - public void Close() + public void RegionLoaded(Scene scene) { } - public string Name + public void RemoveRegion(Scene scene) { - get { return "XferModule"; } + scene.EventManager.OnNewClient -= NewClient; + scene.UnregisterModuleInterface(this); } - public bool IsSharedModule + public void Close() + { + } + + public string Name { - get { return false; } + get { return "XferModule"; } } #endregion diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index 35c59aa..6bbbd56 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs @@ -28,6 +28,7 @@ using System; using System.Reflection; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -38,7 +39,8 @@ using OpenSim.Services.Interfaces; namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory { - public class AvatarFactoryModule : IAvatarFactory, IRegionModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class AvatarFactoryModule : IAvatarFactory, ISharedRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private Scene m_scene = null; @@ -75,7 +77,16 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory return appearance; } - public void Initialise(Scene scene, IConfigSource source) + public void Initialise(IConfigSource source) + { + } + + public Type ReplaceableInterface + { + get { return null; } + } + + public void AddRegion(Scene scene) { scene.RegisterModuleInterface(this); scene.EventManager.OnNewClient += NewClient; @@ -84,9 +95,18 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory { m_scene = scene; } + } + public void RegionLoaded(Scene scene) + { } + public void RemoveRegion(Scene scene) + { + scene.UnregisterModuleInterface(this); + scene.EventManager.OnNewClient -= NewClient; + } + public void PostInitialise() { } @@ -100,11 +120,6 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory get { return "Default Avatar Factory"; } } - public bool IsSharedModule - { - get { return false; } - } - public void NewClient(IClientAPI client) { client.OnAvatarNowWearing += AvatarIsWearing; diff --git a/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs b/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs index 61b6d65..b7d12aa 100644 --- a/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs @@ -27,6 +27,7 @@ using System; using System.Collections.Generic; +using Mono.Addins; using Nini.Config; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; @@ -34,7 +35,8 @@ using OpenMetaverse; namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule { - public class CombatModule : IRegionModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class CombatModule : ISharedRegionModule { //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -53,7 +55,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule /// /// /// - public void Initialise(Scene scene, IConfigSource config) + public void Initialise(IConfigSource config) + { + + } + + public Type ReplaceableInterface + { + get { return null; } + } + + public void AddRegion(Scene scene) { lock (m_scenel) { @@ -71,6 +83,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule scene.EventManager.OnAvatarEnteringNewParcel += AvatarEnteringParcel; } + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + scene.EventManager.OnAvatarKilled -= KillAvatar; + scene.EventManager.OnAvatarEnteringNewParcel -= AvatarEnteringParcel; + m_scenel.Remove(scene.RegionInfo.RegionHandle); + } + public void PostInitialise() { } @@ -84,11 +107,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule get { return "CombatModule"; } } - public bool IsSharedModule - { - get { return true; } - } - private void KillAvatar(uint killerObjectLocalID, ScenePresence DeadAvatar) { if (killerObjectLocalID == 0) diff --git a/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs b/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs index 72ec869..ecffc7a 100644 --- a/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs @@ -25,9 +25,11 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +using System; using System.Collections.Generic; using System.Reflection; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -37,28 +39,46 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Avatar.Dialog { - public class DialogModule : IRegionModule, IDialogModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class DialogModule : ISharedRegionModule, IDialogModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); protected Scene m_scene; - public void Initialise(Scene scene, IConfigSource source) + public void Initialise(IConfigSource source) + { + } + + public Type ReplaceableInterface + { + get { return null; } + } + + public void AddRegion(Scene scene) { m_scene = scene; m_scene.RegisterModuleInterface(this); - + m_scene.AddCommand( this, "alert", "alert ", "Send an alert to a user", HandleAlertConsoleCommand); m_scene.AddCommand( this, "alert general", "alert general ", "Send an alert to everyone", HandleAlertConsoleCommand); } - - public void PostInitialise() {} + + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + scene.UnregisterModuleInterface(this); + } + + public void PostInitialise() { } public void Close() {} public string Name { get { return "Dialog Module"; } } - public bool IsSharedModule { get { return false; } } public void SendAlertToUser(IClientAPI client, string message) { diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index 086d4fe..7254180 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs @@ -31,6 +31,7 @@ using System.Collections.Generic; using System.Net; using System.Reflection; using log4net; +using Mono.Addins; using Nini.Config; using Nwc.XmlRpc; using OpenMetaverse; @@ -81,7 +82,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends - Terminate Friendship messages (single) */ - public class FriendsModule : IRegionModule, IFriendsModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class FriendsModule : ISharedRegionModule, IFriendsModule { private class Transaction { @@ -111,9 +113,23 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends private IGridService m_gridServices = null; - #region IRegionModule Members + #region ISharedRegionModule Members - public void Initialise(Scene scene, IConfigSource config) + public void Initialise(IConfigSource config) + { + + } + + public void PostInitialise() + { + } + + public Type ReplaceableInterface + { + get { return null; } + } + + public void AddRegion(Scene scene) { lock (m_scenes) { @@ -128,9 +144,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends if (!m_scenes.ContainsKey(scene.RegionInfo.RegionHandle)) m_scenes[scene.RegionInfo.RegionHandle] = scene; } - + scene.RegisterModuleInterface(this); - + scene.EventManager.OnNewClient += OnNewClient; scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage; scene.EventManager.OnAvatarEnteringNewParcel += AvatarEnteringParcel; @@ -138,29 +154,41 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends scene.EventManager.OnClientClosed += ClientClosed; } - public void PostInitialise() + public void RegionLoaded(Scene scene) { if (m_scenes.Count > 0) { - m_TransferModule = m_initialScene.RequestModuleInterface(); - m_gridServices = m_initialScene.GridService; + m_TransferModule = scene.RequestModuleInterface(); + m_gridServices = scene.GridService; } if (m_TransferModule == null) m_log.Error("[FRIENDS]: Unable to find a message transfer module, friendship offers will not work"); } - public void Close() + public void RemoveRegion(Scene scene) { + MainServer.Instance.RemoveXmlRPCHandler("presence_update_bulk"); + MainServer.Instance.RemoveXmlRPCHandler("terminate_friend"); + + if (m_scenes.ContainsKey(scene.RegionInfo.RegionHandle)) + m_scenes.Remove(scene.RegionInfo.RegionHandle); + + scene.UnregisterModuleInterface(this); + + scene.EventManager.OnNewClient -= OnNewClient; + scene.EventManager.OnIncomingInstantMessage -= OnGridInstantMessage; + scene.EventManager.OnAvatarEnteringNewParcel -= AvatarEnteringParcel; + scene.EventManager.OnMakeChildAgent -= MakeChildAgent; + scene.EventManager.OnClientClosed -= ClientClosed; } - public string Name + public void Close() { - get { return "FriendsModule"; } } - public bool IsSharedModule + public string Name { - get { return true; } + get { return "FriendsModule"; } } #endregion diff --git a/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs b/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs index 8ce5092..c306f94 100644 --- a/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs @@ -25,8 +25,10 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +using System; using System.Reflection; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -37,23 +39,41 @@ using OpenSim.Services.Interfaces; namespace OpenSim.Region.CoreModules.Avatar.Gestures { - public class GesturesModule : IRegionModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class GesturesModule : INonSharedRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); protected Scene m_scene; - public void Initialise(Scene scene, IConfigSource source) + public void Initialise(IConfigSource source) + { + } + + public Type ReplaceableInterface + { + get { return null; } + } + + public void AddRegion(Scene scene) { m_scene = scene; - m_scene.EventManager.OnNewClient += OnNewClient; } + + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + if(m_scene == scene) + m_scene = null; + scene.EventManager.OnNewClient -= OnNewClient; + } - public void PostInitialise() {} public void Close() {} public string Name { get { return "Gestures Module"; } } - public bool IsSharedModule { get { return false; } } private void OnNewClient(IClientAPI client) { diff --git a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs index 50171a3..3914f2e 100644 --- a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs @@ -25,7 +25,9 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +using System; using System.Collections.Generic; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -34,7 +36,8 @@ using OpenSim.Region.Framework.Interfaces; namespace OpenSim.Region.CoreModules.Avatar.Gods { - public class GodsModule : IRegionModule, IGodsModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class GodsModule : INonSharedRegionModule, IGodsModule { /// Special UUID for actions that apply to all agents private static readonly UUID ALL_AGENTS = new UUID("44e87126-e794-4ded-05b3-7c42da3d5cdb"); @@ -42,17 +45,34 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods protected Scene m_scene; protected IDialogModule m_dialogModule; - public void Initialise(Scene scene, IConfigSource source) + public void Initialise(IConfigSource source) + { + + } + + public Type ReplaceableInterface + { + get { return null; } + } + + public void AddRegion(Scene scene) { m_scene = scene; m_dialogModule = m_scene.RequestModuleInterface(); m_scene.RegisterModuleInterface(this); } + + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + scene.UnregisterModuleInterface(this); + } - public void PostInitialise() {} public void Close() {} public string Name { get { return "Gods Module"; } } - public bool IsSharedModule { get { return false; } } public void RequestGodlikePowers( UUID agentID, UUID sessionID, UUID token, bool godLike, IClientAPI controllingClient) diff --git a/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs b/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs index 31363e5..7ff8d30 100644 --- a/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs @@ -25,9 +25,11 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +using System; using System.Collections.Generic; using System.Reflection; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -36,7 +38,8 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Avatar.Groups { - public class GroupsModule : IRegionModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class GroupsModule : ISharedRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -55,9 +58,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Groups private static GroupMembershipData osGroup = new GroupMembershipData(); - #region IRegionModule Members + #region ISharedRegionModule Members - public void Initialise(Scene scene, IConfigSource config) + public void Initialise(IConfigSource config) { IConfig groupsConfig = config.Configs["Groups"]; @@ -76,7 +79,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Groups if (groupsConfig.GetString("Module", "Default") != "Default") return; } + } + + public Type ReplaceableInterface + { + get { return null; } + } + public void AddRegion(Scene scene) + { lock (m_SceneList) { if (!m_SceneList.Contains(scene)) @@ -99,6 +110,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Groups scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage; } + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + if (m_SceneList.Contains(scene)) + m_SceneList.Remove(scene); + scene.EventManager.OnNewClient -= OnNewClient; + scene.EventManager.OnClientClosed -= OnClientClosed; + scene.EventManager.OnIncomingInstantMessage -= OnGridInstantMessage; + } + public void PostInitialise() { } @@ -123,11 +147,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Groups get { return "GroupsModule"; } } - public bool IsSharedModule - { - get { return true; } - } - #endregion private void OnNewClient(IClientAPI client) diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs index 9a68749..e1bde4b 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs @@ -24,9 +24,12 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + +using System; using System.Collections.Generic; using System.Reflection; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -36,7 +39,8 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Avatar.InstantMessage { - public class InstantMessageModule : IRegionModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class InstantMessageModule : ISharedRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -47,11 +51,11 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage private readonly List m_scenes = new List(); - #region IRegionModule Members + #region ISharedRegionModule Members private IMessageTransferModule m_TransferModule = null; - public void Initialise(Scene scene, IConfigSource config) + public void Initialise(IConfigSource config) { if (config.Configs["Messaging"] != null) { @@ -62,7 +66,15 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage } m_enabled = true; + } + + public Type ReplaceableInterface + { + get { return null; } + } + public void AddRegion(Scene scene) + { lock (m_scenes) { if (!m_scenes.Contains(scene)) @@ -74,6 +86,27 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage } } + public void RegionLoaded(Scene scene) + { + if (!m_enabled) + return; + + m_TransferModule = + m_scenes[0].RequestModuleInterface(); + + if (m_TransferModule == null) + m_log.Error("[INSTANT MESSAGE]: No message transfer module, " + + "IM will not work!"); + } + + public void RemoveRegion(Scene scene) + { + if (m_scenes.Contains(scene)) + m_scenes.Remove(scene); + scene.EventManager.OnClientConnect -= OnClientConnect; + scene.EventManager.OnIncomingInstantMessage -= OnGridInstantMessage; + } + void OnClientConnect(IClientCore client) { IClientIM clientIM; @@ -85,15 +118,6 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage public void PostInitialise() { - if (!m_enabled) - return; - - m_TransferModule = - m_scenes[0].RequestModuleInterface(); - - if (m_TransferModule == null) - m_log.Error("[INSTANT MESSAGE]: No message transfer module, "+ - "IM will not work!"); } public void Close() @@ -105,11 +129,6 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage get { return "InstantMessageModule"; } } - public bool IsSharedModule - { - get { return true; } - } - #endregion public void OnInstantMessage(IClientAPI client, GridInstantMessage im) diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs index e5159b3..16bdfdd 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs @@ -30,6 +30,7 @@ using System.Collections.Generic; using System.Net; using System.Reflection; using log4net; +using Mono.Addins; using Nini.Config; using Nwc.XmlRpc; using OpenMetaverse; @@ -40,7 +41,8 @@ using GridRegion = OpenSim.Services.Interfaces.GridRegion; namespace OpenSim.Region.CoreModules.Avatar.InstantMessage { - public class MessageTransferModule : IRegionModule, IMessageTransferModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class MessageTransferModule : ISharedRegionModule, IMessageTransferModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -50,8 +52,9 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage protected Dictionary m_UserRegionMap = new Dictionary(); public event UndeliveredMessage OnUndeliveredMessage; + private bool m_enabled = true; - public virtual void Initialise(Scene scene, IConfigSource config) + public virtual void Initialise(IConfigSource config) { IConfig cnf = config.Configs["Messaging"]; if (cnf != null && cnf.GetString( @@ -59,29 +62,51 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage "MessageTransferModule") { m_log.Debug("[MESSAGE TRANSFER]: Disabled by configuration"); - return; + m_enabled = false; } cnf = config.Configs["Startup"]; if (cnf != null) m_Gridmode = cnf.GetBoolean("gridmode", false); + } - // m_Enabled = true; + public Type ReplaceableInterface + { + get { return null; } + } - lock (m_Scenes) + public void AddRegion(Scene scene) + { + if (m_enabled) { - if (m_Scenes.Count == 0) + lock (m_Scenes) { - MainServer.Instance.AddXmlRPCHandler( - "grid_instant_message", processXMLRPCGridInstantMessage); - } + if (m_Scenes.Count == 0) + { + MainServer.Instance.AddXmlRPCHandler( + "grid_instant_message", processXMLRPCGridInstantMessage); + } - m_log.Debug("[MESSAGE TRANSFER]: Message transfer module active"); - scene.RegisterModuleInterface(this); - m_Scenes.Add(scene); + m_log.Debug("[MESSAGE TRANSFER]: Message transfer module active"); + scene.RegisterModuleInterface(this); + m_Scenes.Add(scene); + } } } + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + if (m_Scenes.Contains(scene)) + m_Scenes.Remove(scene); + MainServer.Instance.RemoveXmlRPCHandler( + "grid_instant_message"); + scene.UnregisterModuleInterface(this); + } + public virtual void PostInitialise() { } @@ -95,11 +120,6 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage get { return "MessageTransferModule"; } } - public virtual bool IsSharedModule - { - get { return true; } - } - public virtual void SendInstantMessage(GridInstantMessage im, MessageResultNotification result) { UUID toAgentID = new UUID(im.toAgentID); diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs index 2d4a635..3570495 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs @@ -28,6 +28,7 @@ using System; using System.Collections.Generic; using System.Reflection; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -39,7 +40,8 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Avatar.MuteList { - public class MuteListModule : IRegionModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class MuteListModule : ISharedRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -47,7 +49,7 @@ namespace OpenSim.Region.CoreModules.Avatar.MuteList private List m_SceneList = new List(); private string m_RestURL = String.Empty; - public void Initialise(Scene scene, IConfigSource config) + public void Initialise(IConfigSource config) { if (!enabled) return; @@ -66,19 +68,24 @@ namespace OpenSim.Region.CoreModules.Avatar.MuteList enabled = false; return; } + m_RestURL = cnf.GetString("MuteListURL", ""); + if (m_RestURL == "") + { + m_log.Error("[MUTE LIST] Module was enabled, but no URL is given, disabling"); + enabled = false; + return; + } + } + public Type ReplaceableInterface + { + get { return null; } + } + + public void AddRegion(Scene scene) + { lock (m_SceneList) { - if (m_SceneList.Count == 0) - { - m_RestURL = cnf.GetString("MuteListURL", ""); - if (m_RestURL == "") - { - m_log.Error("[MUTE LIST] Module was enabled, but no URL is given, disabling"); - enabled = false; - return; - } - } if (!m_SceneList.Contains(scene)) m_SceneList.Add(scene); @@ -86,6 +93,18 @@ namespace OpenSim.Region.CoreModules.Avatar.MuteList } } + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + if (m_SceneList.Contains(scene)) + m_SceneList.Remove(scene); + + scene.EventManager.OnNewClient -= OnNewClient; + } + public void PostInitialise() { if (!enabled) @@ -102,11 +121,6 @@ namespace OpenSim.Region.CoreModules.Avatar.MuteList get { return "MuteListModule"; } } - public bool IsSharedModule - { - get { return true; } - } - public void Close() { } diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs index 450897c..6c4d0bf 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs @@ -28,6 +28,7 @@ using System; using System.Collections.Generic; using System.Reflection; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -40,7 +41,8 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Avatar.InstantMessage { - public class OfflineMessageModule : IRegionModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class OfflineMessageModule : ISharedRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -49,7 +51,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage private string m_RestURL = String.Empty; private bool m_ForwardOfflineGroupMessages = true; - public void Initialise(Scene scene, IConfigSource config) + public void Initialise(IConfigSource config) { if (!enabled) return; @@ -83,14 +85,23 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage return; } } - if (!m_SceneList.Contains(scene)) - m_SceneList.Add(scene); - - scene.EventManager.OnNewClient += OnNewClient; } } - public void PostInitialise() + public Type ReplaceableInterface + { + get { return null; } + } + + public void AddRegion(Scene scene) + { + if (!m_SceneList.Contains(scene)) + m_SceneList.Add(scene); + + scene.EventManager.OnNewClient += OnNewClient; + } + + public void RegionLoaded(Scene scene) { if (!enabled) return; @@ -120,16 +131,22 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage m_log.Debug("[OFFLINE MESSAGING] Offline messages enabled"); } - public string Name + public void RemoveRegion(Scene scene) { - get { return "OfflineMessageModule"; } + if (m_SceneList.Contains(scene)) + m_SceneList.Remove(scene); + scene.EventManager.OnNewClient -= OnNewClient; } - public bool IsSharedModule + public void PostInitialise() + { + } + + public string Name { - get { return true; } + get { return "OfflineMessageModule"; } } - + public void Close() { } @@ -163,24 +180,27 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage private void RetrieveInstantMessages(IClientAPI client) { - m_log.DebugFormat("[OFFLINE MESSAGING] Retrieving stored messages for {0}", client.AgentId); + if (m_RestURL != "") + { + m_log.DebugFormat("[OFFLINE MESSAGING] Retrieving stored messages for {0}", client.AgentId); - Listmsglist = SynchronousRestObjectPoster.BeginPostObject>( - "POST", m_RestURL+"/RetrieveMessages/", client.AgentId); + List msglist = SynchronousRestObjectPoster.BeginPostObject>( + "POST", m_RestURL + "/RetrieveMessages/", client.AgentId); - foreach (GridInstantMessage im in msglist) - { - // client.SendInstantMessage(im); - - // Send through scene event manager so all modules get a chance - // to look at this message before it gets delivered. - // - // Needed for proper state management for stored group - // invitations - // - Scene s = FindScene(client.AgentId); - if (s != null) - s.EventManager.TriggerIncomingInstantMessage(im); + foreach (GridInstantMessage im in msglist) + { + // client.SendInstantMessage(im); + + // Send through scene event manager so all modules get a chance + // to look at this message before it gets delivered. + // + // Needed for proper state management for stored group + // invitations + // + Scene s = FindScene(client.AgentId); + if (s != null) + s.EventManager.TriggerIncomingInstantMessage(im); + } } } diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs index f5ab454..f5498f4 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs @@ -24,11 +24,14 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + +using System; using System.Collections; using System.Collections.Generic; using System.Net; using System.Reflection; using log4net; +using Mono.Addins; using Nini.Config; using Nwc.XmlRpc; using OpenMetaverse; @@ -39,7 +42,8 @@ using GridRegion = OpenSim.Services.Interfaces.GridRegion; namespace OpenSim.Region.CoreModules.Avatar.InstantMessage { - public class PresenceModule : IRegionModule, IPresenceModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class PresenceModule : ISharedRegionModule, IPresenceModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -59,7 +63,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage public event PresenceChange OnPresenceChange; public event BulkPresenceData OnBulkPresenceData; - public void Initialise(Scene scene, IConfigSource config) + public void Initialise(IConfigSource config) { lock (m_Scenes) { @@ -78,28 +82,38 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage m_Gridmode = cnf.GetBoolean("gridmode", false); m_Enabled = true; - - m_initialScene = scene; } + } + } + + public Type ReplaceableInterface + { + get { return null; } + } + public void AddRegion(Scene scene) + { + if (m_Enabled) + { + m_initialScene = scene; if (m_Gridmode) NotifyMessageServerOfStartup(scene); m_Scenes.Add(scene); - } - scene.RegisterModuleInterface(this); + scene.RegisterModuleInterface(this); - scene.EventManager.OnNewClient += OnNewClient; - scene.EventManager.OnSetRootAgentScene += OnSetRootAgentScene; - scene.EventManager.OnMakeChildAgent += OnMakeChildAgent; + scene.EventManager.OnNewClient += OnNewClient; + scene.EventManager.OnSetRootAgentScene += OnSetRootAgentScene; + scene.EventManager.OnMakeChildAgent += OnMakeChildAgent; + } } - public void PostInitialise() + public void RegionLoaded(Scene scene) { } - public void Close() + public void RemoveRegion(Scene scene) { if (!m_Gridmode || !m_Enabled) return; @@ -116,21 +130,28 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage } } - lock (m_Scenes) - { - foreach (Scene scene in m_Scenes) - NotifyMessageServerOfShutdown(scene); - } + NotifyMessageServerOfShutdown(scene); + if(m_Scenes.Contains(scene)) + m_Scenes.Remove(scene); + + scene.UnregisterModuleInterface(this); + + scene.EventManager.OnNewClient -= OnNewClient; + scene.EventManager.OnSetRootAgentScene -= OnSetRootAgentScene; + scene.EventManager.OnMakeChildAgent -= OnMakeChildAgent; } - public string Name + public void PostInitialise() { - get { return "PresenceModule"; } } - public bool IsSharedModule + public void Close() { - get { return true; } + } + + public string Name + { + get { return "PresenceModule"; } } public void RequestBulkPresenceData(UUID[] users) diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs index ecd60bd..a04ab22 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs @@ -30,6 +30,7 @@ using System.Collections.Generic; using System.IO; using System.Reflection; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -41,10 +42,11 @@ using OpenSim.Services.Interfaces; namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver { + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] /// /// This module loads and saves OpenSimulator inventory archives /// - public class InventoryArchiverModule : IRegionModule, IInventoryArchiverModule + public class InventoryArchiverModule : ISharedRegionModule, IInventoryArchiverModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -82,18 +84,28 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver DisablePresenceChecks = disablePresenceChecks; } - public void Initialise(Scene scene, IConfigSource source) + public void Initialise(IConfigSource source) + { + + } + + public Type ReplaceableInterface + { + get { return null; } + } + + public void AddRegion(Scene scene) { if (m_scenes.Count == 0) { scene.RegisterModuleInterface(this); OnInventoryArchiveSaved += SaveInvConsoleCommandCompleted; - + scene.AddCommand( this, "load iar", "load iar []", - "Load user inventory archive.", HandleLoadInvConsoleCommand); - + "Load user inventory archive.", HandleLoadInvConsoleCommand); + scene.AddCommand( this, "save iar", "save iar []", @@ -101,10 +113,21 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver m_aScene = scene; } - + m_scenes[scene.RegionInfo.RegionID] = scene; } + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + scene.UnregisterModuleInterface(this); + if(m_scenes.ContainsKey(scene.RegionInfo.RegionID)) + m_scenes.Remove(scene.RegionInfo.RegionID); + } + public void PostInitialise() {} public void Close() {} diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs index d9a021f..44906b4 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs @@ -29,6 +29,7 @@ using System; using System.Collections.Generic; using System.Reflection; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -39,7 +40,8 @@ using OpenSim.Services.Interfaces; namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer { - public class InventoryTransferModule : IInventoryTransferModule, IRegionModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class InventoryTransferModule : IInventoryTransferModule, ISharedRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -50,10 +52,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer new Dictionary(); private IMessageTransferModule m_TransferModule = null; + private bool m_enabled = true; - #region IRegionModule Members + #region ISharedRegionModule Members - public void Initialise(Scene scene, IConfigSource config) + public void Initialise(IConfigSource config) { if (config.Configs["Messaging"] != null) { @@ -62,31 +65,61 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer if (config.Configs["Messaging"].GetString( "InventoryTransferModule", "InventoryTransferModule") != "InventoryTransferModule") - return; + m_enabled = false; } + } + + public Type ReplaceableInterface + { + get { return null; } + } - if (!m_Scenelist.Contains(scene)) + public void AddRegion(Scene scene) + { + if (m_enabled) { - m_Scenelist.Add(scene); + if (!m_Scenelist.Contains(scene)) + { + m_Scenelist.Add(scene); - scene.RegisterModuleInterface(this); + scene.RegisterModuleInterface(this); - scene.EventManager.OnNewClient += OnNewClient; - scene.EventManager.OnClientClosed += ClientLoggedOut; - scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage; + scene.EventManager.OnNewClient += OnNewClient; + scene.EventManager.OnClientClosed += ClientLoggedOut; + scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage; + } } } - public void PostInitialise() + public void RegionLoaded(Scene scene) { - if (m_Scenelist.Count > 0) + if (m_enabled) { - m_TransferModule = m_Scenelist[0].RequestModuleInterface(); - if (m_TransferModule == null) - m_log.Error("[INVENTORY TRANSFER] No Message transfer module found, transfers will be local only"); + if (m_Scenelist.Count > 0) + { + m_TransferModule = m_Scenelist[0].RequestModuleInterface(); + if (m_TransferModule == null) + m_log.Error("[INVENTORY TRANSFER] No Message transfer module found, transfers will be local only"); + } } } + public void RemoveRegion(Scene scene) + { + if (m_Scenelist.Contains(scene)) + m_Scenelist.Remove(scene); + + scene.UnregisterModuleInterface(this); + + scene.EventManager.OnNewClient -= OnNewClient; + scene.EventManager.OnClientClosed -= ClientLoggedOut; + scene.EventManager.OnIncomingInstantMessage -= OnGridInstantMessage; + } + + public void PostInitialise() + { + } + public void Close() { } diff --git a/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs b/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs index 261bd6c..973d27f 100644 --- a/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs @@ -29,6 +29,7 @@ using System; using System.Collections.Generic; using System.Reflection; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -37,36 +38,72 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Avatar.Lure { - public class LureModule : IRegionModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class LureModule : ISharedRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private readonly List m_scenes = new List(); + private bool m_enabled = true; + private IMessageTransferModule m_TransferModule = null; - public void Initialise(Scene scene, IConfigSource config) + public void Initialise(IConfigSource config) { if (config.Configs["Messaging"] != null) { if (config.Configs["Messaging"].GetString( "LureModule", "LureModule") != "LureModule") - return; + m_enabled = false; } + } + + public Type ReplaceableInterface + { + get { return null; } + } - lock (m_scenes) + public void AddRegion(Scene scene) + { + if (m_enabled) { - if (!m_scenes.Contains(scene)) + lock (m_scenes) { - m_scenes.Add(scene); - scene.EventManager.OnNewClient += OnNewClient; - scene.EventManager.OnIncomingInstantMessage += - OnGridInstantMessage; + if (!m_scenes.Contains(scene)) + { + m_scenes.Add(scene); + scene.EventManager.OnNewClient += OnNewClient; + scene.EventManager.OnIncomingInstantMessage += + OnGridInstantMessage; + } } } } + public void RegionLoaded(Scene scene) + { + if (m_enabled) + { + m_TransferModule = + m_scenes[0].RequestModuleInterface(); + + if (m_TransferModule == null) + m_log.Error("[INSTANT MESSAGE]: No message transfer module, " + + "lures will not work!"); + } + } + + public void RemoveRegion(Scene scene) + { + if (m_scenes.Contains(scene)) + m_scenes.Remove(scene); + scene.EventManager.OnNewClient -= OnNewClient; + scene.EventManager.OnIncomingInstantMessage -= + OnGridInstantMessage; + } + void OnNewClient(IClientAPI client) { client.OnInstantMessage += OnInstantMessage; @@ -76,12 +113,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Lure public void PostInitialise() { - m_TransferModule = - m_scenes[0].RequestModuleInterface(); - - if (m_TransferModule == null) - m_log.Error("[INSTANT MESSAGE]: No message transfer module, "+ - "lures will not work!"); } public void Close() diff --git a/OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs b/OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs index 63a93aa..748b42c 100644 --- a/OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs +++ b/OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs @@ -29,6 +29,7 @@ using System; using System.Collections; using System.Reflection; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenMetaverse.StructuredData; @@ -41,24 +42,54 @@ using Caps=OpenSim.Framework.Capabilities.Caps; namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps { - public class ObjectAdd : IRegionModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class ObjectAdd : ISharedRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private Scene m_scene; - #region IRegionModule Members + #region ISharedRegionModule Members - public void Initialise(Scene pScene, IConfigSource pSource) + public void Initialise(IConfigSource pSource) { - m_scene = pScene; + + } + + public Type ReplaceableInterface + { + get { return null; } + } + + public void AddRegion(Scene scene) + { + m_scene = scene; m_scene.EventManager.OnRegisterCaps += RegisterCaps; } + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + scene.EventManager.OnRegisterCaps -= RegisterCaps; + } + public void PostInitialise() { } + public void Close() + { + + } + + public string Name + { + get { return "ObjectAddModule"; } + } + public void RegisterCaps(UUID agentID, Caps caps) { UUID capuuid = UUID.Random(); @@ -348,22 +379,6 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps Array.Reverse(resultbytes); return String.Format("{0}",Convert.ToBase64String(resultbytes)); } - - public void Close() - { - - } - - public string Name - { - get { return "ObjectAddModule"; } - } - - public bool IsSharedModule - { - get { return false; } - } - #endregion } } diff --git a/OpenSim/Region/CoreModules/Avatar/Profiles/AvatarProfilesModule.cs b/OpenSim/Region/CoreModules/Avatar/Profiles/AvatarProfilesModule.cs index 8cf58c6..7fcb0e1 100644 --- a/OpenSim/Region/CoreModules/Avatar/Profiles/AvatarProfilesModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Profiles/AvatarProfilesModule.cs @@ -30,6 +30,7 @@ using System.Collections; using System.Globalization; using System.Reflection; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -38,20 +39,17 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Avatar.Profiles { - public class AvatarProfilesModule : IRegionModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class AvatarProfilesModule : INonSharedRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private Scene m_scene; private IProfileModule m_profileModule = null; private bool m_enabled = true; - public AvatarProfilesModule() - { - } + #region INonSharedRegionModule Members - #region IRegionModule Members - - public void Initialise(Scene scene, IConfigSource config) + public void Initialise(IConfigSource config) { IConfig profileConfig = config.Configs["Profile"]; if (profileConfig != null) @@ -62,30 +60,38 @@ namespace OpenSim.Region.CoreModules.Avatar.Profiles return; } } + } + + public Type ReplaceableInterface + { + get { return null; } + } + public void AddRegion(Scene scene) + { m_scene = scene; m_scene.EventManager.OnNewClient += NewClient; } - public void PostInitialise() + public void RegionLoaded(Scene scene) { if (!m_enabled) return; m_profileModule = m_scene.RequestModuleInterface(); } - public void Close() + public void RemoveRegion(Scene scene) { + scene.EventManager.OnNewClient -= NewClient; } - public string Name + public void Close() { - get { return "AvatarProfilesModule"; } } - public bool IsSharedModule + public string Name { - get { return false; } + get { return "AvatarProfilesModule"; } } #endregion diff --git a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs index 0c6cb1b..1ee6f0d 100644 --- a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs @@ -32,6 +32,7 @@ using System.Net; using System.Reflection; using System.Threading; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenMetaverse.Packets; @@ -52,11 +53,13 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue public OSDMap body; } - public class EventQueueGetModule : IEventQueue, IRegionModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class EventQueueGetModule : IEventQueue, INonSharedRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); protected Scene m_scene = null; private IConfigSource m_gConfig; + private IConfig m_startupConfig; bool enabledYN = false; private Dictionary m_ids = new Dictionary(); @@ -65,23 +68,31 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue private Dictionary m_QueueUUIDAvatarMapping = new Dictionary(); private Dictionary m_AvatarQueueUUIDMapping = new Dictionary(); - #region IRegionModule methods - public virtual void Initialise(Scene scene, IConfigSource config) + #region INonSharedRegionModule methods + public virtual void Initialise(IConfigSource config) { m_gConfig = config; - IConfig startupConfig = m_gConfig.Configs["Startup"]; + m_startupConfig = m_gConfig.Configs["Startup"]; + } - ReadConfigAndPopulate(scene, startupConfig, "Startup"); + public Type ReplaceableInterface + { + get { return null; } + } + + public void AddRegion(Scene scene) + { + ReadConfigAndPopulate(scene, m_startupConfig, "Startup"); if (enabledYN) { m_scene = scene; scene.RegisterModuleInterface(this); - + // Register fallback handler // Why does EQG Fail on region crossings! - + //scene.CommsManager.HttpServer.AddLLSDHandler("/CAPS/EQG/", EventQueueFallBack); scene.EventManager.OnNewClient += OnNewClient; @@ -99,18 +110,21 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue { m_gConfig = null; } - } - private void ReadConfigAndPopulate(Scene scene, IConfig startupConfig, string p) + public void RegionLoaded(Scene scene) { - enabledYN = startupConfig.GetBoolean("EventQueue", true); } - public void PostInitialise() + public void RemoveRegion(Scene scene) { } + private void ReadConfigAndPopulate(Scene scene, IConfig startupConfig, string p) + { + enabledYN = startupConfig.GetBoolean("EventQueue", true); + } + public virtual void Close() { } @@ -120,10 +134,6 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue get { return "EventQueueGetModule"; } } - public bool IsSharedModule - { - get { return false; } - } #endregion /// diff --git a/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs b/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs index f15f8f6..0135d33 100644 --- a/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs +++ b/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs @@ -25,10 +25,12 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +using System; using System.Collections; using System.Collections.Generic; using System.Reflection; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -39,7 +41,8 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Framework.Monitoring { - public class MonitorModule : IRegionModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class MonitorModule : INonSharedRegionModule { private Scene m_scene; private readonly List m_monitors = new List(); @@ -62,9 +65,19 @@ namespace OpenSim.Region.CoreModules.Framework.Monitoring } } - #region Implementation of IRegionModule + #region Implementation of INonSharedRegionModule - public void Initialise(Scene scene, IConfigSource source) + public void Initialise(IConfigSource source) + { + + } + + public Type ReplaceableInterface + { + get { return null; } + } + + public void AddRegion(Scene scene) { m_scene = scene; @@ -77,6 +90,51 @@ namespace OpenSim.Region.CoreModules.Framework.Monitoring MainServer.Instance.AddHTTPHandler("/monitorstats/" + m_scene.RegionInfo.RegionID + "/", StatsPage); } + public void RegionLoaded(Scene scene) + { + m_monitors.Add(new AgentCountMonitor(m_scene)); + m_monitors.Add(new ChildAgentCountMonitor(m_scene)); + m_monitors.Add(new GCMemoryMonitor()); + m_monitors.Add(new ObjectCountMonitor(m_scene)); + m_monitors.Add(new PhysicsFrameMonitor(m_scene)); + m_monitors.Add(new PhysicsUpdateFrameMonitor(m_scene)); + m_monitors.Add(new PWSMemoryMonitor()); + m_monitors.Add(new ThreadCountMonitor()); + m_monitors.Add(new TotalFrameMonitor(m_scene)); + m_monitors.Add(new EventFrameMonitor(m_scene)); + m_monitors.Add(new LandFrameMonitor(m_scene)); + m_monitors.Add(new LastFrameTimeMonitor(m_scene)); + + m_alerts.Add(new DeadlockAlert(m_monitors.Find(x => x is LastFrameTimeMonitor) as LastFrameTimeMonitor)); + + foreach (IAlert alert in m_alerts) + { + alert.OnTriggerAlert += OnTriggerAlert; + } + } + + public void RemoveRegion(Scene scene) + { + MainServer.Instance.RemoveHTTPHandler("", "/monitorstats/" + m_scene.RegionInfo.RegionID + "/"); + m_monitors.Clear(); + + foreach (IAlert alert in m_alerts) + { + alert.OnTriggerAlert -= OnTriggerAlert; + } + m_alerts.Clear(); + } + + public void Close() + { + + } + + public string Name + { + get { return "Region Health Monitoring Module"; } + } + public Hashtable StatsPage(Hashtable request) { // If request was for a specific monitor @@ -132,49 +190,10 @@ namespace OpenSim.Region.CoreModules.Framework.Monitoring return ereply; } - public void PostInitialise() - { - m_monitors.Add(new AgentCountMonitor(m_scene)); - m_monitors.Add(new ChildAgentCountMonitor(m_scene)); - m_monitors.Add(new GCMemoryMonitor()); - m_monitors.Add(new ObjectCountMonitor(m_scene)); - m_monitors.Add(new PhysicsFrameMonitor(m_scene)); - m_monitors.Add(new PhysicsUpdateFrameMonitor(m_scene)); - m_monitors.Add(new PWSMemoryMonitor()); - m_monitors.Add(new ThreadCountMonitor()); - m_monitors.Add(new TotalFrameMonitor(m_scene)); - m_monitors.Add(new EventFrameMonitor(m_scene)); - m_monitors.Add(new LandFrameMonitor(m_scene)); - m_monitors.Add(new LastFrameTimeMonitor(m_scene)); - - m_alerts.Add(new DeadlockAlert(m_monitors.Find(x => x is LastFrameTimeMonitor) as LastFrameTimeMonitor)); - - foreach (IAlert alert in m_alerts) - { - alert.OnTriggerAlert += OnTriggerAlert; - } - } - void OnTriggerAlert(System.Type reporter, string reason, bool fatal) { m_log.Error("[Monitor] " + reporter.Name + " for " + m_scene.RegionInfo.RegionName + " reports " + reason + " (Fatal: " + fatal + ")"); } - - public void Close() - { - - } - - public string Name - { - get { return "Region Health Monitoring Module"; } - } - - public bool IsSharedModule - { - get { return false; } - } - #endregion } } diff --git a/OpenSim/Region/CoreModules/Hypergrid/HGStandaloneLoginModule.cs b/OpenSim/Region/CoreModules/Hypergrid/HGStandaloneLoginModule.cs index 0b54746..f9c594b 100644 --- a/OpenSim/Region/CoreModules/Hypergrid/HGStandaloneLoginModule.cs +++ b/OpenSim/Region/CoreModules/Hypergrid/HGStandaloneLoginModule.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -32,6 +32,7 @@ using System.Net; using System.Reflection; using System.Text.RegularExpressions; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using Nwc.XmlRpc; @@ -46,7 +47,8 @@ using OpenSim.Region.Framework.Interfaces; namespace OpenSim.Region.CoreModules.Hypergrid { - public class HGStandaloneLoginModule : IRegionModule, ILoginServiceToRegionsConnector + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class HGStandaloneLoginModule : ISharedRegionModule, ILoginServiceToRegionsConnector { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -56,47 +58,58 @@ namespace OpenSim.Region.CoreModules.Hypergrid protected bool m_enabled = false; // Module is only enabled if running in standalone mode protected HGLoginAuthService m_loginService; + private bool authenticate = true; + private string welcomeMessage = "Welcome to OpenSim"; + private IConfig startupConfig; + private IConfig standaloneConfig; + + #region ISharedRegionModule Members + + public void Initialise(IConfigSource source) + { + startupConfig = source.Configs["Startup"]; + standaloneConfig = source.Configs["StandAlone"]; + if (standaloneConfig != null) + { + authenticate = standaloneConfig.GetBoolean("accounts_authenticate", true); + welcomeMessage = standaloneConfig.GetString("welcome_message"); + } + m_enabled = !startupConfig.GetBoolean("gridmode", false); + } + + public Type ReplaceableInterface + { + get { return null; } + } - #region IRegionModule Members + public void AddRegion(Scene scene) + { + } - public void Initialise(Scene scene, IConfigSource source) + public void RegionLoaded(Scene scene) { if (m_firstScene == null) { m_firstScene = scene; - IConfig startupConfig = source.Configs["Startup"]; - if (startupConfig != null) - { - m_enabled = !startupConfig.GetBoolean("gridmode", false); - } - if (m_enabled) { m_log.Debug("[HGLogin]: HGlogin module enabled"); - bool authenticate = true; - string welcomeMessage = "Welcome to OpenSim"; - IConfig standaloneConfig = source.Configs["StandAlone"]; - if (standaloneConfig != null) - { - authenticate = standaloneConfig.GetBoolean("accounts_authenticate", true); - welcomeMessage = standaloneConfig.GetString("welcome_message"); - } //TODO: fix casting. LibraryRootFolder rootFolder = m_firstScene.CommsManager.UserProfileCacheService.LibraryRoot as LibraryRootFolder; - + IHttpServer httpServer = MainServer.Instance; //TODO: fix the casting of the user service, maybe by registering the userManagerBase with scenes, or refactoring so we just need a IUserService reference - m_loginService + m_loginService = new HGLoginAuthService( - (UserManagerBase)m_firstScene.CommsManager.UserAdminService, - welcomeMessage, - m_firstScene.CommsManager.InterServiceInventoryService, - m_firstScene.CommsManager.NetworkServersInfo, - authenticate, - rootFolder, + (UserManagerBase)m_firstScene.CommsManager.UserAdminService, + welcomeMessage, + m_firstScene.CommsManager.InterServiceInventoryService, + m_firstScene.CommsManager.NetworkServersInfo, + authenticate, + rootFolder, this); httpServer.AddXmlRPCHandler("hg_login", m_loginService.XmlRpcLoginMethod); @@ -113,6 +126,19 @@ namespace OpenSim.Region.CoreModules.Hypergrid } } + public void RemoveRegion(Scene scene) + { + if (scene == m_firstScene) + { + IHttpServer httpServer = MainServer.Instance; + httpServer.RemoveXmlRPCHandler("hg_login"); + httpServer.RemoveXmlRPCHandler("check_auth_session"); + httpServer.RemoveXmlRPCHandler("get_avatar_appearance"); + httpServer.RemoveXmlRPCHandler("update_avatar_appearance"); + } + m_scenes.Remove(scene); + } + public void PostInitialise() { @@ -128,11 +154,6 @@ namespace OpenSim.Region.CoreModules.Hypergrid get { return "HGStandaloneLoginModule"; } } - public bool IsSharedModule - { - get { return true; } - } - #endregion protected void AddScene(Scene scene) diff --git a/OpenSim/Region/CoreModules/InterGrid/OGSRadmin.cs b/OpenSim/Region/CoreModules/InterGrid/OGSRadmin.cs index 0f2ba32..4534024 100644 --- a/OpenSim/Region/CoreModules/InterGrid/OGSRadmin.cs +++ b/OpenSim/Region/CoreModules/InterGrid/OGSRadmin.cs @@ -32,6 +32,7 @@ using System.Net; using System.Reflection; using System.Text; using log4net; +using Mono.Addins; using Nini.Config; using Nwc.XmlRpc; using OpenMetaverse; @@ -42,7 +43,8 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.InterGrid { - public class OGSRadmin : IRegionModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class OGSRadmin : ISharedRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private readonly List m_scenes = new List(); @@ -56,7 +58,6 @@ namespace OpenSim.Region.CoreModules.InterGrid get { return "OGS Supporting RAdmin"; } } - public void Initialise(IConfigSource source) { m_settings = source; @@ -67,6 +68,11 @@ namespace OpenSim.Region.CoreModules.InterGrid } + public Type ReplaceableInterface + { + get { return null; } + } + public void AddRegion(Scene scene) { lock (m_scenes) @@ -77,15 +83,11 @@ namespace OpenSim.Region.CoreModules.InterGrid { lock (m_scenes) m_scenes.Remove(scene); + MainServer.Instance.RemoveXmlRPCHandler("grid_message"); } public void RegionLoaded(Scene scene) { - - } - - public void PostInitialise() - { if (m_settings.Configs["Startup"].GetBoolean("gridmode", false)) { m_com = m_scenes[0].CommsManager; @@ -93,21 +95,8 @@ namespace OpenSim.Region.CoreModules.InterGrid } } - #endregion - - #region IRegionModule - - public void Initialise(Scene scene, IConfigSource source) - { - m_settings = source; - - lock (m_scenes) - m_scenes.Add(scene); - } - - public bool IsSharedModule + public void PostInitialise() { - get { return true; } } #endregion diff --git a/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs b/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs index 10a3232..8bb0fa9 100644 --- a/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs +++ b/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs @@ -35,6 +35,7 @@ using System.Security.Cryptography.X509Certificates; using System.Threading; using System.Web; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenMetaverse.StructuredData; @@ -75,8 +76,9 @@ namespace OpenSim.Region.CoreModules.InterGrid public bool visible_to_parent; public string teleported_into_region; } - - public class OpenGridProtocolModule : IRegionModule + + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class OpenGridProtocolModule : ISharedRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private List m_scene = new List(); @@ -92,21 +94,22 @@ namespace OpenSim.Region.CoreModules.InterGrid private bool httpSSL = false; private uint httpsslport = 0; private bool GridMode = false; + private bool m_enabled = false; + private IConfig cfg = null; + private IConfig httpcfg = null; + private IConfig startupcfg = null; + + #region ISharedRegionModule Members - #region IRegionModule Members - - public void Initialise(Scene scene, IConfigSource config) + public void Initialise(IConfigSource config) { - bool enabled = false; - IConfig cfg = null; - IConfig httpcfg = null; - IConfig startupcfg = null; try { cfg = config.Configs["OpenGridProtocol"]; - } catch (NullReferenceException) + } + catch (NullReferenceException) { - enabled = false; + m_enabled = false; } try @@ -128,15 +131,15 @@ namespace OpenSim.Region.CoreModules.InterGrid if (startupcfg != null) { - GridMode = enabled = startupcfg.GetBoolean("gridmode", false); + GridMode = m_enabled = startupcfg.GetBoolean("gridmode", false); } if (cfg != null) { - enabled = cfg.GetBoolean("ogp_enabled", false); + m_enabled = cfg.GetBoolean("ogp_enabled", false); LastNameSuffix = cfg.GetString("ogp_lastname_suffix", "_EXTERNAL"); FirstNamePrefix = cfg.GetString("ogp_firstname_prefix", ""); - if (enabled) + if (m_enabled) { m_log.Warn("[OGP]: Open Grid Protocol is on, Listening for Clients on /agent/"); lock (m_scene) @@ -165,35 +168,61 @@ namespace OpenSim.Region.CoreModules.InterGrid } } - // can't pick the region 'agent' because it would conflict with our agent domain handler - // a zero length region name would conflict with are base region seed cap - if (!SceneListDuplicateCheck(scene.RegionInfo.RegionName) && scene.RegionInfo.RegionName.ToLower() != "agent" && scene.RegionInfo.RegionName.Length > 0) - { - MainServer.Instance.AddLLSDHandler( - "/" + HttpUtility.UrlPathEncode(scene.RegionInfo.RegionName.ToLower()), - ProcessRegionDomainSeed); - } - - if (!m_scene.Contains(scene)) - m_scene.Add(scene); } } } - lock (m_scene) + } + + public Type ReplaceableInterface + { + get { return null; } + } + + public void AddRegion(Scene scene) + { + if (m_enabled) { - if (m_scene.Count == 1) + lock (m_scene) { - if (httpcfg != null) + if (m_scene.Count == 1) { - httpSSL = httpcfg.GetBoolean("http_listener_ssl", false); - httpsCN = httpcfg.GetString("http_listener_cn", scene.RegionInfo.ExternalHostName); - if (httpsCN.Length == 0) - httpsCN = scene.RegionInfo.ExternalHostName; - httpsslport = (uint)httpcfg.GetInt("http_listener_sslport",((int)scene.RegionInfo.HttpPort + 1)); + if (httpcfg != null) + { + httpSSL = httpcfg.GetBoolean("http_listener_ssl", false); + httpsCN = httpcfg.GetString("http_listener_cn", scene.RegionInfo.ExternalHostName); + if (httpsCN.Length == 0) + httpsCN = scene.RegionInfo.ExternalHostName; + httpsslport = (uint)httpcfg.GetInt("http_listener_sslport", ((int)scene.RegionInfo.HttpPort + 1)); + } } } + // can't pick the region 'agent' because it would conflict with our agent domain handler + // a zero length region name would conflict with are base region seed cap + if (!SceneListDuplicateCheck(scene.RegionInfo.RegionName) && scene.RegionInfo.RegionName.ToLower() != "agent" && scene.RegionInfo.RegionName.Length > 0) + { + MainServer.Instance.AddLLSDHandler( + "/" + HttpUtility.UrlPathEncode(scene.RegionInfo.RegionName.ToLower()), + ProcessRegionDomainSeed); + } + + if (!m_scene.Contains(scene)) + m_scene.Add(scene); } } + + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + MainServer.Instance.RemoveLLSDHandler( + "/" + HttpUtility.UrlPathEncode(scene.RegionInfo.RegionName.ToLower()), + ProcessRegionDomainSeed); + + if (m_scene.Contains(scene)) + m_scene.Remove(scene); + } public void PostInitialise() { @@ -209,11 +238,6 @@ namespace OpenSim.Region.CoreModules.InterGrid get { return "OpenGridProtocolModule"; } } - public bool IsSharedModule - { - get { return true; } - } - #endregion public OSD ProcessRegionDomainSeed(string path, OSD request, string endpoint) diff --git a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs index 679c871..40b7159 100644 --- a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs @@ -29,6 +29,7 @@ using System; using System.Collections.Generic; using System.Drawing; using System.Drawing.Imaging; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenMetaverse.Imaging; @@ -40,7 +41,8 @@ using System.Reflection; namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture { - public class DynamicTextureModule : IRegionModule, IDynamicTextureManager + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class DynamicTextureModule : ISharedRegionModule, IDynamicTextureManager { //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -210,9 +212,14 @@ 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) + { + + } + + public void AddRegion(Scene scene) { if (!RegisteredScenes.ContainsKey(scene.RegionInfo.RegionID)) { @@ -221,6 +228,24 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture } } + public Type ReplaceableInterface + { + get { return null; } + } + + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + if (!RegisteredScenes.ContainsKey(scene.RegionInfo.RegionID)) + { + RegisteredScenes.Remove(scene.RegionInfo.RegionID); + scene.UnregisterModuleInterface(this); + } + } + public void PostInitialise() { } @@ -234,11 +259,6 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture get { return "DynamicTextureModule"; } } - public bool IsSharedModule - { - get { return true; } - } - #endregion #region Nested type: DynamicTextureUpdater @@ -358,18 +378,18 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture // tmptex.DefaultTexture.Fullbright = true; part.UpdateTexture(tmptex); - } - - if (oldID != UUID.Zero && ((Disp & DISP_EXPIRE) != 0)) - { - if (oldAsset == null) oldAsset = scene.AssetService.Get(oldID.ToString()); - if (oldAsset != null) - { - if (oldAsset.Temporary == true) - { - scene.AssetService.Delete(oldID.ToString()); - } - } + } + + if (oldID != UUID.Zero && ((Disp & DISP_EXPIRE) != 0)) + { + if (oldAsset == null) oldAsset = scene.AssetService.Get(oldID.ToString()); + if (oldAsset != null) + { + if (oldAsset.Temporary == true) + { + scene.AssetService.Delete(oldID.ToString()); + } + } } } diff --git a/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs b/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs index 83f004d..d6ed468 100644 --- a/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs @@ -32,6 +32,7 @@ using System.Text.RegularExpressions; using DotNetOpenMail; using DotNetOpenMail.SmtpAuth; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -40,6 +41,7 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Scripting.EmailModules { + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] public class EmailModule : IEmailModule { // @@ -94,7 +96,7 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules } } - public void Initialise(Scene scene, IConfigSource config) + public void Initialise(IConfigSource config) { m_Config = config; IConfig SMTPConfig; @@ -136,7 +138,16 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules m_Enabled = false; return; } + m_log.Info("[EMAIL] Activated DefaultEmailModule"); + } + + public Type ReplaceableInterface + { + get { return null; } + } + public void AddRegion(Scene scene) + { // It's a go! if (m_Enabled) { @@ -155,8 +166,20 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules m_Scenes.Add(scene.RegionInfo.RegionHandle, scene); } } + } + } - m_log.Info("[EMAIL] Activated DefaultEmailModule"); + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + scene.UnregisterModuleInterface(this); + + if (m_Scenes.ContainsKey(scene.RegionInfo.RegionHandle)) + { + m_Scenes.Remove(scene.RegionInfo.RegionHandle); } } @@ -173,11 +196,6 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules get { return "DefaultEmailModule"; } } - public bool IsSharedModule - { - get { return true; } - } - /// /// Delay function using thread in seconds /// diff --git a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs index d78931a..e331b8d 100644 --- a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs +++ b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs @@ -31,6 +31,7 @@ using System.IO; using System.Net; using System.Text; using System.Threading; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -84,7 +85,8 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Scripting.HttpRequest { - public class HttpRequestModule : IRegionModule, IHttpRequestModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class HttpRequestModule : ISharedRegionModule, IHttpRequestModule { private object HttpListLock = new object(); private int httpTimeout = 30000; @@ -229,18 +231,35 @@ 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_proxyurl = config.Configs["Startup"].GetString("HttpProxy"); + m_proxyexcepts = config.Configs["Startup"].GetString("HttpProxyExceptions"); + + m_pendingRequests = new Dictionary(); + } + + public void AddRegion(Scene scene) { m_scene = scene; m_scene.RegisterModuleInterface(this); + } + + public Type ReplaceableInterface + { + get { return null; } + } - m_proxyurl = config.Configs["Startup"].GetString("HttpProxy"); - m_proxyexcepts = config.Configs["Startup"].GetString("HttpProxyExceptions"); + public void RegionLoaded(Scene scene) + { + } - m_pendingRequests = new Dictionary(); + public void RemoveRegion(Scene scene) + { + scene.UnregisterModuleInterface(this); } public void PostInitialise() @@ -256,11 +275,6 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest get { return m_name; } } - public bool IsSharedModule - { - get { return true; } - } - #endregion } diff --git a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs index 9b565ed..6ce55a9 100644 --- a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs @@ -126,6 +126,8 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp public void RemoveRegion(Scene scene) { + scene.UnregisterModuleInterface(this); + scene.EventManager.OnScriptReset -= OnScriptReset; } public void Close() diff --git a/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs b/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs index c23cea5..35ce2cb 100644 --- a/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs @@ -29,6 +29,7 @@ using System; using System.Drawing; using System.IO; using System.Net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenMetaverse.Imaging; @@ -39,7 +40,8 @@ using System.Reflection; namespace OpenSim.Region.CoreModules.Scripting.LoadImageURL { - public class LoadImageURLModule : IRegionModule, IDynamicTextureRender + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class LoadImageURLModule : ISharedRegionModule, IDynamicTextureRender { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -97,20 +99,28 @@ 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) + { + m_proxyurl = config.Configs["Startup"].GetString("HttpProxy"); + m_proxyexcepts = config.Configs["Startup"].GetString("HttpProxyExceptions"); + } + + public void AddRegion(Scene scene) { if (m_scene == null) { m_scene = scene; } - - m_proxyurl = config.Configs["Startup"].GetString("HttpProxy"); - m_proxyexcepts = config.Configs["Startup"].GetString("HttpProxyExceptions"); } - public void PostInitialise() + public Type ReplaceableInterface + { + get { return null; } + } + + public void RegionLoaded(Scene scene) { m_textureManager = m_scene.RequestModuleInterface(); if (m_textureManager != null) @@ -119,18 +129,21 @@ namespace OpenSim.Region.CoreModules.Scripting.LoadImageURL } } - public void Close() + public void RemoveRegion(Scene scene) { } - public string Name + public void PostInitialise() { - get { return m_name; } } - public bool IsSharedModule + public void Close() { - get { return true; } + } + + public string Name + { + get { return m_name; } } #endregion diff --git a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs index d57a8e5..71b01a1 100644 --- a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs @@ -31,6 +31,7 @@ using System.Drawing.Imaging; using System.Globalization; using System.IO; using System.Net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenMetaverse.Imaging; @@ -43,7 +44,8 @@ using System.Reflection; namespace OpenSim.Region.CoreModules.Scripting.VectorRender { - public class VectorRenderModule : IRegionModule, IDynamicTextureRender + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class VectorRenderModule : ISharedRegionModule, IDynamicTextureRender { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -110,15 +112,10 @@ 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) { Bitmap bitmap = new Bitmap(1024, 1024, PixelFormat.Format32bppArgb); @@ -133,7 +130,20 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender m_log.DebugFormat("[VECTORRENDERMODULE]: using font \"{0}\" for text rendering.", m_fontName); } - public void PostInitialise() + public void AddRegion(Scene scene) + { + if (m_scene == null) + { + m_scene = scene; + } + } + + public Type ReplaceableInterface + { + get { return null; } + } + + public void RegionLoaded(Scene scene) { m_textureManager = m_scene.RequestModuleInterface(); if (m_textureManager != null) @@ -142,18 +152,21 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender } } - public void Close() + public void RemoveRegion(Scene scene) { } - public string Name + public void PostInitialise() { - get { return m_name; } } - public bool IsSharedModule + public void Close() + { + } + + public string Name { - get { return true; } + get { return m_name; } } #endregion diff --git a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs index 60df2e7..acd8dbf 100644 --- a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs @@ -28,6 +28,7 @@ using System; using System.Collections; using System.Collections.Generic; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -85,7 +86,8 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Scripting.WorldComm { - public class WorldCommModule : IRegionModule, IWorldComm + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class WorldCommModule : INonSharedRegionModule, IWorldComm { // private static readonly ILog m_log = // LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -98,9 +100,9 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm private int m_saydistance = 30; private int m_shoutdistance = 100; - #region IRegionModule Members + #region ISharedRegionModule Members - public void Initialise(Scene scene, IConfigSource config) + public void Initialise(IConfigSource config) { // wrap this in a try block so that defaults will work if // the config file doesn't specify otherwise. @@ -120,31 +122,42 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm if (maxlisteners < 1) maxlisteners = int.MaxValue; if (maxhandles < 1) maxhandles = int.MaxValue; + m_listenerManager = new ListenerManager(maxlisteners, maxhandles); + m_pendingQ = new Queue(); + m_pending = Queue.Synchronized(m_pendingQ); + } + + public void AddRegion(Scene scene) + { m_scene = scene; m_scene.RegisterModuleInterface(this); - m_listenerManager = new ListenerManager(maxlisteners, maxhandles); m_scene.EventManager.OnChatFromClient += DeliverClientMessage; m_scene.EventManager.OnChatBroadcast += DeliverClientMessage; - m_pendingQ = new Queue(); - m_pending = Queue.Synchronized(m_pendingQ); } - public void PostInitialise() + public Type ReplaceableInterface { + get { return null; } } - public void Close() + public void RegionLoaded(Scene scene) { } - public string Name + public void RemoveRegion(Scene scene) { - get { return "WorldCommModule"; } + scene.UnregisterModuleInterface(this); + scene.EventManager.OnChatFromClient -= DeliverClientMessage; + scene.EventManager.OnChatBroadcast -= DeliverClientMessage; } - public bool IsSharedModule + public void Close() { - get { return false; } + } + + public string Name + { + get { return "WorldCommModule"; } } #endregion diff --git a/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs b/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs index 27b64bf..a9147fb6 100644 --- a/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs @@ -32,6 +32,7 @@ using System.Net; using System.Reflection; using System.Threading; using log4net; +using Mono.Addins; using Nini.Config; using Nwc.XmlRpc; using OpenMetaverse; @@ -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")] + public class XMLRPCModule : ISharedRegionModule, IXMLRPC { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -94,9 +96,9 @@ 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 @@ -116,7 +118,14 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC { } } + } + + public void PostInitialise() + { + } + public void AddRegion(Scene scene) + { if (!m_scenes.Contains(scene)) { m_scenes.Add(scene); @@ -125,7 +134,12 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC } } - public void PostInitialise() + public Type ReplaceableInterface + { + get { return null; } + } + private Dictionary m_HttpServers = new Dictionary(); + public void RegionLoaded(Scene scene) { if (IsEnabled()) { @@ -133,24 +147,41 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC // Attach xmlrpc handlers m_log.Info("[REMOTE_DATA]: " + "Starting XMLRPC Server on port " + m_remoteDataPort + " for llRemoteData commands."); - BaseHttpServer httpServer = new BaseHttpServer((uint) m_remoteDataPort); + BaseHttpServer httpServer = new BaseHttpServer((uint)m_remoteDataPort); httpServer.AddXmlRPCHandler("llRemoteData", XmlRpcRemoteData); httpServer.Start(); + m_HttpServers.Add(scene, httpServer); } } - public void Close() + public void RemoveRegion(Scene scene) { + if (m_scenes.Contains(scene)) + m_scenes.Remove(scene); + scene.UnregisterModuleInterface(this); + if (IsEnabled()) + { + // Start http server + // Attach xmlrpc handlers + if (m_HttpServers.ContainsKey(scene)) + { + BaseHttpServer httpServer; + m_HttpServers.TryGetValue(scene, out httpServer); + m_log.Info("[REMOTE_DATA]: " + + "Stopping XMLRPC Server on port " + m_remoteDataPort + " for llRemoteData commands."); + httpServer.RemoveXmlRPCHandler("llRemoteData"); + httpServer.Stop(); + } + } } - public string Name + public void Close() { - get { return m_name; } } - public bool IsSharedModule + public string Name { - get { return true; } + get { return m_name; } } public int Port diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Asset/AssetServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Asset/AssetServiceInConnectorModule.cs index 879cc70..d3e2db7 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Asset/AssetServiceInConnectorModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Asset/AssetServiceInConnectorModule.cs @@ -47,7 +47,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Asset private IConfigSource m_Config; bool m_Registered = false; - #region IRegionModule interface + #region ISharedRegionModule interface public void Initialise(IConfigSource config) { diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Grid/HypergridServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Grid/HypergridServiceInConnectorModule.cs index b12d778..a895a3f 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Grid/HypergridServiceInConnectorModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Grid/HypergridServiceInConnectorModule.cs @@ -51,7 +51,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Grid bool m_Registered = false; HypergridServiceInConnector m_HypergridHandler; - #region IRegionModule interface + #region ISharedRegionModule interface public void Initialise(IConfigSource config) { diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Inventory/InventoryServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Inventory/InventoryServiceInConnectorModule.cs index 54c6d89..4c74725 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Inventory/InventoryServiceInConnectorModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Inventory/InventoryServiceInConnectorModule.cs @@ -47,7 +47,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Inventory private IConfigSource m_Config; bool m_Registered = false; - #region IRegionModule interface + #region ISharedRegionModule interface public void Initialise(IConfigSource config) { diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs index bce160a..dcc6dec 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs @@ -50,7 +50,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Land private IConfigSource m_Config; private List m_Scenes = new List(); - #region IRegionModule interface + #region ISharedRegionModule interface public void Initialise(IConfigSource config) { diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Neighbour/NeighbourServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Neighbour/NeighbourServiceInConnectorModule.cs index 8a90370..a5c5ef6 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Neighbour/NeighbourServiceInConnectorModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Neighbour/NeighbourServiceInConnectorModule.cs @@ -50,7 +50,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Neighbour private IConfigSource m_Config; private List m_Scenes = new List(); - #region IRegionModule interface + #region ISharedRegionModule interface public void Initialise(IConfigSource config) { diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Simulation/SimulationServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Simulation/SimulationServiceInConnectorModule.cs index f28a318..c2cea16 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Simulation/SimulationServiceInConnectorModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Simulation/SimulationServiceInConnectorModule.cs @@ -49,7 +49,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Simulation private IConfigSource m_Config; bool m_Registered = false; - #region IRegionModule interface + #region ISharedRegionModule interface public void Initialise(IConfigSource config) { diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/LocalInterregionComms.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/LocalInterregionComms.cs index d68c683..71d7993 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/LocalInterregionComms.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/LocalInterregionComms.cs @@ -48,7 +48,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion #endregion /* Events */ - #region IRegionModule + #region ISharedRegionModule public void Initialise(IConfigSource config) { @@ -136,7 +136,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion } } - #endregion /* IRegionModule */ + #endregion #region IInterregionComms diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs index 44458d1..24d35e1 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs @@ -66,7 +66,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion protected bool m_safemode; protected IPAddress m_thisIP; - #region IRegionModule + #region ISharedRegionModule public virtual void Initialise(IConfigSource config) { @@ -149,7 +149,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion MainServer.Instance.AddHTTPHandler("/object/", ObjectHandler); } - #endregion /* IRegionModule */ + #endregion #region IInterregionComms @@ -436,12 +436,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion } OSDMap resp = new OSDMap(2); - string reason = String.Empty; - uint teleportFlags = 0; - if (args.ContainsKey("teleport_flags")) - { - teleportFlags = args["teleport_flags"].AsUInteger(); - } + string reason = String.Empty; + uint teleportFlags = 0; + if (args.ContainsKey("teleport_flags")) + { + teleportFlags = args["teleport_flags"].AsUInteger(); + } // This is the meaning of POST agent m_regionClient.AdjustUserInformation(aCircuit); diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs index fc8d4e1..c738b65 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs @@ -81,6 +81,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver public void RemoveRegion(Scene scene) { + scene.UnregisterModuleInterface(this); } public void Close() diff --git a/OpenSim/Region/CoreModules/World/Cloud/CloudModule.cs b/OpenSim/Region/CoreModules/World/Cloud/CloudModule.cs index 5fa3dc2..a2cfce6 100644 --- a/OpenSim/Region/CoreModules/World/Cloud/CloudModule.cs +++ b/OpenSim/Region/CoreModules/World/Cloud/CloudModule.cs @@ -27,6 +27,7 @@ using System; using System.Collections.Generic; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -35,6 +36,7 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules { + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] public class CloudModule : ICloudModule { // private static readonly log4net.ILog m_log @@ -48,7 +50,7 @@ namespace OpenSim.Region.CoreModules private float m_cloudDensity = 1.0F; private float[] cloudCover = new float[16 * 16]; - public void Initialise(Scene scene, IConfigSource config) + public void Initialise(IConfigSource config) { IConfig cloudConfig = config.Configs["Cloud"]; @@ -58,10 +60,17 @@ namespace OpenSim.Region.CoreModules m_cloudDensity = cloudConfig.GetFloat("density", 0.5F); m_frameUpdateRate = cloudConfig.GetInt("cloud_update_rate", 1000); } + } + + public Type ReplaceableInterface + { + get { return null; } + } + public void AddRegion(Scene scene) + { if (m_enabled) { - m_scene = scene; scene.EventManager.OnNewClient += CloudsToClient; @@ -71,9 +80,18 @@ namespace OpenSim.Region.CoreModules GenerateCloudCover(); m_ready = true; - } + } + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + scene.EventManager.OnNewClient -= CloudsToClient; + scene.UnregisterModuleInterface(this); + scene.EventManager.OnFrame -= CloudUpdate; } public void PostInitialise() @@ -96,12 +114,6 @@ namespace OpenSim.Region.CoreModules get { return "CloudModule"; } } - public bool IsSharedModule - { - get { return false; } - } - - public float CloudCover(int x, int y, int z) { float cover = 0f; diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index 695cced..39836ae 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs @@ -30,6 +30,7 @@ using System.IO; using System.Reflection; using System.Security; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -38,6 +39,7 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.World.Estate { + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] public class EstateManagementModule : IEstateModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -898,7 +900,16 @@ namespace OpenSim.Region.CoreModules.World.Estate #region IRegionModule Members - public void Initialise(Scene scene, IConfigSource source) + public void Initialise(IConfigSource source) + { + } + + public Type ReplaceableInterface + { + get { return null; } + } + + public void AddRegion(Scene scene) { m_scene = scene; m_scene.RegisterModuleInterface(this); @@ -920,6 +931,29 @@ namespace OpenSim.Region.CoreModules.World.Estate consoleSetTerrainHeights); } + public void RegionLoaded(Scene scene) + { + // Sets up the sun module based on the saved Estate and Region Settings + // DO NOT REMOVE or the sun will stop working + TriggerEstateToolsSunUpdate(); + } + + public void RemoveRegion(Scene scene) + { + scene.UnregisterModuleInterface(this); + scene.EventManager.OnNewClient -= EventManager_OnNewClient; + scene.EventManager.OnRequestChangeWaterHeight -= changeWaterHeight; + } + + public void Close() + { + } + + public string Name + { + get { return "EstateManagementModule"; } + } + #region Console Commands public void consoleSetTerrainTexture(string module, string[] args) @@ -1006,28 +1040,6 @@ namespace OpenSim.Region.CoreModules.World.Estate } #endregion - - public void PostInitialise() - { - // Sets up the sun module based no the saved Estate and Region Settings - // DO NOT REMOVE or the sun will stop working - TriggerEstateToolsSunUpdate(); - } - - public void Close() - { - } - - public string Name - { - get { return "EstateManagementModule"; } - } - - public bool IsSharedModule - { - get { return false; } - } - #endregion #region Other Functions diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index f66f01f..68e8485 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs @@ -29,6 +29,7 @@ using System; using System.Collections.Generic; using System.Reflection; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -89,7 +90,8 @@ enum GroupPowers : long namespace OpenSim.Region.CoreModules.World.Permissions { - public class PermissionsModule : IRegionModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class PermissionsModule : INonSharedRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -148,12 +150,10 @@ namespace OpenSim.Region.CoreModules.World.Permissions #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"); @@ -177,7 +177,57 @@ namespace OpenSim.Region.CoreModules.World.Permissions if (m_bypassPermissions) m_log.Info("[PERMISSIONS]: serviceside_object_permissions = false in ini file so disabling all region service permission checks"); else - m_log.Debug("[PERMISSIONS]: Enabling all region service permission checks"); + m_log.Debug("[PERMISSIONS]: Enabling all region service permission checks"); + + 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(',')) { + string uuid = uuidl.Trim(" \t".ToCharArray()); + GrantCS.Add(uuid, true); + } + } + + grant = myConfig.GetString("GrantVB",""); + if (grant.Length > 0) { + foreach (string uuidl in grant.Split(',')) { + string uuid = uuidl.Trim(" \t".ToCharArray()); + GrantVB.Add(uuid, true); + } + } + + grant = myConfig.GetString("GrantJS", ""); + if (grant.Length > 0) + { + foreach (string uuidl in grant.Split(',')) + { + string uuid = uuidl.Trim(" \t".ToCharArray()); + GrantJS.Add(uuid, true); + } + } + + grant = myConfig.GetString("GrantYP", ""); + if (grant.Length > 0) + { + foreach (string uuidl in grant.Split(',')) + { + string uuid = uuidl.Trim(" \t".ToCharArray()); + GrantYP.Add(uuid, true); + } + } + + } + + public void AddRegion(Scene scene) + { + m_scene = scene; //Register functions with Scene External Checks! m_scene.Permissions.OnBypassPermissions += BypassPermissions; @@ -210,23 +260,23 @@ namespace OpenSim.Region.CoreModules.World.Permissions 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; //NOT IMPLEMENTED HERE 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.OnUseObjectReturn += CanUseObjectReturn; //NOT YET IMPLEMENTED @@ -244,52 +294,87 @@ namespace OpenSim.Region.CoreModules.World.Permissions "debug permissions ", "Enable permissions debugging", HandleDebugPermissions); - - - 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(',')) { - string uuid = uuidl.Trim(" \t".ToCharArray()); - GrantCS.Add(uuid, true); - } - } + public Type ReplaceableInterface + { + get { return null; } + } - grant = myConfig.GetString("GrantVB",""); - if (grant.Length > 0) { - foreach (string uuidl in grant.Split(',')) { - string uuid = uuidl.Trim(" \t".ToCharArray()); - GrantVB.Add(uuid, true); - } - } + public void RegionLoaded(Scene scene) + { + m_friendsModule = m_scene.RequestModuleInterface(); - grant = myConfig.GetString("GrantJS", ""); - if (grant.Length > 0) - { - foreach (string uuidl in grant.Split(',')) - { - string uuid = uuidl.Trim(" \t".ToCharArray()); - GrantJS.Add(uuid, true); - } - } + if (m_friendsModule == null) + m_log.Error("[PERMISSIONS]: Friends module not found, friend permissions will not work"); + else + m_log.Info("[PERMISSIONS]: Friends module found, friend permissions enabled"); + } - grant = myConfig.GetString("GrantYP", ""); - if (grant.Length > 0) - { - foreach (string uuidl in grant.Split(',')) - { - string uuid = uuidl.Trim(" \t".ToCharArray()); - GrantYP.Add(uuid, true); - } - } + public void RemoveRegion(Scene scene) + { + scene.Permissions.OnBypassPermissions -= BypassPermissions; + scene.Permissions.OnSetBypassPermissions -= SetBypassPermissions; + scene.Permissions.OnPropagatePermissions -= PropagatePermissions; + scene.Permissions.OnGenerateClientFlags -= GenerateClientFlags; + scene.Permissions.OnAbandonParcel -= CanAbandonParcel; + scene.Permissions.OnReclaimParcel -= CanReclaimParcel; + scene.Permissions.OnDeedParcel -= CanDeedParcel; + scene.Permissions.OnDeedObject -= CanDeedObject; + scene.Permissions.OnIsGod -= IsGod; + scene.Permissions.OnDuplicateObject -= CanDuplicateObject; + scene.Permissions.OnDeleteObject -= CanDeleteObject; //MAYBE FULLY IMPLEMENTED + scene.Permissions.OnEditObject -= CanEditObject; //MAYBE FULLY IMPLEMENTED + scene.Permissions.OnEditParcel -= CanEditParcel; //MAYBE FULLY IMPLEMENTED + scene.Permissions.OnInstantMessage -= CanInstantMessage; + scene.Permissions.OnInventoryTransfer -= CanInventoryTransfer; //NOT YET IMPLEMENTED + scene.Permissions.OnIssueEstateCommand -= CanIssueEstateCommand; //FULLY IMPLEMENTED + scene.Permissions.OnMoveObject -= CanMoveObject; //MAYBE FULLY IMPLEMENTED + scene.Permissions.OnObjectEntry -= CanObjectEntry; + scene.Permissions.OnReturnObject -= CanReturnObject; //NOT YET IMPLEMENTED + scene.Permissions.OnRezObject -= CanRezObject; //MAYBE FULLY IMPLEMENTED + scene.Permissions.OnRunConsoleCommand -= CanRunConsoleCommand; + scene.Permissions.OnRunScript -= CanRunScript; //NOT YET IMPLEMENTED + scene.Permissions.OnCompileScript -= CanCompileScript; + scene.Permissions.OnSellParcel -= CanSellParcel; + scene.Permissions.OnTakeObject -= CanTakeObject; + scene.Permissions.OnTakeCopyObject -= CanTakeCopyObject; + scene.Permissions.OnTerraformLand -= CanTerraformLand; + scene.Permissions.OnLinkObject -= CanLinkObject; //NOT YET IMPLEMENTED + scene.Permissions.OnDelinkObject -= CanDelinkObject; //NOT YET IMPLEMENTED + scene.Permissions.OnBuyLand -= CanBuyLand; //NOT YET IMPLEMENTED + + scene.Permissions.OnViewNotecard -= CanViewNotecard; //NOT YET IMPLEMENTED + scene.Permissions.OnViewScript -= CanViewScript; //NOT YET IMPLEMENTED + scene.Permissions.OnEditNotecard -= CanEditNotecard; //NOT YET IMPLEMENTED + scene.Permissions.OnEditScript -= CanEditScript; //NOT YET IMPLEMENTED + + scene.Permissions.OnCreateObjectInventory -= CanCreateObjectInventory; //NOT IMPLEMENTED HERE + scene.Permissions.OnEditObjectInventory -= CanEditObjectInventory;//MAYBE FULLY IMPLEMENTED + scene.Permissions.OnCopyObjectInventory -= CanCopyObjectInventory; //NOT YET IMPLEMENTED + scene.Permissions.OnDeleteObjectInventory -= CanDeleteObjectInventory; //NOT YET IMPLEMENTED + scene.Permissions.OnResetScript -= CanResetScript; + + scene.Permissions.OnCreateUserInventory -= CanCreateUserInventory; //NOT YET IMPLEMENTED + scene.Permissions.OnCopyUserInventory -= CanCopyUserInventory; //NOT YET IMPLEMENTED + scene.Permissions.OnEditUserInventory -= CanEditUserInventory; //NOT YET IMPLEMENTED + scene.Permissions.OnDeleteUserInventory -= CanDeleteUserInventory; //NOT YET IMPLEMENTED + + scene.Permissions.OnTeleport -= CanTeleport; //NOT YET IMPLEMENTED + scene.Permissions.OnUseObjectReturn -= CanUseObjectReturn; //NOT YET IMPLEMENTED + } + + public void PostInitialise() + { + } + + public void Close() + { + } + public string Name + { + get { return "PermissionsModule"; } } public void HandleBypassPermissions(string module, string[] args) @@ -362,31 +447,6 @@ namespace OpenSim.Region.CoreModules.World.Permissions m_log.InfoFormat("[PERMISSIONS] Set permissions debugging to {0} in {1}", m_debugPermissions, m_scene.RegionInfo.RegionName); } } - - public void PostInitialise() - { - m_friendsModule = m_scene.RequestModuleInterface(); - - if (m_friendsModule == null) - m_log.Error("[PERMISSIONS]: Friends module not found, friend permissions will not work"); - else - m_log.Info("[PERMISSIONS]: Friends module found, friend permissions enabled"); - } - - public void Close() - { - } - - public string Name - { - get { return "PermissionsModule"; } - } - - public bool IsSharedModule - { - get { return false; } - } - #endregion #region Helper Functions diff --git a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs index 37f1f2e..ed7bfe1 100644 --- a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs +++ b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs @@ -26,6 +26,7 @@ */ using System; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -34,26 +35,44 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.World.Sound { - public class SoundModule : IRegionModule, ISoundModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class SoundModule : INonSharedRegionModule, ISoundModule { //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); protected Scene m_scene; - public void Initialise(Scene scene, IConfigSource source) + public void Initialise(IConfigSource source) + { + } + + public void AddRegion(Scene scene) { m_scene = scene; - + m_scene.EventManager.OnNewClient += OnNewClient; - + m_scene.RegisterModuleInterface(this); } + + public Type ReplaceableInterface + { + get { return null; } + } + + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + scene.EventManager.OnNewClient -= OnNewClient; + scene.UnregisterModuleInterface(this); + } - public void PostInitialise() {} public void Close() {} public string Name { get { return "Sound Module"; } } - public bool IsSharedModule { get { return false; } } - + private void OnNewClient(IClientAPI client) { client.OnSoundTrigger += TriggerSound; diff --git a/OpenSim/Region/CoreModules/World/Sun/SunModule.cs b/OpenSim/Region/CoreModules/World/Sun/SunModule.cs index 0712a7f..948c47c 100644 --- a/OpenSim/Region/CoreModules/World/Sun/SunModule.cs +++ b/OpenSim/Region/CoreModules/World/Sun/SunModule.cs @@ -29,6 +29,7 @@ using System; using System.Collections.Generic; using System.Reflection; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -37,6 +38,7 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules { + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] public class SunModule : ISunModule { /// @@ -278,27 +280,12 @@ namespace OpenSim.Region.CoreModules return GetCurrentSunHour() + 6.0f; } - #region IRegion Methods + #region INonSharedRegionModule Methods // Called immediately after the module is loaded for a given region // i.e. Immediately after instance creation. - public void Initialise(Scene scene, IConfigSource config) + public void Initialise(IConfigSource config) { - m_scene = scene; - m_frame = 0; - - // This one puts an entry in the main help screen - m_scene.AddCommand(this, String.Empty, "sun", "Usage: sun [param] [value] - Get or Update Sun module paramater", null); - - // This one enables the ability to type just "sun" without any parameters - m_scene.AddCommand(this, "sun", "", "", HandleSunConsoleCommand); - foreach (KeyValuePair kvp in GetParamList()) - { - m_scene.AddCommand(this, String.Format("sun {0}", kvp.Key), String.Format("{0} - {1}", kvp.Key, kvp.Value), "", HandleSunConsoleCommand); - } - - - TimeZone local = TimeZone.CurrentTimeZone; TicksUTCOffset = local.GetUtcOffset(local.ToLocalTime(DateTime.Now)).Ticks; m_log.Debug("[SUN]: localtime offset is " + TicksUTCOffset); @@ -346,7 +333,43 @@ namespace OpenSim.Region.CoreModules // m_latitude = d_latitude; // m_longitude = d_longitude; } + } + + public void Close() + { + ready = false; + + // Remove our hooks + m_scene.EventManager.OnFrame -= SunUpdate; + m_scene.EventManager.OnAvatarEnteringNewParcel -= AvatarEnteringParcel; + m_scene.EventManager.OnEstateToolsSunUpdate -= EstateToolsSunUpdate; + m_scene.EventManager.OnGetCurrentTimeAsLindenSunHour -= GetCurrentTimeAsLindenSunHour; + } + + public string Name + { + get { return "SunModule"; } + } + + public Type ReplaceableInterface + { + get { return null; } + } + + public void AddRegion(Scene scene) + { + m_scene = scene; + m_frame = 0; + + // This one puts an entry in the main help screen + m_scene.AddCommand(this, String.Empty, "sun", "Usage: sun [param] [value] - Get or Update Sun module paramater", null); + // This one enables the ability to type just "sun" without any parameters + m_scene.AddCommand(this, "sun", "", "", HandleSunConsoleCommand); + foreach (KeyValuePair kvp in GetParamList()) + { + m_scene.AddCommand(this, String.Format("sun {0}", kvp.Key), String.Format("{0} - {1}", kvp.Key, kvp.Value), "", HandleSunConsoleCommand); + } switch (m_RegionMode) { case "T1": @@ -354,8 +377,8 @@ namespace OpenSim.Region.CoreModules case "SL": // Time taken to complete a cycle (day and season) - SecondsPerSunCycle = (uint) (m_DayLengthHours * 60 * 60); - SecondsPerYear = (uint) (SecondsPerSunCycle*m_YearLengthDays); + SecondsPerSunCycle = (uint)(m_DayLengthHours * 60 * 60); + SecondsPerYear = (uint)(SecondsPerSunCycle * m_YearLengthDays); // Ration of real-to-virtual time @@ -364,17 +387,17 @@ namespace OpenSim.Region.CoreModules // Speed of rotation needed to complete a cycle in the // designated period (day and season) - SunSpeed = m_SunCycle/SecondsPerSunCycle; - SeasonSpeed = m_SeasonalCycle/SecondsPerYear; + SunSpeed = m_SunCycle / SecondsPerSunCycle; + SeasonSpeed = m_SeasonalCycle / SecondsPerYear; // Horizon translation - HorizonShift = m_HorizonShift; // Z axis translation + HorizonShift = m_HorizonShift; // Z axis translation // HoursToRadians = (SunCycle/24)*VWTimeRatio; // Insert our event handling hooks - scene.EventManager.OnFrame += SunUpdate; + scene.EventManager.OnFrame += SunUpdate; scene.EventManager.OnAvatarEnteringNewParcel += AvatarEnteringParcel; scene.EventManager.OnEstateToolsSunUpdate += EstateToolsSunUpdate; scene.EventManager.OnGetCurrentTimeAsLindenSunHour += GetCurrentTimeAsLindenSunHour; @@ -391,34 +414,21 @@ namespace OpenSim.Region.CoreModules } scene.RegisterModuleInterface(this); - } - - public void PostInitialise() + public void RegionLoaded(Scene scene) { } - public void Close() - { - ready = false; - - // Remove our hooks - m_scene.EventManager.OnFrame -= SunUpdate; - m_scene.EventManager.OnAvatarEnteringNewParcel -= AvatarEnteringParcel; - m_scene.EventManager.OnEstateToolsSunUpdate -= EstateToolsSunUpdate; - m_scene.EventManager.OnGetCurrentTimeAsLindenSunHour -= GetCurrentTimeAsLindenSunHour; - } - - public string Name + public void RemoveRegion(Scene scene) { - get { return "SunModule"; } + scene.RegisterModuleInterface(this); + scene.EventManager.OnFrame -= SunUpdate; + scene.EventManager.OnAvatarEnteringNewParcel -= AvatarEnteringParcel; + scene.EventManager.OnEstateToolsSunUpdate -= EstateToolsSunUpdate; + scene.EventManager.OnGetCurrentTimeAsLindenSunHour -= GetCurrentTimeAsLindenSunHour; } - public bool IsSharedModule - { - get { return false; } - } #endregion #region EventManager Events diff --git a/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs b/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs index c2ad7b8..0b487ed 100644 --- a/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs +++ b/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs @@ -28,6 +28,7 @@ using System; using System.Reflection; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -36,7 +37,8 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Avatar.Vegetation { - public class VegetationModule : IRegionModule, IVegetationModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class VegetationModule : INonSharedRegionModule, IVegetationModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -45,17 +47,34 @@ namespace OpenSim.Region.CoreModules.Avatar.Vegetation protected static readonly PCode[] creationCapabilities = new PCode[] { PCode.Grass, PCode.NewTree, PCode.Tree }; public PCode[] CreationCapabilities { get { return creationCapabilities; } } - public void Initialise(Scene scene, IConfigSource source) + public void Initialise(IConfigSource source) + { + } + + public void AddRegion(Scene scene) { m_scene = scene; m_scene.RegisterModuleInterface(this); } + + public Type ReplaceableInterface + { + get { return null; } + } + + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + scene.UnregisterModuleInterface(this); + } public void PostInitialise() {} public void Close() {} public string Name { get { return "Vegetation Module"; } } - public bool IsSharedModule { get { return false; } } - + public SceneObjectGroup AddTree( UUID uuid, UUID groupID, Vector3 scale, Quaternion rotation, Vector3 position, Tree treeType, bool newTree) { diff --git a/OpenSim/Region/CoreModules/World/Wind/WindModule.cs b/OpenSim/Region/CoreModules/World/Wind/WindModule.cs index 3283c1f..cd3706d 100644 --- a/OpenSim/Region/CoreModules/World/Wind/WindModule.cs +++ b/OpenSim/Region/CoreModules/World/Wind/WindModule.cs @@ -55,17 +55,19 @@ namespace OpenSim.Region.CoreModules private IWindModelPlugin m_activeWindPlugin = null; private const string m_dWindPluginName = "SimpleRandomWind"; + private string m_desiredWindPlugin = "SimpleRandomWind"; private Dictionary m_availableWindPlugins = new Dictionary(); // Simplified windSpeeds based on the fact that the client protocal tracks at a resolution of 16m private Vector2[] windSpeeds = new Vector2[16 * 16]; + private IConfig windConfig; #region IRegion Methods - public void Initialise(Scene scene, IConfigSource config) + public void Initialise(IConfigSource config) { - IConfig windConfig = config.Configs["Wind"]; - string desiredWindPlugin = m_dWindPluginName; + windConfig = config.Configs["Wind"]; + m_desiredWindPlugin = m_dWindPluginName; if (windConfig != null) { @@ -76,10 +78,18 @@ namespace OpenSim.Region.CoreModules // Determine which wind model plugin is desired if (windConfig.Contains("wind_plugin")) { - desiredWindPlugin = windConfig.GetString("wind_plugin"); + m_desiredWindPlugin = windConfig.GetString("wind_plugin"); } } + } + + public Type ReplaceableInterface + { + get { return null; } + } + public void AddRegion(Scene scene) + { if (m_enabled) { m_log.InfoFormat("[WIND] Enabled with an update rate of {0} frames.", m_frameUpdateRate); @@ -95,30 +105,30 @@ namespace OpenSim.Region.CoreModules } // Check for desired plugin - if (m_availableWindPlugins.ContainsKey(desiredWindPlugin)) + if (m_availableWindPlugins.ContainsKey(m_desiredWindPlugin)) { - m_activeWindPlugin = m_availableWindPlugins[desiredWindPlugin]; + m_activeWindPlugin = m_availableWindPlugins[m_desiredWindPlugin]; - m_log.InfoFormat("[WIND] {0} plugin found, initializing.", desiredWindPlugin); + m_log.InfoFormat("[WIND] {0} plugin found, initializing.", m_desiredWindPlugin); if (windConfig != null) { m_activeWindPlugin.Initialise(); m_activeWindPlugin.WindConfig(m_scene, windConfig); } - } + } // if the plug-in wasn't found, default to no wind. if (m_activeWindPlugin == null) { - m_log.ErrorFormat("[WIND] Could not find specified wind plug-in: {0}", desiredWindPlugin); + m_log.ErrorFormat("[WIND] Could not find specified wind plug-in: {0}", m_desiredWindPlugin); m_log.ErrorFormat("[WIND] Defaulting to no wind."); } // This one puts an entry in the main help screen m_scene.AddCommand(this, String.Empty, "wind", "Usage: wind [value] - Get or Update Wind paramaters", null); - + // This one enables the ability to type just the base command without any parameters m_scene.AddCommand(this, "wind", "", "", HandleConsoleCommand); @@ -127,7 +137,7 @@ namespace OpenSim.Region.CoreModules { m_scene.AddCommand(this, String.Format("wind base wind_plugin {0}", windPlugin.Name), String.Format("{0} - {1}", windPlugin.Name, windPlugin.Description), "", HandleConsoleBaseCommand); m_scene.AddCommand(this, String.Format("wind base wind_update_rate"), "Change the wind update rate.", "", HandleConsoleBaseCommand); - + foreach (KeyValuePair kvp in windPlugin.WindParams()) { m_scene.AddCommand(this, String.Format("wind {0} {1}", windPlugin.Name, kvp.Key), String.Format("{0} : {1} - {2}", windPlugin.Name, kvp.Key, kvp.Value), "", HandleConsoleParamCommand); @@ -149,11 +159,17 @@ namespace OpenSim.Region.CoreModules m_ready = true; } + } + public void RegionLoaded(Scene scene) + { } - public void PostInitialise() + public void RemoveRegion(Scene scene) { + scene.EventManager.OnFrame -= WindUpdate; + scene.EventManager.OnMakeRootAgent -= OnAgentEnteredRegion; + scene.UnregisterModuleInterface(this); } public void Close() @@ -182,11 +198,6 @@ namespace OpenSim.Region.CoreModules get { return "WindModule"; } } - public bool IsSharedModule - { - get { return false; } - } - #endregion diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs index 285d36a..6bda1e9 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs @@ -30,6 +30,7 @@ using System.Collections.Generic; using System.Drawing; using System.Reflection; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenMetaverse.Imaging; @@ -59,7 +60,8 @@ namespace OpenSim.Region.CoreModules.World.WorldMap public face[] trns; } - public class MapImageModule : IMapImageGenerator, IRegionModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class MapImageModule : IMapImageGenerator, INonSharedRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -128,37 +130,45 @@ namespace OpenSim.Region.CoreModules.World.WorldMap #endregion - #region IRegionModule Members + #region INonSharedRegionModule Members - public void Initialise(Scene scene, IConfigSource source) + public void Initialise(IConfigSource source) { - m_scene = scene; m_config = source; IConfig startupConfig = m_config.Configs["Startup"]; if (startupConfig.GetString("MapImageModule", "MapImageModule") != "MapImageModule") return; + } + public void AddRegion(Scene scene) + { + m_scene = scene; m_scene.RegisterModuleInterface(this); } - public void PostInitialise() + public Type ReplaceableInterface { + get { return null; } } - public void Close() + public void RegionLoaded(Scene scene) { } - public string Name + public void RemoveRegion(Scene scene) { - get { return "MapImageModule"; } + scene.UnregisterModuleInterface(this); } - public bool IsSharedModule + public void Close() + { + } + + public string Name { - get { return false; } + get { return "MapImageModule"; } } #endregion diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs index be46fa5..dd33673 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs @@ -24,9 +24,12 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + +using System; using System.Collections.Generic; using System.Reflection; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -38,7 +41,8 @@ using GridRegion = OpenSim.Services.Interfaces.GridRegion; namespace OpenSim.Region.CoreModules.World.WorldMap { - public class MapSearchModule : IRegionModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class MapSearchModule : ISharedRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -46,8 +50,12 @@ namespace OpenSim.Region.CoreModules.World.WorldMap Scene m_scene = null; // only need one for communication with GridService List m_scenes = new List(); - #region IRegionModule Members - public void Initialise(Scene scene, IConfigSource source) + #region ISharedRegionModule Members + public void Initialise(IConfigSource source) + { + } + + public void AddRegion(Scene scene) { if (m_scene == null) { @@ -58,6 +66,22 @@ namespace OpenSim.Region.CoreModules.World.WorldMap scene.EventManager.OnNewClient += OnNewClient; } + public Type ReplaceableInterface + { + get { return null; } + } + + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + if(m_scenes.Contains(scene)) + m_scenes.Remove(scene); + scene.EventManager.OnNewClient -= OnNewClient; + } + public void PostInitialise() { } @@ -73,11 +97,6 @@ namespace OpenSim.Region.CoreModules.World.WorldMap get { return "MapSearchModule"; } } - public bool IsSharedModule - { - get { return true; } - } - #endregion private void OnNewClient(IClientAPI client) -- cgit v1.1 From c26f1d1bfa968f718f86761f485a6ed440b3798e Mon Sep 17 00:00:00 2001 From: Revolution Date: Wed, 27 Jan 2010 17:44:57 -0600 Subject: Changes WorldCommModule to ISharedRegionModule. Signed-off-by: Melanie --- OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs index acd8dbf..d935c56 100644 --- a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs @@ -87,7 +87,7 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Scripting.WorldComm { [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class WorldCommModule : INonSharedRegionModule, IWorldComm + public class WorldCommModule : ISharedRegionModule, IWorldComm { // private static readonly ILog m_log = // LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -127,6 +127,10 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm m_pending = Queue.Synchronized(m_pendingQ); } + public void PostInitialise() + { + } + public void AddRegion(Scene scene) { m_scene = scene; -- cgit v1.1 From ee12b00cfa829d798ebf6490a8297710047b8f5c Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 28 Jan 2010 14:34:31 +0000 Subject: Fixes inconsistencies in the permissions module. Adds a region_manager_is_god configurable. Previously, estate managers could enter god mode, but would not have any powers. Now estate managers can enter god mode only if this option is true, and then will have real god powers. --- .../Region/CoreModules/World/Permissions/PermissionsModule.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index 68e8485..5b15065 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs @@ -127,6 +127,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions private bool m_debugPermissions = false; private bool m_allowGridGods = false; private bool m_RegionOwnerIsGod = false; + private bool m_RegionManagerIsGod = false; private bool m_ParcelOwnerIsGod = false; /// @@ -167,6 +168,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions m_bypassPermissions = !myConfig.GetBoolean("serverside_object_permissions", false); m_propagatePermissions = myConfig.GetBoolean("propagate_permissions", true); m_RegionOwnerIsGod = myConfig.GetBoolean("region_owner_is_god", true); + m_RegionManagerIsGod = myConfig.GetBoolean("region_manager_is_god", false); m_ParcelOwnerIsGod = myConfig.GetBoolean("parcel_owner_is_god", true); m_allowedScriptCreators @@ -528,10 +530,13 @@ namespace OpenSim.Region.CoreModules.World.Permissions if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero) { - if (m_scene.RegionInfo.EstateSettings.EstateOwner == user) + if (m_scene.RegionInfo.EstateSettings.EstateOwner == user && m_RegionOwnerIsGod) return true; } + if (IsEstateManager(user) && m_RegionManagerIsGod) + return true; + if (m_allowGridGods) { CachedUserInfo profile = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(user); @@ -544,6 +549,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions return false; } + protected bool IsFriendWithPerms(UUID user,UUID objectOwner) { @@ -948,9 +954,6 @@ namespace OpenSim.Region.CoreModules.World.Permissions DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; - if (IsEstateManager(user) && m_RegionOwnerIsGod) - return true; - return IsAdministrator(user); } -- cgit v1.1 From a87a247f0548d39a8c39b1d28123d7da8db44598 Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 29 Jan 2010 07:20:13 +0000 Subject: Revert "Updates all IRegionModules to the new style region modules." This reverts commit ec3c31e61e5e540f822891110df9bc978655bbaf. --- .../AssetTransaction/AssetTransactionModule.cs | 35 +--- .../Agent/Capabilities/CapabilitiesModule.cs | 2 +- .../Region/CoreModules/Agent/IPBan/IPBanModule.cs | 40 ++-- .../Agent/TextureDownload/TextureDownloadModule.cs | 33 +--- .../Agent/TextureSender/J2KDecoderModule.cs | 33 +--- .../Region/CoreModules/Agent/Xfer/XferModule.cs | 30 +-- .../Avatar/AvatarFactory/AvatarFactoryModule.cs | 29 +-- .../CoreModules/Avatar/Combat/CombatModule.cs | 32 +--- .../CoreModules/Avatar/Dialog/DialogModule.cs | 32 +--- .../CoreModules/Avatar/Friends/FriendsModule.cs | 54 ++---- .../CoreModules/Avatar/Gestures/GesturesModule.cs | 30 +-- .../Region/CoreModules/Avatar/Gods/GodsModule.cs | 28 +-- .../CoreModules/Avatar/Groups/GroupsModule.cs | 35 +--- .../Avatar/InstantMessage/InstantMessageModule.cs | 53 ++---- .../Avatar/InstantMessage/MessageTransferModule.cs | 54 ++---- .../Avatar/InstantMessage/MuteListModule.cs | 48 ++--- .../Avatar/InstantMessage/OfflineMessageModule.cs | 41 ++-- .../Avatar/InstantMessage/PresenceModule.cs | 61 ++---- .../Inventory/Archiver/InventoryArchiverModule.cs | 35 +--- .../Inventory/Transfer/InventoryTransferModule.cs | 63 ++---- .../Region/CoreModules/Avatar/Lure/LureModule.cs | 61 ++---- .../CoreModules/Avatar/ObjectCaps/ObjectAdd.cs | 55 ++---- .../Avatar/Profiles/AvatarProfilesModule.cs | 32 ++-- .../Framework/EventQueue/EventQueueGetModule.cs | 40 ++-- .../Framework/Monitoring/MonitorModule.cs | 103 ++++------ .../Hypergrid/HGStandaloneLoginModule.cs | 83 +++----- OpenSim/Region/CoreModules/InterGrid/OGSRadmin.cs | 31 ++- .../InterGrid/OpenGridProtocolModule.cs | 100 ++++------ .../DynamicTexture/DynamicTextureModule.cs | 60 ++---- .../Scripting/EMailModules/EmailModule.cs | 32 +--- .../Scripting/HttpRequest/ScriptsHttpRequests.cs | 36 ++-- .../CoreModules/Scripting/LSLHttp/UrlModule.cs | 2 - .../Scripting/LoadImageURL/LoadImageURLModule.cs | 37 ++-- .../Scripting/VectorRender/VectorRenderModule.cs | 41 ++-- .../Scripting/WorldComm/WorldCommModule.cs | 33 ++-- .../CoreModules/Scripting/XMLRPC/XMLRPCModule.cs | 51 +---- .../Asset/AssetServiceInConnectorModule.cs | 2 +- .../Grid/HypergridServiceInConnectorModule.cs | 2 +- .../Inventory/InventoryServiceInConnectorModule.cs | 2 +- .../Land/LandServiceInConnectorModule.cs | 2 +- .../Neighbour/NeighbourServiceInConnectorModule.cs | 2 +- .../SimulationServiceInConnectorModule.cs | 2 +- .../Interregion/LocalInterregionComms.cs | 4 +- .../Interregion/RESTInterregionComms.cs | 16 +- .../CoreModules/World/Archiver/ArchiverModule.cs | 1 - .../Region/CoreModules/World/Cloud/CloudModule.cs | 30 +-- .../World/Estate/EstateManagementModule.cs | 58 +++--- .../World/Permissions/PermissionsModule.cs | 212 ++++++++------------- .../Region/CoreModules/World/Sound/SoundModule.cs | 33 +--- OpenSim/Region/CoreModules/World/Sun/SunModule.cs | 96 +++++----- .../World/Vegetation/VegetationModule.cs | 27 +-- .../Region/CoreModules/World/Wind/WindModule.cs | 45 ++--- .../CoreModules/World/WorldMap/MapImageModule.cs | 30 +-- .../CoreModules/World/WorldMap/MapSearchModule.cs | 35 +--- 54 files changed, 698 insertions(+), 1466 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs index 7012037..1077f4a 100644 --- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs +++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs @@ -27,7 +27,6 @@ using System; using System.Collections.Generic; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -36,8 +35,7 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Agent.AssetTransaction { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class AssetTransactionModule : ISharedRegionModule, IAgentAssetTransactions + public class AssetTransactionModule : IRegionModule, IAgentAssetTransactions { private readonly Dictionary RegisteredScenes = new Dictionary(); private bool m_dumpAssetsToFile = false; @@ -61,14 +59,9 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction //m_log.Debug("creating AgentAssetTransactionModule"); } - #region ISharedRegionModule Members + #region IRegionModule Members - public void Initialise(IConfigSource config) - { - - } - - public void AddRegion(Scene scene) + public void Initialise(Scene scene, IConfigSource config) { if (!RegisteredScenes.ContainsKey(scene.RegionInfo.RegionID)) { @@ -86,23 +79,6 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction m_scene = scene; } - public Type ReplaceableInterface - { - get { return null; } - } - - public void RegionLoaded(Scene scene) - { - } - - public void RemoveRegion(Scene scene) - { - if (RegisteredScenes.ContainsKey(scene.RegionInfo.RegionID)) - RegisteredScenes.Remove(scene.RegionInfo.RegionID); - scene.UnregisterModuleInterface(this); - scene.EventManager.OnNewClient -= NewClient; - } - public void PostInitialise() { } @@ -116,6 +92,11 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction get { return "AgentTransactionModule"; } } + public bool IsSharedModule + { + get { return true; } + } + #endregion public void NewClient(IClientAPI client) diff --git a/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs b/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs index 886173f..2a1355b 100644 --- a/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs +++ b/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs @@ -69,7 +69,7 @@ namespace OpenSim.Region.CoreModules.Agent.Capabilities public void RemoveRegion(Scene scene) { - scene.UnregisterModuleInterface(this); + m_scene.UnregisterModuleInterface(this); } public void PostInitialise() {} diff --git a/OpenSim/Region/CoreModules/Agent/IPBan/IPBanModule.cs b/OpenSim/Region/CoreModules/Agent/IPBan/IPBanModule.cs index f7f2eff..bfe2a71 100644 --- a/OpenSim/Region/CoreModules/Agent/IPBan/IPBanModule.cs +++ b/OpenSim/Region/CoreModules/Agent/IPBan/IPBanModule.cs @@ -29,7 +29,6 @@ using System; using System.Collections.Generic; using System.IO; using System.Text; -using Mono.Addins; using Nini.Config; using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; @@ -37,27 +36,21 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Agent.IPBan { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class IPBanModule : ISharedRegionModule + public class IPBanModule : IRegionModule { - #region Implementation of ISharedRegionModule + #region Implementation of IRegionModule private List m_bans = new List(); - private Dictionary SceneBanners = new Dictionary(); - public void Initialise(IConfigSource source) + public void Initialise(Scene scene, IConfigSource source) { - } - - public void AddRegion(Scene scene) - { - SceneBanners.Add(scene, new SceneBanner(scene, m_bans)); + new SceneBanner(scene, m_bans); lock (m_bans) { foreach (EstateBan ban in scene.RegionInfo.EstateSettings.EstateBans) { - if (!String.IsNullOrEmpty(ban.BannedHostIPMask)) + if (!String.IsNullOrEmpty(ban.BannedHostIPMask)) m_bans.Add(ban.BannedHostIPMask); if (!String.IsNullOrEmpty(ban.BannedHostNameMask)) m_bans.Add(ban.BannedHostNameMask); @@ -65,12 +58,7 @@ namespace OpenSim.Region.CoreModules.Agent.IPBan } } - public Type ReplaceableInterface - { - get { return null; } - } - - public void RegionLoaded(Scene scene) + public void PostInitialise() { if (File.Exists("bans.txt")) { @@ -82,18 +70,9 @@ namespace OpenSim.Region.CoreModules.Agent.IPBan } } - public void RemoveRegion(Scene scene) - { - if(SceneBanners.ContainsKey(scene)) - SceneBanners.Remove(scene); - } - - public void PostInitialise() - { - } - public void Close() { + } public string Name @@ -101,6 +80,11 @@ namespace OpenSim.Region.CoreModules.Agent.IPBan get { return "IPBanModule"; } } + public bool IsSharedModule + { + get { return true; } + } + #endregion /// diff --git a/OpenSim/Region/CoreModules/Agent/TextureDownload/TextureDownloadModule.cs b/OpenSim/Region/CoreModules/Agent/TextureDownload/TextureDownloadModule.cs index c4d84cb..71ff28c 100644 --- a/OpenSim/Region/CoreModules/Agent/TextureDownload/TextureDownloadModule.cs +++ b/OpenSim/Region/CoreModules/Agent/TextureDownload/TextureDownloadModule.cs @@ -30,7 +30,6 @@ using System.Collections.Generic; using System.Reflection; using System.Threading; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -42,8 +41,7 @@ using OpenSim.Services.Interfaces; namespace OpenSim.Region.CoreModules.Agent.TextureDownload { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class TextureDownloadModule : INonSharedRegionModule + public class TextureDownloadModule : IRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -67,14 +65,11 @@ namespace OpenSim.Region.CoreModules.Agent.TextureDownload { } - #region INonSharedRegionModule Members + #region IRegionModule Members - public void Initialise(IConfigSource config) - { - } - - public void AddRegion(Scene scene) + public void Initialise(Scene scene, IConfigSource config) { + if (m_scene == null) { //m_log.Debug("Creating Texture download module"); @@ -95,23 +90,10 @@ namespace OpenSim.Region.CoreModules.Agent.TextureDownload } } - public Type ReplaceableInterface - { - get { return null; } - } - - public void RegionLoaded(Scene scene) + public void PostInitialise() { } - public void RemoveRegion(Scene scene) - { - if(m_scenes.Contains(scene)) - m_scenes.Remove(scene); - scene.EventManager.OnNewClient -= NewClient; - scene.EventManager.OnRemovePresence -= EventManager_OnRemovePresence; - } - public void Close() { } @@ -121,6 +103,11 @@ namespace OpenSim.Region.CoreModules.Agent.TextureDownload get { return "TextureDownloadModule"; } } + public bool IsSharedModule + { + get { return false; } + } + #endregion /// diff --git a/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs b/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs index ff87493..7ac8bed 100644 --- a/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs +++ b/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs @@ -32,7 +32,6 @@ using System.Reflection; using System.Text; using System.Threading; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenMetaverse.Imaging; @@ -46,8 +45,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender { public delegate void J2KDecodeDelegate(UUID assetID); - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class J2KDecoderModule : ISharedRegionModule, IJ2KDecoder + public class J2KDecoderModule : IRegionModule, IJ2KDecoder { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -60,19 +58,16 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender /// Reference to a scene (doesn't matter which one as long as it can load the cache module) private Scene m_scene; - #region ISharedRegionModule + #region IRegionModule public string Name { get { return "J2KDecoderModule"; } } - - public J2KDecoderModule() - { - } + public bool IsSharedModule { get { return true; } } - public void Initialise(IConfigSource source) + public J2KDecoderModule() { } - public void AddRegion(Scene scene) + public void Initialise(Scene scene, IConfigSource source) { if (m_scene == null) m_scene = scene; @@ -80,30 +75,16 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender scene.RegisterModuleInterface(this); } - public Type ReplaceableInterface - { - get { return null; } - } - - public void RegionLoaded(Scene scene) - { - m_cache = m_scene.RequestModuleInterface(); - } - - public void RemoveRegion(Scene scene) - { - scene.UnregisterModuleInterface(this); - } - public void PostInitialise() { + m_cache = m_scene.RequestModuleInterface(); } public void Close() { } - #endregion + #endregion IRegionModule #region IJ2KDecoder diff --git a/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs b/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs index d062361..ef7dce8 100644 --- a/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs +++ b/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs @@ -27,7 +27,6 @@ using System; using System.Collections.Generic; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -36,8 +35,7 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Agent.Xfer { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class XferModule : INonSharedRegionModule, IXfer + public class XferModule : IRegionModule, IXfer { private Scene m_scene; private Dictionary Requests = new Dictionary(); @@ -54,13 +52,9 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer public DateTime timeStamp; } - #region INonSharedRegionModule Members + #region IRegionModule Members - public void Initialise(IConfigSource config) - { - } - - public void AddRegion(Scene scene) + public void Initialise(Scene scene, IConfigSource config) { m_scene = scene; m_scene.EventManager.OnNewClient += NewClient; @@ -68,21 +62,10 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer m_scene.RegisterModuleInterface(this); } - public Type ReplaceableInterface - { - get { return null; } - } - - public void RegionLoaded(Scene scene) + public void PostInitialise() { } - public void RemoveRegion(Scene scene) - { - scene.EventManager.OnNewClient -= NewClient; - scene.UnregisterModuleInterface(this); - } - public void Close() { } @@ -92,6 +75,11 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer get { return "XferModule"; } } + public bool IsSharedModule + { + get { return false; } + } + #endregion #region IXfer Members diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index 6bbbd56..35c59aa 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs @@ -28,7 +28,6 @@ using System; using System.Reflection; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -39,8 +38,7 @@ using OpenSim.Services.Interfaces; namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class AvatarFactoryModule : IAvatarFactory, ISharedRegionModule + public class AvatarFactoryModule : IAvatarFactory, IRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private Scene m_scene = null; @@ -77,16 +75,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory return appearance; } - public void Initialise(IConfigSource source) - { - } - - public Type ReplaceableInterface - { - get { return null; } - } - - public void AddRegion(Scene scene) + public void Initialise(Scene scene, IConfigSource source) { scene.RegisterModuleInterface(this); scene.EventManager.OnNewClient += NewClient; @@ -95,18 +84,9 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory { m_scene = scene; } - } - public void RegionLoaded(Scene scene) - { } - public void RemoveRegion(Scene scene) - { - scene.UnregisterModuleInterface(this); - scene.EventManager.OnNewClient -= NewClient; - } - public void PostInitialise() { } @@ -120,6 +100,11 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory get { return "Default Avatar Factory"; } } + public bool IsSharedModule + { + get { return false; } + } + public void NewClient(IClientAPI client) { client.OnAvatarNowWearing += AvatarIsWearing; diff --git a/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs b/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs index b7d12aa..61b6d65 100644 --- a/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs @@ -27,7 +27,6 @@ using System; using System.Collections.Generic; -using Mono.Addins; using Nini.Config; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; @@ -35,8 +34,7 @@ using OpenMetaverse; namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class CombatModule : ISharedRegionModule + public class CombatModule : IRegionModule { //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -55,17 +53,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule /// /// /// - public void Initialise(IConfigSource config) - { - - } - - public Type ReplaceableInterface - { - get { return null; } - } - - public void AddRegion(Scene scene) + public void Initialise(Scene scene, IConfigSource config) { lock (m_scenel) { @@ -83,17 +71,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule scene.EventManager.OnAvatarEnteringNewParcel += AvatarEnteringParcel; } - public void RegionLoaded(Scene scene) - { - } - - public void RemoveRegion(Scene scene) - { - scene.EventManager.OnAvatarKilled -= KillAvatar; - scene.EventManager.OnAvatarEnteringNewParcel -= AvatarEnteringParcel; - m_scenel.Remove(scene.RegionInfo.RegionHandle); - } - public void PostInitialise() { } @@ -107,6 +84,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule get { return "CombatModule"; } } + public bool IsSharedModule + { + get { return true; } + } + private void KillAvatar(uint killerObjectLocalID, ScenePresence DeadAvatar) { if (killerObjectLocalID == 0) diff --git a/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs b/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs index ecffc7a..72ec869 100644 --- a/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs @@ -25,11 +25,9 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -using System; using System.Collections.Generic; using System.Reflection; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -39,46 +37,28 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Avatar.Dialog { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class DialogModule : ISharedRegionModule, IDialogModule + public class DialogModule : IRegionModule, IDialogModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); protected Scene m_scene; - public void Initialise(IConfigSource source) - { - } - - public Type ReplaceableInterface - { - get { return null; } - } - - public void AddRegion(Scene scene) + public void Initialise(Scene scene, IConfigSource source) { m_scene = scene; m_scene.RegisterModuleInterface(this); - + m_scene.AddCommand( this, "alert", "alert ", "Send an alert to a user", HandleAlertConsoleCommand); m_scene.AddCommand( this, "alert general", "alert general ", "Send an alert to everyone", HandleAlertConsoleCommand); } - - public void RegionLoaded(Scene scene) - { - } - - public void RemoveRegion(Scene scene) - { - scene.UnregisterModuleInterface(this); - } - - public void PostInitialise() { } + + public void PostInitialise() {} public void Close() {} public string Name { get { return "Dialog Module"; } } + public bool IsSharedModule { get { return false; } } public void SendAlertToUser(IClientAPI client, string message) { diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index 7254180..086d4fe 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs @@ -31,7 +31,6 @@ using System.Collections.Generic; using System.Net; using System.Reflection; using log4net; -using Mono.Addins; using Nini.Config; using Nwc.XmlRpc; using OpenMetaverse; @@ -82,8 +81,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends - Terminate Friendship messages (single) */ - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class FriendsModule : ISharedRegionModule, IFriendsModule + public class FriendsModule : IRegionModule, IFriendsModule { private class Transaction { @@ -113,23 +111,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends private IGridService m_gridServices = null; - #region ISharedRegionModule Members + #region IRegionModule Members - public void Initialise(IConfigSource config) - { - - } - - public void PostInitialise() - { - } - - public Type ReplaceableInterface - { - get { return null; } - } - - public void AddRegion(Scene scene) + public void Initialise(Scene scene, IConfigSource config) { lock (m_scenes) { @@ -144,9 +128,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends if (!m_scenes.ContainsKey(scene.RegionInfo.RegionHandle)) m_scenes[scene.RegionInfo.RegionHandle] = scene; } - + scene.RegisterModuleInterface(this); - + scene.EventManager.OnNewClient += OnNewClient; scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage; scene.EventManager.OnAvatarEnteringNewParcel += AvatarEnteringParcel; @@ -154,34 +138,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends scene.EventManager.OnClientClosed += ClientClosed; } - public void RegionLoaded(Scene scene) + public void PostInitialise() { if (m_scenes.Count > 0) { - m_TransferModule = scene.RequestModuleInterface(); - m_gridServices = scene.GridService; + m_TransferModule = m_initialScene.RequestModuleInterface(); + m_gridServices = m_initialScene.GridService; } if (m_TransferModule == null) m_log.Error("[FRIENDS]: Unable to find a message transfer module, friendship offers will not work"); } - public void RemoveRegion(Scene scene) - { - MainServer.Instance.RemoveXmlRPCHandler("presence_update_bulk"); - MainServer.Instance.RemoveXmlRPCHandler("terminate_friend"); - - if (m_scenes.ContainsKey(scene.RegionInfo.RegionHandle)) - m_scenes.Remove(scene.RegionInfo.RegionHandle); - - scene.UnregisterModuleInterface(this); - - scene.EventManager.OnNewClient -= OnNewClient; - scene.EventManager.OnIncomingInstantMessage -= OnGridInstantMessage; - scene.EventManager.OnAvatarEnteringNewParcel -= AvatarEnteringParcel; - scene.EventManager.OnMakeChildAgent -= MakeChildAgent; - scene.EventManager.OnClientClosed -= ClientClosed; - } - public void Close() { } @@ -191,6 +158,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends get { return "FriendsModule"; } } + public bool IsSharedModule + { + get { return true; } + } + #endregion #region IInterregionFriendsComms diff --git a/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs b/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs index c306f94..8ce5092 100644 --- a/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs @@ -25,10 +25,8 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -using System; using System.Reflection; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -39,41 +37,23 @@ using OpenSim.Services.Interfaces; namespace OpenSim.Region.CoreModules.Avatar.Gestures { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class GesturesModule : INonSharedRegionModule + public class GesturesModule : IRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); protected Scene m_scene; - public void Initialise(IConfigSource source) - { - } - - public Type ReplaceableInterface - { - get { return null; } - } - - public void AddRegion(Scene scene) + public void Initialise(Scene scene, IConfigSource source) { m_scene = scene; + m_scene.EventManager.OnNewClient += OnNewClient; } - - public void RegionLoaded(Scene scene) - { - } - - public void RemoveRegion(Scene scene) - { - if(m_scene == scene) - m_scene = null; - scene.EventManager.OnNewClient -= OnNewClient; - } + public void PostInitialise() {} public void Close() {} public string Name { get { return "Gestures Module"; } } + public bool IsSharedModule { get { return false; } } private void OnNewClient(IClientAPI client) { diff --git a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs index 3914f2e..50171a3 100644 --- a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs @@ -25,9 +25,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -using System; using System.Collections.Generic; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -36,8 +34,7 @@ using OpenSim.Region.Framework.Interfaces; namespace OpenSim.Region.CoreModules.Avatar.Gods { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class GodsModule : INonSharedRegionModule, IGodsModule + public class GodsModule : IRegionModule, IGodsModule { /// Special UUID for actions that apply to all agents private static readonly UUID ALL_AGENTS = new UUID("44e87126-e794-4ded-05b3-7c42da3d5cdb"); @@ -45,34 +42,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods protected Scene m_scene; protected IDialogModule m_dialogModule; - public void Initialise(IConfigSource source) - { - - } - - public Type ReplaceableInterface - { - get { return null; } - } - - public void AddRegion(Scene scene) + public void Initialise(Scene scene, IConfigSource source) { m_scene = scene; m_dialogModule = m_scene.RequestModuleInterface(); m_scene.RegisterModuleInterface(this); } - - public void RegionLoaded(Scene scene) - { - } - - public void RemoveRegion(Scene scene) - { - scene.UnregisterModuleInterface(this); - } + public void PostInitialise() {} public void Close() {} public string Name { get { return "Gods Module"; } } + public bool IsSharedModule { get { return false; } } public void RequestGodlikePowers( UUID agentID, UUID sessionID, UUID token, bool godLike, IClientAPI controllingClient) diff --git a/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs b/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs index 7ff8d30..31363e5 100644 --- a/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs @@ -25,11 +25,9 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -using System; using System.Collections.Generic; using System.Reflection; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -38,8 +36,7 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Avatar.Groups { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class GroupsModule : ISharedRegionModule + public class GroupsModule : IRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -58,9 +55,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Groups private static GroupMembershipData osGroup = new GroupMembershipData(); - #region ISharedRegionModule Members + #region IRegionModule Members - public void Initialise(IConfigSource config) + public void Initialise(Scene scene, IConfigSource config) { IConfig groupsConfig = config.Configs["Groups"]; @@ -79,15 +76,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Groups if (groupsConfig.GetString("Module", "Default") != "Default") return; } - } - - public Type ReplaceableInterface - { - get { return null; } - } - public void AddRegion(Scene scene) - { lock (m_SceneList) { if (!m_SceneList.Contains(scene)) @@ -110,19 +99,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Groups scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage; } - public void RegionLoaded(Scene scene) - { - } - - public void RemoveRegion(Scene scene) - { - if (m_SceneList.Contains(scene)) - m_SceneList.Remove(scene); - scene.EventManager.OnNewClient -= OnNewClient; - scene.EventManager.OnClientClosed -= OnClientClosed; - scene.EventManager.OnIncomingInstantMessage -= OnGridInstantMessage; - } - public void PostInitialise() { } @@ -147,6 +123,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Groups get { return "GroupsModule"; } } + public bool IsSharedModule + { + get { return true; } + } + #endregion private void OnNewClient(IClientAPI client) diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs index e1bde4b..9a68749 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs @@ -24,12 +24,9 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -using System; using System.Collections.Generic; using System.Reflection; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -39,8 +36,7 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Avatar.InstantMessage { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class InstantMessageModule : ISharedRegionModule + public class InstantMessageModule : IRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -51,11 +47,11 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage private readonly List m_scenes = new List(); - #region ISharedRegionModule Members + #region IRegionModule Members private IMessageTransferModule m_TransferModule = null; - public void Initialise(IConfigSource config) + public void Initialise(Scene scene, IConfigSource config) { if (config.Configs["Messaging"] != null) { @@ -66,15 +62,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage } m_enabled = true; - } - - public Type ReplaceableInterface - { - get { return null; } - } - public void AddRegion(Scene scene) - { lock (m_scenes) { if (!m_scenes.Contains(scene)) @@ -86,27 +74,6 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage } } - public void RegionLoaded(Scene scene) - { - if (!m_enabled) - return; - - m_TransferModule = - m_scenes[0].RequestModuleInterface(); - - if (m_TransferModule == null) - m_log.Error("[INSTANT MESSAGE]: No message transfer module, " + - "IM will not work!"); - } - - public void RemoveRegion(Scene scene) - { - if (m_scenes.Contains(scene)) - m_scenes.Remove(scene); - scene.EventManager.OnClientConnect -= OnClientConnect; - scene.EventManager.OnIncomingInstantMessage -= OnGridInstantMessage; - } - void OnClientConnect(IClientCore client) { IClientIM clientIM; @@ -118,6 +85,15 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage public void PostInitialise() { + if (!m_enabled) + return; + + m_TransferModule = + m_scenes[0].RequestModuleInterface(); + + if (m_TransferModule == null) + m_log.Error("[INSTANT MESSAGE]: No message transfer module, "+ + "IM will not work!"); } public void Close() @@ -129,6 +105,11 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage get { return "InstantMessageModule"; } } + public bool IsSharedModule + { + get { return true; } + } + #endregion public void OnInstantMessage(IClientAPI client, GridInstantMessage im) diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs index 16bdfdd..e5159b3 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs @@ -30,7 +30,6 @@ using System.Collections.Generic; using System.Net; using System.Reflection; using log4net; -using Mono.Addins; using Nini.Config; using Nwc.XmlRpc; using OpenMetaverse; @@ -41,8 +40,7 @@ using GridRegion = OpenSim.Services.Interfaces.GridRegion; namespace OpenSim.Region.CoreModules.Avatar.InstantMessage { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class MessageTransferModule : ISharedRegionModule, IMessageTransferModule + public class MessageTransferModule : IRegionModule, IMessageTransferModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -52,9 +50,8 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage protected Dictionary m_UserRegionMap = new Dictionary(); public event UndeliveredMessage OnUndeliveredMessage; - private bool m_enabled = true; - public virtual void Initialise(IConfigSource config) + public virtual void Initialise(Scene scene, IConfigSource config) { IConfig cnf = config.Configs["Messaging"]; if (cnf != null && cnf.GetString( @@ -62,49 +59,27 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage "MessageTransferModule") { m_log.Debug("[MESSAGE TRANSFER]: Disabled by configuration"); - m_enabled = false; + return; } cnf = config.Configs["Startup"]; if (cnf != null) m_Gridmode = cnf.GetBoolean("gridmode", false); - } - public Type ReplaceableInterface - { - get { return null; } - } + // m_Enabled = true; - public void AddRegion(Scene scene) - { - if (m_enabled) + lock (m_Scenes) { - lock (m_Scenes) + if (m_Scenes.Count == 0) { - if (m_Scenes.Count == 0) - { - MainServer.Instance.AddXmlRPCHandler( - "grid_instant_message", processXMLRPCGridInstantMessage); - } - - m_log.Debug("[MESSAGE TRANSFER]: Message transfer module active"); - scene.RegisterModuleInterface(this); - m_Scenes.Add(scene); + MainServer.Instance.AddXmlRPCHandler( + "grid_instant_message", processXMLRPCGridInstantMessage); } - } - } - public void RegionLoaded(Scene scene) - { - } - - public void RemoveRegion(Scene scene) - { - if (m_Scenes.Contains(scene)) - m_Scenes.Remove(scene); - MainServer.Instance.RemoveXmlRPCHandler( - "grid_instant_message"); - scene.UnregisterModuleInterface(this); + m_log.Debug("[MESSAGE TRANSFER]: Message transfer module active"); + scene.RegisterModuleInterface(this); + m_Scenes.Add(scene); + } } public virtual void PostInitialise() @@ -120,6 +95,11 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage get { return "MessageTransferModule"; } } + public virtual bool IsSharedModule + { + get { return true; } + } + public virtual void SendInstantMessage(GridInstantMessage im, MessageResultNotification result) { UUID toAgentID = new UUID(im.toAgentID); diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs index 3570495..2d4a635 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs @@ -28,7 +28,6 @@ using System; using System.Collections.Generic; using System.Reflection; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -40,8 +39,7 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Avatar.MuteList { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class MuteListModule : ISharedRegionModule + public class MuteListModule : IRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -49,7 +47,7 @@ namespace OpenSim.Region.CoreModules.Avatar.MuteList private List m_SceneList = new List(); private string m_RestURL = String.Empty; - public void Initialise(IConfigSource config) + public void Initialise(Scene scene, IConfigSource config) { if (!enabled) return; @@ -68,24 +66,19 @@ namespace OpenSim.Region.CoreModules.Avatar.MuteList enabled = false; return; } - m_RestURL = cnf.GetString("MuteListURL", ""); - if (m_RestURL == "") - { - m_log.Error("[MUTE LIST] Module was enabled, but no URL is given, disabling"); - enabled = false; - return; - } - } - public Type ReplaceableInterface - { - get { return null; } - } - - public void AddRegion(Scene scene) - { lock (m_SceneList) { + if (m_SceneList.Count == 0) + { + m_RestURL = cnf.GetString("MuteListURL", ""); + if (m_RestURL == "") + { + m_log.Error("[MUTE LIST] Module was enabled, but no URL is given, disabling"); + enabled = false; + return; + } + } if (!m_SceneList.Contains(scene)) m_SceneList.Add(scene); @@ -93,18 +86,6 @@ namespace OpenSim.Region.CoreModules.Avatar.MuteList } } - public void RegionLoaded(Scene scene) - { - } - - public void RemoveRegion(Scene scene) - { - if (m_SceneList.Contains(scene)) - m_SceneList.Remove(scene); - - scene.EventManager.OnNewClient -= OnNewClient; - } - public void PostInitialise() { if (!enabled) @@ -121,6 +102,11 @@ namespace OpenSim.Region.CoreModules.Avatar.MuteList get { return "MuteListModule"; } } + public bool IsSharedModule + { + get { return true; } + } + public void Close() { } diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs index 6c4d0bf..ff38b6f 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs @@ -28,7 +28,6 @@ using System; using System.Collections.Generic; using System.Reflection; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -41,8 +40,7 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Avatar.InstantMessage { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class OfflineMessageModule : ISharedRegionModule + public class OfflineMessageModule : IRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -51,7 +49,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage private string m_RestURL = String.Empty; private bool m_ForwardOfflineGroupMessages = true; - public void Initialise(IConfigSource config) + public void Initialise(Scene scene, IConfigSource config) { if (!enabled) return; @@ -85,23 +83,14 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage return; } } - } - } - - public Type ReplaceableInterface - { - get { return null; } - } + if (!m_SceneList.Contains(scene)) + m_SceneList.Add(scene); - public void AddRegion(Scene scene) - { - if (!m_SceneList.Contains(scene)) - m_SceneList.Add(scene); - - scene.EventManager.OnNewClient += OnNewClient; + scene.EventManager.OnNewClient += OnNewClient; + } } - public void RegionLoaded(Scene scene) + public void PostInitialise() { if (!enabled) return; @@ -131,22 +120,16 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage m_log.Debug("[OFFLINE MESSAGING] Offline messages enabled"); } - public void RemoveRegion(Scene scene) - { - if (m_SceneList.Contains(scene)) - m_SceneList.Remove(scene); - scene.EventManager.OnNewClient -= OnNewClient; - } - - public void PostInitialise() - { - } - public string Name { get { return "OfflineMessageModule"; } } + public bool IsSharedModule + { + get { return true; } + } + public void Close() { } diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs index f5498f4..f5ab454 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs @@ -24,14 +24,11 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -using System; using System.Collections; using System.Collections.Generic; using System.Net; using System.Reflection; using log4net; -using Mono.Addins; using Nini.Config; using Nwc.XmlRpc; using OpenMetaverse; @@ -42,8 +39,7 @@ using GridRegion = OpenSim.Services.Interfaces.GridRegion; namespace OpenSim.Region.CoreModules.Avatar.InstantMessage { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class PresenceModule : ISharedRegionModule, IPresenceModule + public class PresenceModule : IRegionModule, IPresenceModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -63,7 +59,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage public event PresenceChange OnPresenceChange; public event BulkPresenceData OnBulkPresenceData; - public void Initialise(IConfigSource config) + public void Initialise(Scene scene, IConfigSource config) { lock (m_Scenes) { @@ -82,38 +78,28 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage m_Gridmode = cnf.GetBoolean("gridmode", false); m_Enabled = true; - } - } - } - public Type ReplaceableInterface - { - get { return null; } - } + m_initialScene = scene; + } - public void AddRegion(Scene scene) - { - if (m_Enabled) - { - m_initialScene = scene; if (m_Gridmode) NotifyMessageServerOfStartup(scene); m_Scenes.Add(scene); + } - scene.RegisterModuleInterface(this); + scene.RegisterModuleInterface(this); - scene.EventManager.OnNewClient += OnNewClient; - scene.EventManager.OnSetRootAgentScene += OnSetRootAgentScene; - scene.EventManager.OnMakeChildAgent += OnMakeChildAgent; - } + scene.EventManager.OnNewClient += OnNewClient; + scene.EventManager.OnSetRootAgentScene += OnSetRootAgentScene; + scene.EventManager.OnMakeChildAgent += OnMakeChildAgent; } - public void RegionLoaded(Scene scene) + public void PostInitialise() { } - public void RemoveRegion(Scene scene) + public void Close() { if (!m_Gridmode || !m_Enabled) return; @@ -130,28 +116,21 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage } } - NotifyMessageServerOfShutdown(scene); - if(m_Scenes.Contains(scene)) - m_Scenes.Remove(scene); - - scene.UnregisterModuleInterface(this); - - scene.EventManager.OnNewClient -= OnNewClient; - scene.EventManager.OnSetRootAgentScene -= OnSetRootAgentScene; - scene.EventManager.OnMakeChildAgent -= OnMakeChildAgent; - } - - public void PostInitialise() - { + lock (m_Scenes) + { + foreach (Scene scene in m_Scenes) + NotifyMessageServerOfShutdown(scene); + } } - public void Close() + public string Name { + get { return "PresenceModule"; } } - public string Name + public bool IsSharedModule { - get { return "PresenceModule"; } + get { return true; } } public void RequestBulkPresenceData(UUID[] users) diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs index a04ab22..ecd60bd 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs @@ -30,7 +30,6 @@ using System.Collections.Generic; using System.IO; using System.Reflection; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -42,11 +41,10 @@ using OpenSim.Services.Interfaces; namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] /// /// This module loads and saves OpenSimulator inventory archives /// - public class InventoryArchiverModule : ISharedRegionModule, IInventoryArchiverModule + public class InventoryArchiverModule : IRegionModule, IInventoryArchiverModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -84,28 +82,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver DisablePresenceChecks = disablePresenceChecks; } - public void Initialise(IConfigSource source) - { - - } - - public Type ReplaceableInterface - { - get { return null; } - } - - public void AddRegion(Scene scene) + public void Initialise(Scene scene, IConfigSource source) { if (m_scenes.Count == 0) { scene.RegisterModuleInterface(this); OnInventoryArchiveSaved += SaveInvConsoleCommandCompleted; - + scene.AddCommand( this, "load iar", "load iar []", - "Load user inventory archive.", HandleLoadInvConsoleCommand); - + "Load user inventory archive.", HandleLoadInvConsoleCommand); + scene.AddCommand( this, "save iar", "save iar []", @@ -113,21 +101,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver m_aScene = scene; } - + m_scenes[scene.RegionInfo.RegionID] = scene; } - public void RegionLoaded(Scene scene) - { - } - - public void RemoveRegion(Scene scene) - { - scene.UnregisterModuleInterface(this); - if(m_scenes.ContainsKey(scene.RegionInfo.RegionID)) - m_scenes.Remove(scene.RegionInfo.RegionID); - } - public void PostInitialise() {} public void Close() {} diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs index 44906b4..d9a021f 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs @@ -29,7 +29,6 @@ using System; using System.Collections.Generic; using System.Reflection; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -40,8 +39,7 @@ using OpenSim.Services.Interfaces; namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class InventoryTransferModule : IInventoryTransferModule, ISharedRegionModule + public class InventoryTransferModule : IInventoryTransferModule, IRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -52,11 +50,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer new Dictionary(); private IMessageTransferModule m_TransferModule = null; - private bool m_enabled = true; - #region ISharedRegionModule Members + #region IRegionModule Members - public void Initialise(IConfigSource config) + public void Initialise(Scene scene, IConfigSource config) { if (config.Configs["Messaging"] != null) { @@ -65,61 +62,31 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer if (config.Configs["Messaging"].GetString( "InventoryTransferModule", "InventoryTransferModule") != "InventoryTransferModule") - m_enabled = false; + return; } - } - - public Type ReplaceableInterface - { - get { return null; } - } - public void AddRegion(Scene scene) - { - if (m_enabled) + if (!m_Scenelist.Contains(scene)) { - if (!m_Scenelist.Contains(scene)) - { - m_Scenelist.Add(scene); + m_Scenelist.Add(scene); - scene.RegisterModuleInterface(this); + scene.RegisterModuleInterface(this); - scene.EventManager.OnNewClient += OnNewClient; - scene.EventManager.OnClientClosed += ClientLoggedOut; - scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage; - } + scene.EventManager.OnNewClient += OnNewClient; + scene.EventManager.OnClientClosed += ClientLoggedOut; + scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage; } } - public void RegionLoaded(Scene scene) + public void PostInitialise() { - if (m_enabled) + if (m_Scenelist.Count > 0) { - if (m_Scenelist.Count > 0) - { - m_TransferModule = m_Scenelist[0].RequestModuleInterface(); - if (m_TransferModule == null) - m_log.Error("[INVENTORY TRANSFER] No Message transfer module found, transfers will be local only"); - } + m_TransferModule = m_Scenelist[0].RequestModuleInterface(); + if (m_TransferModule == null) + m_log.Error("[INVENTORY TRANSFER] No Message transfer module found, transfers will be local only"); } } - public void RemoveRegion(Scene scene) - { - if (m_Scenelist.Contains(scene)) - m_Scenelist.Remove(scene); - - scene.UnregisterModuleInterface(this); - - scene.EventManager.OnNewClient -= OnNewClient; - scene.EventManager.OnClientClosed -= ClientLoggedOut; - scene.EventManager.OnIncomingInstantMessage -= OnGridInstantMessage; - } - - public void PostInitialise() - { - } - public void Close() { } diff --git a/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs b/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs index 973d27f..261bd6c 100644 --- a/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs @@ -29,7 +29,6 @@ using System; using System.Collections.Generic; using System.Reflection; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -38,72 +37,36 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Avatar.Lure { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class LureModule : ISharedRegionModule + public class LureModule : IRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private readonly List m_scenes = new List(); - private bool m_enabled = true; - private IMessageTransferModule m_TransferModule = null; - public void Initialise(IConfigSource config) + public void Initialise(Scene scene, IConfigSource config) { if (config.Configs["Messaging"] != null) { if (config.Configs["Messaging"].GetString( "LureModule", "LureModule") != "LureModule") - m_enabled = false; + return; } - } - - public Type ReplaceableInterface - { - get { return null; } - } - public void AddRegion(Scene scene) - { - if (m_enabled) + lock (m_scenes) { - lock (m_scenes) + if (!m_scenes.Contains(scene)) { - if (!m_scenes.Contains(scene)) - { - m_scenes.Add(scene); - scene.EventManager.OnNewClient += OnNewClient; - scene.EventManager.OnIncomingInstantMessage += - OnGridInstantMessage; - } + m_scenes.Add(scene); + scene.EventManager.OnNewClient += OnNewClient; + scene.EventManager.OnIncomingInstantMessage += + OnGridInstantMessage; } } } - public void RegionLoaded(Scene scene) - { - if (m_enabled) - { - m_TransferModule = - m_scenes[0].RequestModuleInterface(); - - if (m_TransferModule == null) - m_log.Error("[INSTANT MESSAGE]: No message transfer module, " + - "lures will not work!"); - } - } - - public void RemoveRegion(Scene scene) - { - if (m_scenes.Contains(scene)) - m_scenes.Remove(scene); - scene.EventManager.OnNewClient -= OnNewClient; - scene.EventManager.OnIncomingInstantMessage -= - OnGridInstantMessage; - } - void OnNewClient(IClientAPI client) { client.OnInstantMessage += OnInstantMessage; @@ -113,6 +76,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Lure public void PostInitialise() { + m_TransferModule = + m_scenes[0].RequestModuleInterface(); + + if (m_TransferModule == null) + m_log.Error("[INSTANT MESSAGE]: No message transfer module, "+ + "lures will not work!"); } public void Close() diff --git a/OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs b/OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs index 748b42c..63a93aa 100644 --- a/OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs +++ b/OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs @@ -29,7 +29,6 @@ using System; using System.Collections; using System.Reflection; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenMetaverse.StructuredData; @@ -42,54 +41,24 @@ using Caps=OpenSim.Framework.Capabilities.Caps; namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class ObjectAdd : ISharedRegionModule + public class ObjectAdd : IRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private Scene m_scene; - #region ISharedRegionModule Members + #region IRegionModule Members - public void Initialise(IConfigSource pSource) + public void Initialise(Scene pScene, IConfigSource pSource) { - - } - - public Type ReplaceableInterface - { - get { return null; } - } - - public void AddRegion(Scene scene) - { - m_scene = scene; + m_scene = pScene; m_scene.EventManager.OnRegisterCaps += RegisterCaps; } - public void RegionLoaded(Scene scene) - { - } - - public void RemoveRegion(Scene scene) - { - scene.EventManager.OnRegisterCaps -= RegisterCaps; - } - public void PostInitialise() { } - public void Close() - { - - } - - public string Name - { - get { return "ObjectAddModule"; } - } - public void RegisterCaps(UUID agentID, Caps caps) { UUID capuuid = UUID.Random(); @@ -379,6 +348,22 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps Array.Reverse(resultbytes); return String.Format("{0}",Convert.ToBase64String(resultbytes)); } + + public void Close() + { + + } + + public string Name + { + get { return "ObjectAddModule"; } + } + + public bool IsSharedModule + { + get { return false; } + } + #endregion } } diff --git a/OpenSim/Region/CoreModules/Avatar/Profiles/AvatarProfilesModule.cs b/OpenSim/Region/CoreModules/Avatar/Profiles/AvatarProfilesModule.cs index 7fcb0e1..8cf58c6 100644 --- a/OpenSim/Region/CoreModules/Avatar/Profiles/AvatarProfilesModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Profiles/AvatarProfilesModule.cs @@ -30,7 +30,6 @@ using System.Collections; using System.Globalization; using System.Reflection; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -39,17 +38,20 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Avatar.Profiles { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class AvatarProfilesModule : INonSharedRegionModule + public class AvatarProfilesModule : IRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private Scene m_scene; private IProfileModule m_profileModule = null; private bool m_enabled = true; - #region INonSharedRegionModule Members + public AvatarProfilesModule() + { + } - public void Initialise(IConfigSource config) + #region IRegionModule Members + + public void Initialise(Scene scene, IConfigSource config) { IConfig profileConfig = config.Configs["Profile"]; if (profileConfig != null) @@ -60,31 +62,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Profiles return; } } - } - - public Type ReplaceableInterface - { - get { return null; } - } - public void AddRegion(Scene scene) - { m_scene = scene; m_scene.EventManager.OnNewClient += NewClient; } - public void RegionLoaded(Scene scene) + public void PostInitialise() { if (!m_enabled) return; m_profileModule = m_scene.RequestModuleInterface(); } - public void RemoveRegion(Scene scene) - { - scene.EventManager.OnNewClient -= NewClient; - } - public void Close() { } @@ -94,6 +83,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Profiles get { return "AvatarProfilesModule"; } } + public bool IsSharedModule + { + get { return false; } + } + #endregion public void NewClient(IClientAPI client) diff --git a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs index 1ee6f0d..0c6cb1b 100644 --- a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs @@ -32,7 +32,6 @@ using System.Net; using System.Reflection; using System.Threading; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenMetaverse.Packets; @@ -53,13 +52,11 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue public OSDMap body; } - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class EventQueueGetModule : IEventQueue, INonSharedRegionModule + public class EventQueueGetModule : IEventQueue, IRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); protected Scene m_scene = null; private IConfigSource m_gConfig; - private IConfig m_startupConfig; bool enabledYN = false; private Dictionary m_ids = new Dictionary(); @@ -68,31 +65,23 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue private Dictionary m_QueueUUIDAvatarMapping = new Dictionary(); private Dictionary m_AvatarQueueUUIDMapping = new Dictionary(); - #region INonSharedRegionModule methods - public virtual void Initialise(IConfigSource config) + #region IRegionModule methods + public virtual void Initialise(Scene scene, IConfigSource config) { m_gConfig = config; - m_startupConfig = m_gConfig.Configs["Startup"]; - } + IConfig startupConfig = m_gConfig.Configs["Startup"]; - public Type ReplaceableInterface - { - get { return null; } - } - - public void AddRegion(Scene scene) - { - ReadConfigAndPopulate(scene, m_startupConfig, "Startup"); + ReadConfigAndPopulate(scene, startupConfig, "Startup"); if (enabledYN) { m_scene = scene; scene.RegisterModuleInterface(this); - + // Register fallback handler // Why does EQG Fail on region crossings! - + //scene.CommsManager.HttpServer.AddLLSDHandler("/CAPS/EQG/", EventQueueFallBack); scene.EventManager.OnNewClient += OnNewClient; @@ -110,19 +99,16 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue { m_gConfig = null; } + } - public void RegionLoaded(Scene scene) - { - } - - public void RemoveRegion(Scene scene) + private void ReadConfigAndPopulate(Scene scene, IConfig startupConfig, string p) { + enabledYN = startupConfig.GetBoolean("EventQueue", true); } - private void ReadConfigAndPopulate(Scene scene, IConfig startupConfig, string p) + public void PostInitialise() { - enabledYN = startupConfig.GetBoolean("EventQueue", true); } public virtual void Close() @@ -134,6 +120,10 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue get { return "EventQueueGetModule"; } } + public bool IsSharedModule + { + get { return false; } + } #endregion /// diff --git a/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs b/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs index 0135d33..f15f8f6 100644 --- a/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs +++ b/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs @@ -25,12 +25,10 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -using System; using System.Collections; using System.Collections.Generic; using System.Reflection; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -41,8 +39,7 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Framework.Monitoring { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class MonitorModule : INonSharedRegionModule + public class MonitorModule : IRegionModule { private Scene m_scene; private readonly List m_monitors = new List(); @@ -65,19 +62,9 @@ namespace OpenSim.Region.CoreModules.Framework.Monitoring } } - #region Implementation of INonSharedRegionModule + #region Implementation of IRegionModule - public void Initialise(IConfigSource source) - { - - } - - public Type ReplaceableInterface - { - get { return null; } - } - - public void AddRegion(Scene scene) + public void Initialise(Scene scene, IConfigSource source) { m_scene = scene; @@ -90,51 +77,6 @@ namespace OpenSim.Region.CoreModules.Framework.Monitoring MainServer.Instance.AddHTTPHandler("/monitorstats/" + m_scene.RegionInfo.RegionID + "/", StatsPage); } - public void RegionLoaded(Scene scene) - { - m_monitors.Add(new AgentCountMonitor(m_scene)); - m_monitors.Add(new ChildAgentCountMonitor(m_scene)); - m_monitors.Add(new GCMemoryMonitor()); - m_monitors.Add(new ObjectCountMonitor(m_scene)); - m_monitors.Add(new PhysicsFrameMonitor(m_scene)); - m_monitors.Add(new PhysicsUpdateFrameMonitor(m_scene)); - m_monitors.Add(new PWSMemoryMonitor()); - m_monitors.Add(new ThreadCountMonitor()); - m_monitors.Add(new TotalFrameMonitor(m_scene)); - m_monitors.Add(new EventFrameMonitor(m_scene)); - m_monitors.Add(new LandFrameMonitor(m_scene)); - m_monitors.Add(new LastFrameTimeMonitor(m_scene)); - - m_alerts.Add(new DeadlockAlert(m_monitors.Find(x => x is LastFrameTimeMonitor) as LastFrameTimeMonitor)); - - foreach (IAlert alert in m_alerts) - { - alert.OnTriggerAlert += OnTriggerAlert; - } - } - - public void RemoveRegion(Scene scene) - { - MainServer.Instance.RemoveHTTPHandler("", "/monitorstats/" + m_scene.RegionInfo.RegionID + "/"); - m_monitors.Clear(); - - foreach (IAlert alert in m_alerts) - { - alert.OnTriggerAlert -= OnTriggerAlert; - } - m_alerts.Clear(); - } - - public void Close() - { - - } - - public string Name - { - get { return "Region Health Monitoring Module"; } - } - public Hashtable StatsPage(Hashtable request) { // If request was for a specific monitor @@ -190,10 +132,49 @@ namespace OpenSim.Region.CoreModules.Framework.Monitoring return ereply; } + public void PostInitialise() + { + m_monitors.Add(new AgentCountMonitor(m_scene)); + m_monitors.Add(new ChildAgentCountMonitor(m_scene)); + m_monitors.Add(new GCMemoryMonitor()); + m_monitors.Add(new ObjectCountMonitor(m_scene)); + m_monitors.Add(new PhysicsFrameMonitor(m_scene)); + m_monitors.Add(new PhysicsUpdateFrameMonitor(m_scene)); + m_monitors.Add(new PWSMemoryMonitor()); + m_monitors.Add(new ThreadCountMonitor()); + m_monitors.Add(new TotalFrameMonitor(m_scene)); + m_monitors.Add(new EventFrameMonitor(m_scene)); + m_monitors.Add(new LandFrameMonitor(m_scene)); + m_monitors.Add(new LastFrameTimeMonitor(m_scene)); + + m_alerts.Add(new DeadlockAlert(m_monitors.Find(x => x is LastFrameTimeMonitor) as LastFrameTimeMonitor)); + + foreach (IAlert alert in m_alerts) + { + alert.OnTriggerAlert += OnTriggerAlert; + } + } + void OnTriggerAlert(System.Type reporter, string reason, bool fatal) { m_log.Error("[Monitor] " + reporter.Name + " for " + m_scene.RegionInfo.RegionName + " reports " + reason + " (Fatal: " + fatal + ")"); } + + public void Close() + { + + } + + public string Name + { + get { return "Region Health Monitoring Module"; } + } + + public bool IsSharedModule + { + get { return false; } + } + #endregion } } diff --git a/OpenSim/Region/CoreModules/Hypergrid/HGStandaloneLoginModule.cs b/OpenSim/Region/CoreModules/Hypergrid/HGStandaloneLoginModule.cs index f9c594b..0b54746 100644 --- a/OpenSim/Region/CoreModules/Hypergrid/HGStandaloneLoginModule.cs +++ b/OpenSim/Region/CoreModules/Hypergrid/HGStandaloneLoginModule.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -32,7 +32,6 @@ using System.Net; using System.Reflection; using System.Text.RegularExpressions; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using Nwc.XmlRpc; @@ -47,8 +46,7 @@ using OpenSim.Region.Framework.Interfaces; namespace OpenSim.Region.CoreModules.Hypergrid { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class HGStandaloneLoginModule : ISharedRegionModule, ILoginServiceToRegionsConnector + public class HGStandaloneLoginModule : IRegionModule, ILoginServiceToRegionsConnector { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -58,58 +56,47 @@ namespace OpenSim.Region.CoreModules.Hypergrid protected bool m_enabled = false; // Module is only enabled if running in standalone mode protected HGLoginAuthService m_loginService; - private bool authenticate = true; - private string welcomeMessage = "Welcome to OpenSim"; - private IConfig startupConfig; - private IConfig standaloneConfig; - - #region ISharedRegionModule Members - - public void Initialise(IConfigSource source) - { - startupConfig = source.Configs["Startup"]; - standaloneConfig = source.Configs["StandAlone"]; - if (standaloneConfig != null) - { - authenticate = standaloneConfig.GetBoolean("accounts_authenticate", true); - welcomeMessage = standaloneConfig.GetString("welcome_message"); - } - m_enabled = !startupConfig.GetBoolean("gridmode", false); - } - - public Type ReplaceableInterface - { - get { return null; } - } - public void AddRegion(Scene scene) - { - } + #region IRegionModule Members - public void RegionLoaded(Scene scene) + public void Initialise(Scene scene, IConfigSource source) { if (m_firstScene == null) { m_firstScene = scene; + IConfig startupConfig = source.Configs["Startup"]; + if (startupConfig != null) + { + m_enabled = !startupConfig.GetBoolean("gridmode", false); + } + if (m_enabled) { m_log.Debug("[HGLogin]: HGlogin module enabled"); + bool authenticate = true; + string welcomeMessage = "Welcome to OpenSim"; + IConfig standaloneConfig = source.Configs["StandAlone"]; + if (standaloneConfig != null) + { + authenticate = standaloneConfig.GetBoolean("accounts_authenticate", true); + welcomeMessage = standaloneConfig.GetString("welcome_message"); + } //TODO: fix casting. LibraryRootFolder rootFolder = m_firstScene.CommsManager.UserProfileCacheService.LibraryRoot as LibraryRootFolder; - + IHttpServer httpServer = MainServer.Instance; //TODO: fix the casting of the user service, maybe by registering the userManagerBase with scenes, or refactoring so we just need a IUserService reference - m_loginService + m_loginService = new HGLoginAuthService( - (UserManagerBase)m_firstScene.CommsManager.UserAdminService, - welcomeMessage, - m_firstScene.CommsManager.InterServiceInventoryService, - m_firstScene.CommsManager.NetworkServersInfo, - authenticate, - rootFolder, + (UserManagerBase)m_firstScene.CommsManager.UserAdminService, + welcomeMessage, + m_firstScene.CommsManager.InterServiceInventoryService, + m_firstScene.CommsManager.NetworkServersInfo, + authenticate, + rootFolder, this); httpServer.AddXmlRPCHandler("hg_login", m_loginService.XmlRpcLoginMethod); @@ -126,19 +113,6 @@ namespace OpenSim.Region.CoreModules.Hypergrid } } - public void RemoveRegion(Scene scene) - { - if (scene == m_firstScene) - { - IHttpServer httpServer = MainServer.Instance; - httpServer.RemoveXmlRPCHandler("hg_login"); - httpServer.RemoveXmlRPCHandler("check_auth_session"); - httpServer.RemoveXmlRPCHandler("get_avatar_appearance"); - httpServer.RemoveXmlRPCHandler("update_avatar_appearance"); - } - m_scenes.Remove(scene); - } - public void PostInitialise() { @@ -154,6 +128,11 @@ namespace OpenSim.Region.CoreModules.Hypergrid get { return "HGStandaloneLoginModule"; } } + public bool IsSharedModule + { + get { return true; } + } + #endregion protected void AddScene(Scene scene) diff --git a/OpenSim/Region/CoreModules/InterGrid/OGSRadmin.cs b/OpenSim/Region/CoreModules/InterGrid/OGSRadmin.cs index 4534024..0f2ba32 100644 --- a/OpenSim/Region/CoreModules/InterGrid/OGSRadmin.cs +++ b/OpenSim/Region/CoreModules/InterGrid/OGSRadmin.cs @@ -32,7 +32,6 @@ using System.Net; using System.Reflection; using System.Text; using log4net; -using Mono.Addins; using Nini.Config; using Nwc.XmlRpc; using OpenMetaverse; @@ -43,8 +42,7 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.InterGrid { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class OGSRadmin : ISharedRegionModule + public class OGSRadmin : IRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private readonly List m_scenes = new List(); @@ -58,6 +56,7 @@ namespace OpenSim.Region.CoreModules.InterGrid get { return "OGS Supporting RAdmin"; } } + public void Initialise(IConfigSource source) { m_settings = source; @@ -68,11 +67,6 @@ namespace OpenSim.Region.CoreModules.InterGrid } - public Type ReplaceableInterface - { - get { return null; } - } - public void AddRegion(Scene scene) { lock (m_scenes) @@ -83,11 +77,15 @@ namespace OpenSim.Region.CoreModules.InterGrid { lock (m_scenes) m_scenes.Remove(scene); - MainServer.Instance.RemoveXmlRPCHandler("grid_message"); } public void RegionLoaded(Scene scene) { + + } + + public void PostInitialise() + { if (m_settings.Configs["Startup"].GetBoolean("gridmode", false)) { m_com = m_scenes[0].CommsManager; @@ -95,8 +93,21 @@ namespace OpenSim.Region.CoreModules.InterGrid } } - public void PostInitialise() + #endregion + + #region IRegionModule + + public void Initialise(Scene scene, IConfigSource source) + { + m_settings = source; + + lock (m_scenes) + m_scenes.Add(scene); + } + + public bool IsSharedModule { + get { return true; } } #endregion diff --git a/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs b/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs index 8bb0fa9..10a3232 100644 --- a/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs +++ b/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs @@ -35,7 +35,6 @@ using System.Security.Cryptography.X509Certificates; using System.Threading; using System.Web; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenMetaverse.StructuredData; @@ -76,9 +75,8 @@ namespace OpenSim.Region.CoreModules.InterGrid public bool visible_to_parent; public string teleported_into_region; } - - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class OpenGridProtocolModule : ISharedRegionModule + + public class OpenGridProtocolModule : IRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private List m_scene = new List(); @@ -94,22 +92,21 @@ namespace OpenSim.Region.CoreModules.InterGrid private bool httpSSL = false; private uint httpsslport = 0; private bool GridMode = false; - private bool m_enabled = false; - private IConfig cfg = null; - private IConfig httpcfg = null; - private IConfig startupcfg = null; - - #region ISharedRegionModule Members - public void Initialise(IConfigSource config) + #region IRegionModule Members + + public void Initialise(Scene scene, IConfigSource config) { + bool enabled = false; + IConfig cfg = null; + IConfig httpcfg = null; + IConfig startupcfg = null; try { cfg = config.Configs["OpenGridProtocol"]; - } - catch (NullReferenceException) + } catch (NullReferenceException) { - m_enabled = false; + enabled = false; } try @@ -131,15 +128,15 @@ namespace OpenSim.Region.CoreModules.InterGrid if (startupcfg != null) { - GridMode = m_enabled = startupcfg.GetBoolean("gridmode", false); + GridMode = enabled = startupcfg.GetBoolean("gridmode", false); } if (cfg != null) { - m_enabled = cfg.GetBoolean("ogp_enabled", false); + enabled = cfg.GetBoolean("ogp_enabled", false); LastNameSuffix = cfg.GetString("ogp_lastname_suffix", "_EXTERNAL"); FirstNamePrefix = cfg.GetString("ogp_firstname_prefix", ""); - if (m_enabled) + if (enabled) { m_log.Warn("[OGP]: Open Grid Protocol is on, Listening for Clients on /agent/"); lock (m_scene) @@ -168,61 +165,35 @@ namespace OpenSim.Region.CoreModules.InterGrid } } + // can't pick the region 'agent' because it would conflict with our agent domain handler + // a zero length region name would conflict with are base region seed cap + if (!SceneListDuplicateCheck(scene.RegionInfo.RegionName) && scene.RegionInfo.RegionName.ToLower() != "agent" && scene.RegionInfo.RegionName.Length > 0) + { + MainServer.Instance.AddLLSDHandler( + "/" + HttpUtility.UrlPathEncode(scene.RegionInfo.RegionName.ToLower()), + ProcessRegionDomainSeed); + } + + if (!m_scene.Contains(scene)) + m_scene.Add(scene); } } } - } - - public Type ReplaceableInterface - { - get { return null; } - } - - public void AddRegion(Scene scene) - { - if (m_enabled) + lock (m_scene) { - lock (m_scene) + if (m_scene.Count == 1) { - if (m_scene.Count == 1) + if (httpcfg != null) { - if (httpcfg != null) - { - httpSSL = httpcfg.GetBoolean("http_listener_ssl", false); - httpsCN = httpcfg.GetString("http_listener_cn", scene.RegionInfo.ExternalHostName); - if (httpsCN.Length == 0) - httpsCN = scene.RegionInfo.ExternalHostName; - httpsslport = (uint)httpcfg.GetInt("http_listener_sslport", ((int)scene.RegionInfo.HttpPort + 1)); - } + httpSSL = httpcfg.GetBoolean("http_listener_ssl", false); + httpsCN = httpcfg.GetString("http_listener_cn", scene.RegionInfo.ExternalHostName); + if (httpsCN.Length == 0) + httpsCN = scene.RegionInfo.ExternalHostName; + httpsslport = (uint)httpcfg.GetInt("http_listener_sslport",((int)scene.RegionInfo.HttpPort + 1)); } } - // can't pick the region 'agent' because it would conflict with our agent domain handler - // a zero length region name would conflict with are base region seed cap - if (!SceneListDuplicateCheck(scene.RegionInfo.RegionName) && scene.RegionInfo.RegionName.ToLower() != "agent" && scene.RegionInfo.RegionName.Length > 0) - { - MainServer.Instance.AddLLSDHandler( - "/" + HttpUtility.UrlPathEncode(scene.RegionInfo.RegionName.ToLower()), - ProcessRegionDomainSeed); - } - - if (!m_scene.Contains(scene)) - m_scene.Add(scene); } } - - public void RegionLoaded(Scene scene) - { - } - - public void RemoveRegion(Scene scene) - { - MainServer.Instance.RemoveLLSDHandler( - "/" + HttpUtility.UrlPathEncode(scene.RegionInfo.RegionName.ToLower()), - ProcessRegionDomainSeed); - - if (m_scene.Contains(scene)) - m_scene.Remove(scene); - } public void PostInitialise() { @@ -238,6 +209,11 @@ namespace OpenSim.Region.CoreModules.InterGrid get { return "OpenGridProtocolModule"; } } + public bool IsSharedModule + { + get { return true; } + } + #endregion public OSD ProcessRegionDomainSeed(string path, OSD request, string endpoint) diff --git a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs index 40b7159..679c871 100644 --- a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs @@ -29,7 +29,6 @@ using System; using System.Collections.Generic; using System.Drawing; using System.Drawing.Imaging; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenMetaverse.Imaging; @@ -41,8 +40,7 @@ using System.Reflection; namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class DynamicTextureModule : ISharedRegionModule, IDynamicTextureManager + public class DynamicTextureModule : IRegionModule, IDynamicTextureManager { //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -212,14 +210,9 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture #endregion - #region ISharedRegionModule Members + #region IRegionModule Members - public void Initialise(IConfigSource config) - { - - } - - public void AddRegion(Scene scene) + public void Initialise(Scene scene, IConfigSource config) { if (!RegisteredScenes.ContainsKey(scene.RegionInfo.RegionID)) { @@ -228,24 +221,6 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture } } - public Type ReplaceableInterface - { - get { return null; } - } - - public void RegionLoaded(Scene scene) - { - } - - public void RemoveRegion(Scene scene) - { - if (!RegisteredScenes.ContainsKey(scene.RegionInfo.RegionID)) - { - RegisteredScenes.Remove(scene.RegionInfo.RegionID); - scene.UnregisterModuleInterface(this); - } - } - public void PostInitialise() { } @@ -259,6 +234,11 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture get { return "DynamicTextureModule"; } } + public bool IsSharedModule + { + get { return true; } + } + #endregion #region Nested type: DynamicTextureUpdater @@ -378,18 +358,18 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture // tmptex.DefaultTexture.Fullbright = true; part.UpdateTexture(tmptex); - } - - if (oldID != UUID.Zero && ((Disp & DISP_EXPIRE) != 0)) - { - if (oldAsset == null) oldAsset = scene.AssetService.Get(oldID.ToString()); - if (oldAsset != null) - { - if (oldAsset.Temporary == true) - { - scene.AssetService.Delete(oldID.ToString()); - } - } + } + + if (oldID != UUID.Zero && ((Disp & DISP_EXPIRE) != 0)) + { + if (oldAsset == null) oldAsset = scene.AssetService.Get(oldID.ToString()); + if (oldAsset != null) + { + if (oldAsset.Temporary == true) + { + scene.AssetService.Delete(oldID.ToString()); + } + } } } diff --git a/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs b/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs index d6ed468..83f004d 100644 --- a/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs @@ -32,7 +32,6 @@ using System.Text.RegularExpressions; using DotNetOpenMail; using DotNetOpenMail.SmtpAuth; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -41,7 +40,6 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Scripting.EmailModules { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] public class EmailModule : IEmailModule { // @@ -96,7 +94,7 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules } } - public void Initialise(IConfigSource config) + public void Initialise(Scene scene, IConfigSource config) { m_Config = config; IConfig SMTPConfig; @@ -138,16 +136,7 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules m_Enabled = false; return; } - m_log.Info("[EMAIL] Activated DefaultEmailModule"); - } - - public Type ReplaceableInterface - { - get { return null; } - } - public void AddRegion(Scene scene) - { // It's a go! if (m_Enabled) { @@ -166,20 +155,8 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules m_Scenes.Add(scene.RegionInfo.RegionHandle, scene); } } - } - } - - public void RegionLoaded(Scene scene) - { - } - public void RemoveRegion(Scene scene) - { - scene.UnregisterModuleInterface(this); - - if (m_Scenes.ContainsKey(scene.RegionInfo.RegionHandle)) - { - m_Scenes.Remove(scene.RegionInfo.RegionHandle); + m_log.Info("[EMAIL] Activated DefaultEmailModule"); } } @@ -196,6 +173,11 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules get { return "DefaultEmailModule"; } } + public bool IsSharedModule + { + get { return true; } + } + /// /// Delay function using thread in seconds /// diff --git a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs index e331b8d..d78931a 100644 --- a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs +++ b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs @@ -31,7 +31,6 @@ using System.IO; using System.Net; using System.Text; using System.Threading; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -85,8 +84,7 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Scripting.HttpRequest { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class HttpRequestModule : ISharedRegionModule, IHttpRequestModule + public class HttpRequestModule : IRegionModule, IHttpRequestModule { private object HttpListLock = new object(); private int httpTimeout = 30000; @@ -231,35 +229,18 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest #endregion - #region ISharedRegionModule Members + #region IRegionModule Members - public void Initialise(IConfigSource config) - { - m_proxyurl = config.Configs["Startup"].GetString("HttpProxy"); - m_proxyexcepts = config.Configs["Startup"].GetString("HttpProxyExceptions"); - - m_pendingRequests = new Dictionary(); - } - - public void AddRegion(Scene scene) + public void Initialise(Scene scene, IConfigSource config) { m_scene = scene; m_scene.RegisterModuleInterface(this); - } - - public Type ReplaceableInterface - { - get { return null; } - } - public void RegionLoaded(Scene scene) - { - } + m_proxyurl = config.Configs["Startup"].GetString("HttpProxy"); + m_proxyexcepts = config.Configs["Startup"].GetString("HttpProxyExceptions"); - public void RemoveRegion(Scene scene) - { - scene.UnregisterModuleInterface(this); + m_pendingRequests = new Dictionary(); } public void PostInitialise() @@ -275,6 +256,11 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest get { return m_name; } } + public bool IsSharedModule + { + get { return true; } + } + #endregion } diff --git a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs index 6ce55a9..9b565ed 100644 --- a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs @@ -126,8 +126,6 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp public void RemoveRegion(Scene scene) { - scene.UnregisterModuleInterface(this); - scene.EventManager.OnScriptReset -= OnScriptReset; } public void Close() diff --git a/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs b/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs index 35ce2cb..c23cea5 100644 --- a/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs @@ -29,7 +29,6 @@ using System; using System.Drawing; using System.IO; using System.Net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenMetaverse.Imaging; @@ -40,8 +39,7 @@ using System.Reflection; namespace OpenSim.Region.CoreModules.Scripting.LoadImageURL { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class LoadImageURLModule : ISharedRegionModule, IDynamicTextureRender + public class LoadImageURLModule : IRegionModule, IDynamicTextureRender { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -99,28 +97,20 @@ namespace OpenSim.Region.CoreModules.Scripting.LoadImageURL #endregion - #region ISharedRegionModule Members + #region IRegionModule Members - public void Initialise(IConfigSource config) - { - m_proxyurl = config.Configs["Startup"].GetString("HttpProxy"); - m_proxyexcepts = config.Configs["Startup"].GetString("HttpProxyExceptions"); - } - - public void AddRegion(Scene scene) + public void Initialise(Scene scene, IConfigSource config) { if (m_scene == null) { m_scene = scene; } + + m_proxyurl = config.Configs["Startup"].GetString("HttpProxy"); + m_proxyexcepts = config.Configs["Startup"].GetString("HttpProxyExceptions"); } - public Type ReplaceableInterface - { - get { return null; } - } - - public void RegionLoaded(Scene scene) + public void PostInitialise() { m_textureManager = m_scene.RequestModuleInterface(); if (m_textureManager != null) @@ -129,14 +119,6 @@ namespace OpenSim.Region.CoreModules.Scripting.LoadImageURL } } - public void RemoveRegion(Scene scene) - { - } - - public void PostInitialise() - { - } - public void Close() { } @@ -146,6 +128,11 @@ namespace OpenSim.Region.CoreModules.Scripting.LoadImageURL get { return m_name; } } + public bool IsSharedModule + { + get { return true; } + } + #endregion private void MakeHttpRequest(string url, UUID requestID) diff --git a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs index 71b01a1..d57a8e5 100644 --- a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs @@ -31,7 +31,6 @@ using System.Drawing.Imaging; using System.Globalization; using System.IO; using System.Net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenMetaverse.Imaging; @@ -44,8 +43,7 @@ using System.Reflection; namespace OpenSim.Region.CoreModules.Scripting.VectorRender { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class VectorRenderModule : ISharedRegionModule, IDynamicTextureRender + public class VectorRenderModule : IRegionModule, IDynamicTextureRender { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -112,10 +110,15 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender #endregion - #region ISharedRegionModule Members + #region IRegionModule Members - public void Initialise(IConfigSource config) + public void Initialise(Scene scene, IConfigSource config) { + if (m_scene == null) + { + m_scene = scene; + } + if (m_graph == null) { Bitmap bitmap = new Bitmap(1024, 1024, PixelFormat.Format32bppArgb); @@ -130,20 +133,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender m_log.DebugFormat("[VECTORRENDERMODULE]: using font \"{0}\" for text rendering.", m_fontName); } - public void AddRegion(Scene scene) - { - if (m_scene == null) - { - m_scene = scene; - } - } - - public Type ReplaceableInterface - { - get { return null; } - } - - public void RegionLoaded(Scene scene) + public void PostInitialise() { m_textureManager = m_scene.RequestModuleInterface(); if (m_textureManager != null) @@ -152,14 +142,6 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender } } - public void RemoveRegion(Scene scene) - { - } - - public void PostInitialise() - { - } - public void Close() { } @@ -169,6 +151,11 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender get { return m_name; } } + public bool IsSharedModule + { + get { return true; } + } + #endregion private void Draw(string data, UUID id, string extraParams) diff --git a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs index d935c56..93aa88c 100644 --- a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs @@ -28,7 +28,6 @@ using System; using System.Collections; using System.Collections.Generic; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -86,8 +85,7 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Scripting.WorldComm { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class WorldCommModule : ISharedRegionModule, IWorldComm + public class WorldCommModule : IRegionModule, IWorldComm { // private static readonly ILog m_log = // LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -100,9 +98,9 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm private int m_saydistance = 30; private int m_shoutdistance = 100; - #region ISharedRegionModule Members + #region IRegionModule Members - public void Initialise(IConfigSource config) + public void Initialise(Scene scene, IConfigSource config) { // wrap this in a try block so that defaults will work if // the config file doesn't specify otherwise. @@ -122,6 +120,7 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm if (maxlisteners < 1) maxlisteners = int.MaxValue; if (maxhandles < 1) maxhandles = int.MaxValue; +<<<<<<< HEAD:OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs m_listenerManager = new ListenerManager(maxlisteners, maxhandles); m_pendingQ = new Queue(); m_pending = Queue.Synchronized(m_pendingQ); @@ -133,26 +132,19 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm public void AddRegion(Scene scene) { +======= +>>>>>>> ec3c31e... Updates all IRegionModules to the new style region modules.:OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs m_scene = scene; m_scene.RegisterModuleInterface(this); + m_listenerManager = new ListenerManager(maxlisteners, maxhandles); m_scene.EventManager.OnChatFromClient += DeliverClientMessage; m_scene.EventManager.OnChatBroadcast += DeliverClientMessage; + m_pendingQ = new Queue(); + m_pending = Queue.Synchronized(m_pendingQ); } - public Type ReplaceableInterface - { - get { return null; } - } - - public void RegionLoaded(Scene scene) - { - } - - public void RemoveRegion(Scene scene) + public void PostInitialise() { - scene.UnregisterModuleInterface(this); - scene.EventManager.OnChatFromClient -= DeliverClientMessage; - scene.EventManager.OnChatBroadcast -= DeliverClientMessage; } public void Close() @@ -164,6 +156,11 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm get { return "WorldCommModule"; } } + public bool IsSharedModule + { + get { return false; } + } + #endregion #region IWorldComm Members diff --git a/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs b/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs index a9147fb6..27b64bf 100644 --- a/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs @@ -32,7 +32,6 @@ using System.Net; using System.Reflection; using System.Threading; using log4net; -using Mono.Addins; using Nini.Config; using Nwc.XmlRpc; using OpenMetaverse; @@ -77,8 +76,7 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Scripting.XMLRPC { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class XMLRPCModule : ISharedRegionModule, IXMLRPC + public class XMLRPCModule : IRegionModule, IXMLRPC { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -96,9 +94,9 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC private int RemoteReplyScriptWait = 300; private object XMLRPCListLock = new object(); - #region ISharedRegionModule Members + #region IRegionModule Members - public void Initialise(IConfigSource config) + public void Initialise(Scene scene, 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 @@ -118,14 +116,7 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC { } } - } - - public void PostInitialise() - { - } - public void AddRegion(Scene scene) - { if (!m_scenes.Contains(scene)) { m_scenes.Add(scene); @@ -134,12 +125,7 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC } } - public Type ReplaceableInterface - { - get { return null; } - } - private Dictionary m_HttpServers = new Dictionary(); - public void RegionLoaded(Scene scene) + public void PostInitialise() { if (IsEnabled()) { @@ -147,31 +133,9 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC // Attach xmlrpc handlers m_log.Info("[REMOTE_DATA]: " + "Starting XMLRPC Server on port " + m_remoteDataPort + " for llRemoteData commands."); - BaseHttpServer httpServer = new BaseHttpServer((uint)m_remoteDataPort); + BaseHttpServer httpServer = new BaseHttpServer((uint) m_remoteDataPort); httpServer.AddXmlRPCHandler("llRemoteData", XmlRpcRemoteData); httpServer.Start(); - m_HttpServers.Add(scene, httpServer); - } - } - - public void RemoveRegion(Scene scene) - { - if (m_scenes.Contains(scene)) - m_scenes.Remove(scene); - scene.UnregisterModuleInterface(this); - if (IsEnabled()) - { - // Start http server - // Attach xmlrpc handlers - if (m_HttpServers.ContainsKey(scene)) - { - BaseHttpServer httpServer; - m_HttpServers.TryGetValue(scene, out httpServer); - m_log.Info("[REMOTE_DATA]: " + - "Stopping XMLRPC Server on port " + m_remoteDataPort + " for llRemoteData commands."); - httpServer.RemoveXmlRPCHandler("llRemoteData"); - httpServer.Stop(); - } } } @@ -184,6 +148,11 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC get { return m_name; } } + public bool IsSharedModule + { + get { return true; } + } + public int Port { get { return m_remoteDataPort; } diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Asset/AssetServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Asset/AssetServiceInConnectorModule.cs index d3e2db7..879cc70 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Asset/AssetServiceInConnectorModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Asset/AssetServiceInConnectorModule.cs @@ -47,7 +47,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Asset private IConfigSource m_Config; bool m_Registered = false; - #region ISharedRegionModule interface + #region IRegionModule interface public void Initialise(IConfigSource config) { diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Grid/HypergridServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Grid/HypergridServiceInConnectorModule.cs index a895a3f..b12d778 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Grid/HypergridServiceInConnectorModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Grid/HypergridServiceInConnectorModule.cs @@ -51,7 +51,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Grid bool m_Registered = false; HypergridServiceInConnector m_HypergridHandler; - #region ISharedRegionModule interface + #region IRegionModule interface public void Initialise(IConfigSource config) { diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Inventory/InventoryServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Inventory/InventoryServiceInConnectorModule.cs index 4c74725..54c6d89 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Inventory/InventoryServiceInConnectorModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Inventory/InventoryServiceInConnectorModule.cs @@ -47,7 +47,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Inventory private IConfigSource m_Config; bool m_Registered = false; - #region ISharedRegionModule interface + #region IRegionModule interface public void Initialise(IConfigSource config) { diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs index dcc6dec..bce160a 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs @@ -50,7 +50,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Land private IConfigSource m_Config; private List m_Scenes = new List(); - #region ISharedRegionModule interface + #region IRegionModule interface public void Initialise(IConfigSource config) { diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Neighbour/NeighbourServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Neighbour/NeighbourServiceInConnectorModule.cs index a5c5ef6..8a90370 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Neighbour/NeighbourServiceInConnectorModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Neighbour/NeighbourServiceInConnectorModule.cs @@ -50,7 +50,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Neighbour private IConfigSource m_Config; private List m_Scenes = new List(); - #region ISharedRegionModule interface + #region IRegionModule interface public void Initialise(IConfigSource config) { diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Simulation/SimulationServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Simulation/SimulationServiceInConnectorModule.cs index c2cea16..f28a318 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Simulation/SimulationServiceInConnectorModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Simulation/SimulationServiceInConnectorModule.cs @@ -49,7 +49,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Simulation private IConfigSource m_Config; bool m_Registered = false; - #region ISharedRegionModule interface + #region IRegionModule interface public void Initialise(IConfigSource config) { diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/LocalInterregionComms.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/LocalInterregionComms.cs index 71d7993..d68c683 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/LocalInterregionComms.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/LocalInterregionComms.cs @@ -48,7 +48,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion #endregion /* Events */ - #region ISharedRegionModule + #region IRegionModule public void Initialise(IConfigSource config) { @@ -136,7 +136,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion } } - #endregion + #endregion /* IRegionModule */ #region IInterregionComms diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs index 24d35e1..44458d1 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs @@ -66,7 +66,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion protected bool m_safemode; protected IPAddress m_thisIP; - #region ISharedRegionModule + #region IRegionModule public virtual void Initialise(IConfigSource config) { @@ -149,7 +149,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion MainServer.Instance.AddHTTPHandler("/object/", ObjectHandler); } - #endregion + #endregion /* IRegionModule */ #region IInterregionComms @@ -436,12 +436,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion } OSDMap resp = new OSDMap(2); - string reason = String.Empty; - uint teleportFlags = 0; - if (args.ContainsKey("teleport_flags")) - { - teleportFlags = args["teleport_flags"].AsUInteger(); - } + string reason = String.Empty; + uint teleportFlags = 0; + if (args.ContainsKey("teleport_flags")) + { + teleportFlags = args["teleport_flags"].AsUInteger(); + } // This is the meaning of POST agent m_regionClient.AdjustUserInformation(aCircuit); diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs index c738b65..fc8d4e1 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs @@ -81,7 +81,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver public void RemoveRegion(Scene scene) { - scene.UnregisterModuleInterface(this); } public void Close() diff --git a/OpenSim/Region/CoreModules/World/Cloud/CloudModule.cs b/OpenSim/Region/CoreModules/World/Cloud/CloudModule.cs index a2cfce6..5fa3dc2 100644 --- a/OpenSim/Region/CoreModules/World/Cloud/CloudModule.cs +++ b/OpenSim/Region/CoreModules/World/Cloud/CloudModule.cs @@ -27,7 +27,6 @@ using System; using System.Collections.Generic; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -36,7 +35,6 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] public class CloudModule : ICloudModule { // private static readonly log4net.ILog m_log @@ -50,7 +48,7 @@ namespace OpenSim.Region.CoreModules private float m_cloudDensity = 1.0F; private float[] cloudCover = new float[16 * 16]; - public void Initialise(IConfigSource config) + public void Initialise(Scene scene, IConfigSource config) { IConfig cloudConfig = config.Configs["Cloud"]; @@ -60,17 +58,10 @@ namespace OpenSim.Region.CoreModules m_cloudDensity = cloudConfig.GetFloat("density", 0.5F); m_frameUpdateRate = cloudConfig.GetInt("cloud_update_rate", 1000); } - } - - public Type ReplaceableInterface - { - get { return null; } - } - public void AddRegion(Scene scene) - { if (m_enabled) { + m_scene = scene; scene.EventManager.OnNewClient += CloudsToClient; @@ -80,18 +71,9 @@ namespace OpenSim.Region.CoreModules GenerateCloudCover(); m_ready = true; - } - } - public void RegionLoaded(Scene scene) - { - } + } - public void RemoveRegion(Scene scene) - { - scene.EventManager.OnNewClient -= CloudsToClient; - scene.UnregisterModuleInterface(this); - scene.EventManager.OnFrame -= CloudUpdate; } public void PostInitialise() @@ -114,6 +96,12 @@ namespace OpenSim.Region.CoreModules get { return "CloudModule"; } } + public bool IsSharedModule + { + get { return false; } + } + + public float CloudCover(int x, int y, int z) { float cover = 0f; diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index 39836ae..695cced 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs @@ -30,7 +30,6 @@ using System.IO; using System.Reflection; using System.Security; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -39,7 +38,6 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.World.Estate { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] public class EstateManagementModule : IEstateModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -900,16 +898,7 @@ namespace OpenSim.Region.CoreModules.World.Estate #region IRegionModule Members - public void Initialise(IConfigSource source) - { - } - - public Type ReplaceableInterface - { - get { return null; } - } - - public void AddRegion(Scene scene) + public void Initialise(Scene scene, IConfigSource source) { m_scene = scene; m_scene.RegisterModuleInterface(this); @@ -931,29 +920,6 @@ namespace OpenSim.Region.CoreModules.World.Estate consoleSetTerrainHeights); } - public void RegionLoaded(Scene scene) - { - // Sets up the sun module based on the saved Estate and Region Settings - // DO NOT REMOVE or the sun will stop working - TriggerEstateToolsSunUpdate(); - } - - public void RemoveRegion(Scene scene) - { - scene.UnregisterModuleInterface(this); - scene.EventManager.OnNewClient -= EventManager_OnNewClient; - scene.EventManager.OnRequestChangeWaterHeight -= changeWaterHeight; - } - - public void Close() - { - } - - public string Name - { - get { return "EstateManagementModule"; } - } - #region Console Commands public void consoleSetTerrainTexture(string module, string[] args) @@ -1040,6 +1006,28 @@ namespace OpenSim.Region.CoreModules.World.Estate } #endregion + + public void PostInitialise() + { + // Sets up the sun module based no the saved Estate and Region Settings + // DO NOT REMOVE or the sun will stop working + TriggerEstateToolsSunUpdate(); + } + + public void Close() + { + } + + public string Name + { + get { return "EstateManagementModule"; } + } + + public bool IsSharedModule + { + get { return false; } + } + #endregion #region Other Functions diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index 5b15065..1533462 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs @@ -29,7 +29,6 @@ using System; using System.Collections.Generic; using System.Reflection; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -90,8 +89,7 @@ enum GroupPowers : long namespace OpenSim.Region.CoreModules.World.Permissions { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class PermissionsModule : INonSharedRegionModule + public class PermissionsModule : IRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -151,10 +149,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions #endregion - #region INonSharedRegionModule Members + #region IRegionModule Members - public void Initialise(IConfigSource config) + public void Initialise(Scene scene, IConfigSource config) { + m_scene = scene; + IConfig myConfig = config.Configs["Startup"]; string permissionModules = myConfig.GetString("permissionmodules", "DefaultPermissionsModule"); @@ -179,57 +179,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions if (m_bypassPermissions) m_log.Info("[PERMISSIONS]: serviceside_object_permissions = false in ini file so disabling all region service permission checks"); else - m_log.Debug("[PERMISSIONS]: Enabling all region service permission checks"); - - 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(',')) { - string uuid = uuidl.Trim(" \t".ToCharArray()); - GrantCS.Add(uuid, true); - } - } - - grant = myConfig.GetString("GrantVB",""); - if (grant.Length > 0) { - foreach (string uuidl in grant.Split(',')) { - string uuid = uuidl.Trim(" \t".ToCharArray()); - GrantVB.Add(uuid, true); - } - } - - grant = myConfig.GetString("GrantJS", ""); - if (grant.Length > 0) - { - foreach (string uuidl in grant.Split(',')) - { - string uuid = uuidl.Trim(" \t".ToCharArray()); - GrantJS.Add(uuid, true); - } - } - - grant = myConfig.GetString("GrantYP", ""); - if (grant.Length > 0) - { - foreach (string uuidl in grant.Split(',')) - { - string uuid = uuidl.Trim(" \t".ToCharArray()); - GrantYP.Add(uuid, true); - } - } - - } - - public void AddRegion(Scene scene) - { - m_scene = scene; + m_log.Debug("[PERMISSIONS]: Enabling all region service permission checks"); //Register functions with Scene External Checks! m_scene.Permissions.OnBypassPermissions += BypassPermissions; @@ -262,23 +212,23 @@ namespace OpenSim.Region.CoreModules.World.Permissions 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; //NOT IMPLEMENTED HERE 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.OnUseObjectReturn += CanUseObjectReturn; //NOT YET IMPLEMENTED @@ -296,87 +246,52 @@ namespace OpenSim.Region.CoreModules.World.Permissions "debug permissions ", "Enable permissions debugging", HandleDebugPermissions); - } - - public Type ReplaceableInterface - { - get { return null; } - } - - public void RegionLoaded(Scene scene) - { - m_friendsModule = m_scene.RequestModuleInterface(); + + + 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); + } + } - if (m_friendsModule == null) - m_log.Error("[PERMISSIONS]: Friends module not found, friend permissions will not work"); - else - m_log.Info("[PERMISSIONS]: Friends module found, friend permissions enabled"); - } + grant = myConfig.GetString("GrantCS",""); + if (grant.Length > 0) { + foreach (string uuidl in grant.Split(',')) { + string uuid = uuidl.Trim(" \t".ToCharArray()); + GrantCS.Add(uuid, true); + } + } - public void RemoveRegion(Scene scene) - { - scene.Permissions.OnBypassPermissions -= BypassPermissions; - scene.Permissions.OnSetBypassPermissions -= SetBypassPermissions; - scene.Permissions.OnPropagatePermissions -= PropagatePermissions; - scene.Permissions.OnGenerateClientFlags -= GenerateClientFlags; - scene.Permissions.OnAbandonParcel -= CanAbandonParcel; - scene.Permissions.OnReclaimParcel -= CanReclaimParcel; - scene.Permissions.OnDeedParcel -= CanDeedParcel; - scene.Permissions.OnDeedObject -= CanDeedObject; - scene.Permissions.OnIsGod -= IsGod; - scene.Permissions.OnDuplicateObject -= CanDuplicateObject; - scene.Permissions.OnDeleteObject -= CanDeleteObject; //MAYBE FULLY IMPLEMENTED - scene.Permissions.OnEditObject -= CanEditObject; //MAYBE FULLY IMPLEMENTED - scene.Permissions.OnEditParcel -= CanEditParcel; //MAYBE FULLY IMPLEMENTED - scene.Permissions.OnInstantMessage -= CanInstantMessage; - scene.Permissions.OnInventoryTransfer -= CanInventoryTransfer; //NOT YET IMPLEMENTED - scene.Permissions.OnIssueEstateCommand -= CanIssueEstateCommand; //FULLY IMPLEMENTED - scene.Permissions.OnMoveObject -= CanMoveObject; //MAYBE FULLY IMPLEMENTED - scene.Permissions.OnObjectEntry -= CanObjectEntry; - scene.Permissions.OnReturnObject -= CanReturnObject; //NOT YET IMPLEMENTED - scene.Permissions.OnRezObject -= CanRezObject; //MAYBE FULLY IMPLEMENTED - scene.Permissions.OnRunConsoleCommand -= CanRunConsoleCommand; - scene.Permissions.OnRunScript -= CanRunScript; //NOT YET IMPLEMENTED - scene.Permissions.OnCompileScript -= CanCompileScript; - scene.Permissions.OnSellParcel -= CanSellParcel; - scene.Permissions.OnTakeObject -= CanTakeObject; - scene.Permissions.OnTakeCopyObject -= CanTakeCopyObject; - scene.Permissions.OnTerraformLand -= CanTerraformLand; - scene.Permissions.OnLinkObject -= CanLinkObject; //NOT YET IMPLEMENTED - scene.Permissions.OnDelinkObject -= CanDelinkObject; //NOT YET IMPLEMENTED - scene.Permissions.OnBuyLand -= CanBuyLand; //NOT YET IMPLEMENTED - - scene.Permissions.OnViewNotecard -= CanViewNotecard; //NOT YET IMPLEMENTED - scene.Permissions.OnViewScript -= CanViewScript; //NOT YET IMPLEMENTED - scene.Permissions.OnEditNotecard -= CanEditNotecard; //NOT YET IMPLEMENTED - scene.Permissions.OnEditScript -= CanEditScript; //NOT YET IMPLEMENTED - - scene.Permissions.OnCreateObjectInventory -= CanCreateObjectInventory; //NOT IMPLEMENTED HERE - scene.Permissions.OnEditObjectInventory -= CanEditObjectInventory;//MAYBE FULLY IMPLEMENTED - scene.Permissions.OnCopyObjectInventory -= CanCopyObjectInventory; //NOT YET IMPLEMENTED - scene.Permissions.OnDeleteObjectInventory -= CanDeleteObjectInventory; //NOT YET IMPLEMENTED - scene.Permissions.OnResetScript -= CanResetScript; - - scene.Permissions.OnCreateUserInventory -= CanCreateUserInventory; //NOT YET IMPLEMENTED - scene.Permissions.OnCopyUserInventory -= CanCopyUserInventory; //NOT YET IMPLEMENTED - scene.Permissions.OnEditUserInventory -= CanEditUserInventory; //NOT YET IMPLEMENTED - scene.Permissions.OnDeleteUserInventory -= CanDeleteUserInventory; //NOT YET IMPLEMENTED - - scene.Permissions.OnTeleport -= CanTeleport; //NOT YET IMPLEMENTED - scene.Permissions.OnUseObjectReturn -= CanUseObjectReturn; //NOT YET IMPLEMENTED - } + grant = myConfig.GetString("GrantVB",""); + if (grant.Length > 0) { + foreach (string uuidl in grant.Split(',')) { + string uuid = uuidl.Trim(" \t".ToCharArray()); + GrantVB.Add(uuid, true); + } + } - public void PostInitialise() - { - } + grant = myConfig.GetString("GrantJS", ""); + if (grant.Length > 0) + { + foreach (string uuidl in grant.Split(',')) + { + string uuid = uuidl.Trim(" \t".ToCharArray()); + GrantJS.Add(uuid, true); + } + } - public void Close() - { - } + grant = myConfig.GetString("GrantYP", ""); + if (grant.Length > 0) + { + foreach (string uuidl in grant.Split(',')) + { + string uuid = uuidl.Trim(" \t".ToCharArray()); + GrantYP.Add(uuid, true); + } + } - public string Name - { - get { return "PermissionsModule"; } } public void HandleBypassPermissions(string module, string[] args) @@ -449,6 +364,31 @@ namespace OpenSim.Region.CoreModules.World.Permissions m_log.InfoFormat("[PERMISSIONS] Set permissions debugging to {0} in {1}", m_debugPermissions, m_scene.RegionInfo.RegionName); } } + + public void PostInitialise() + { + m_friendsModule = m_scene.RequestModuleInterface(); + + if (m_friendsModule == null) + m_log.Error("[PERMISSIONS]: Friends module not found, friend permissions will not work"); + else + m_log.Info("[PERMISSIONS]: Friends module found, friend permissions enabled"); + } + + public void Close() + { + } + + public string Name + { + get { return "PermissionsModule"; } + } + + public bool IsSharedModule + { + get { return false; } + } + #endregion #region Helper Functions diff --git a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs index ed7bfe1..37f1f2e 100644 --- a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs +++ b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs @@ -26,7 +26,6 @@ */ using System; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -35,44 +34,26 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.World.Sound { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class SoundModule : INonSharedRegionModule, ISoundModule + public class SoundModule : IRegionModule, ISoundModule { //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); protected Scene m_scene; - public void Initialise(IConfigSource source) - { - } - - public void AddRegion(Scene scene) + public void Initialise(Scene scene, IConfigSource source) { m_scene = scene; - + m_scene.EventManager.OnNewClient += OnNewClient; - + m_scene.RegisterModuleInterface(this); } - - public Type ReplaceableInterface - { - get { return null; } - } - - public void RegionLoaded(Scene scene) - { - } - - public void RemoveRegion(Scene scene) - { - scene.EventManager.OnNewClient -= OnNewClient; - scene.UnregisterModuleInterface(this); - } + public void PostInitialise() {} public void Close() {} public string Name { get { return "Sound Module"; } } - + public bool IsSharedModule { get { return false; } } + private void OnNewClient(IClientAPI client) { client.OnSoundTrigger += TriggerSound; diff --git a/OpenSim/Region/CoreModules/World/Sun/SunModule.cs b/OpenSim/Region/CoreModules/World/Sun/SunModule.cs index 948c47c..0712a7f 100644 --- a/OpenSim/Region/CoreModules/World/Sun/SunModule.cs +++ b/OpenSim/Region/CoreModules/World/Sun/SunModule.cs @@ -29,7 +29,6 @@ using System; using System.Collections.Generic; using System.Reflection; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -38,7 +37,6 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] public class SunModule : ISunModule { /// @@ -280,12 +278,27 @@ namespace OpenSim.Region.CoreModules return GetCurrentSunHour() + 6.0f; } - #region INonSharedRegionModule Methods + #region IRegion Methods // Called immediately after the module is loaded for a given region // i.e. Immediately after instance creation. - public void Initialise(IConfigSource config) + public void Initialise(Scene scene, IConfigSource config) { + m_scene = scene; + m_frame = 0; + + // This one puts an entry in the main help screen + m_scene.AddCommand(this, String.Empty, "sun", "Usage: sun [param] [value] - Get or Update Sun module paramater", null); + + // This one enables the ability to type just "sun" without any parameters + m_scene.AddCommand(this, "sun", "", "", HandleSunConsoleCommand); + foreach (KeyValuePair kvp in GetParamList()) + { + m_scene.AddCommand(this, String.Format("sun {0}", kvp.Key), String.Format("{0} - {1}", kvp.Key, kvp.Value), "", HandleSunConsoleCommand); + } + + + TimeZone local = TimeZone.CurrentTimeZone; TicksUTCOffset = local.GetUtcOffset(local.ToLocalTime(DateTime.Now)).Ticks; m_log.Debug("[SUN]: localtime offset is " + TicksUTCOffset); @@ -333,43 +346,7 @@ namespace OpenSim.Region.CoreModules // m_latitude = d_latitude; // m_longitude = d_longitude; } - } - - public void Close() - { - ready = false; - - // Remove our hooks - m_scene.EventManager.OnFrame -= SunUpdate; - m_scene.EventManager.OnAvatarEnteringNewParcel -= AvatarEnteringParcel; - m_scene.EventManager.OnEstateToolsSunUpdate -= EstateToolsSunUpdate; - m_scene.EventManager.OnGetCurrentTimeAsLindenSunHour -= GetCurrentTimeAsLindenSunHour; - } - - public string Name - { - get { return "SunModule"; } - } - - public Type ReplaceableInterface - { - get { return null; } - } - - public void AddRegion(Scene scene) - { - m_scene = scene; - m_frame = 0; - - // This one puts an entry in the main help screen - m_scene.AddCommand(this, String.Empty, "sun", "Usage: sun [param] [value] - Get or Update Sun module paramater", null); - // This one enables the ability to type just "sun" without any parameters - m_scene.AddCommand(this, "sun", "", "", HandleSunConsoleCommand); - foreach (KeyValuePair kvp in GetParamList()) - { - m_scene.AddCommand(this, String.Format("sun {0}", kvp.Key), String.Format("{0} - {1}", kvp.Key, kvp.Value), "", HandleSunConsoleCommand); - } switch (m_RegionMode) { case "T1": @@ -377,8 +354,8 @@ namespace OpenSim.Region.CoreModules case "SL": // Time taken to complete a cycle (day and season) - SecondsPerSunCycle = (uint)(m_DayLengthHours * 60 * 60); - SecondsPerYear = (uint)(SecondsPerSunCycle * m_YearLengthDays); + SecondsPerSunCycle = (uint) (m_DayLengthHours * 60 * 60); + SecondsPerYear = (uint) (SecondsPerSunCycle*m_YearLengthDays); // Ration of real-to-virtual time @@ -387,17 +364,17 @@ namespace OpenSim.Region.CoreModules // Speed of rotation needed to complete a cycle in the // designated period (day and season) - SunSpeed = m_SunCycle / SecondsPerSunCycle; - SeasonSpeed = m_SeasonalCycle / SecondsPerYear; + SunSpeed = m_SunCycle/SecondsPerSunCycle; + SeasonSpeed = m_SeasonalCycle/SecondsPerYear; // Horizon translation - HorizonShift = m_HorizonShift; // Z axis translation + HorizonShift = m_HorizonShift; // Z axis translation // HoursToRadians = (SunCycle/24)*VWTimeRatio; // Insert our event handling hooks - scene.EventManager.OnFrame += SunUpdate; + scene.EventManager.OnFrame += SunUpdate; scene.EventManager.OnAvatarEnteringNewParcel += AvatarEnteringParcel; scene.EventManager.OnEstateToolsSunUpdate += EstateToolsSunUpdate; scene.EventManager.OnGetCurrentTimeAsLindenSunHour += GetCurrentTimeAsLindenSunHour; @@ -414,21 +391,34 @@ namespace OpenSim.Region.CoreModules } scene.RegisterModuleInterface(this); + } - public void RegionLoaded(Scene scene) + + public void PostInitialise() { } - public void RemoveRegion(Scene scene) + public void Close() { - scene.RegisterModuleInterface(this); - scene.EventManager.OnFrame -= SunUpdate; - scene.EventManager.OnAvatarEnteringNewParcel -= AvatarEnteringParcel; - scene.EventManager.OnEstateToolsSunUpdate -= EstateToolsSunUpdate; - scene.EventManager.OnGetCurrentTimeAsLindenSunHour -= GetCurrentTimeAsLindenSunHour; + ready = false; + + // Remove our hooks + m_scene.EventManager.OnFrame -= SunUpdate; + m_scene.EventManager.OnAvatarEnteringNewParcel -= AvatarEnteringParcel; + m_scene.EventManager.OnEstateToolsSunUpdate -= EstateToolsSunUpdate; + m_scene.EventManager.OnGetCurrentTimeAsLindenSunHour -= GetCurrentTimeAsLindenSunHour; + } + + public string Name + { + get { return "SunModule"; } } + public bool IsSharedModule + { + get { return false; } + } #endregion #region EventManager Events diff --git a/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs b/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs index 0b487ed..c2ad7b8 100644 --- a/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs +++ b/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs @@ -28,7 +28,6 @@ using System; using System.Reflection; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -37,8 +36,7 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Avatar.Vegetation { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class VegetationModule : INonSharedRegionModule, IVegetationModule + public class VegetationModule : IRegionModule, IVegetationModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -47,34 +45,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Vegetation protected static readonly PCode[] creationCapabilities = new PCode[] { PCode.Grass, PCode.NewTree, PCode.Tree }; public PCode[] CreationCapabilities { get { return creationCapabilities; } } - public void Initialise(IConfigSource source) - { - } - - public void AddRegion(Scene scene) + public void Initialise(Scene scene, IConfigSource source) { m_scene = scene; m_scene.RegisterModuleInterface(this); } - - public Type ReplaceableInterface - { - get { return null; } - } - - public void RegionLoaded(Scene scene) - { - } - - public void RemoveRegion(Scene scene) - { - scene.UnregisterModuleInterface(this); - } public void PostInitialise() {} public void Close() {} public string Name { get { return "Vegetation Module"; } } - + public bool IsSharedModule { get { return false; } } + public SceneObjectGroup AddTree( UUID uuid, UUID groupID, Vector3 scale, Quaternion rotation, Vector3 position, Tree treeType, bool newTree) { diff --git a/OpenSim/Region/CoreModules/World/Wind/WindModule.cs b/OpenSim/Region/CoreModules/World/Wind/WindModule.cs index cd3706d..3283c1f 100644 --- a/OpenSim/Region/CoreModules/World/Wind/WindModule.cs +++ b/OpenSim/Region/CoreModules/World/Wind/WindModule.cs @@ -55,19 +55,17 @@ namespace OpenSim.Region.CoreModules private IWindModelPlugin m_activeWindPlugin = null; private const string m_dWindPluginName = "SimpleRandomWind"; - private string m_desiredWindPlugin = "SimpleRandomWind"; private Dictionary m_availableWindPlugins = new Dictionary(); // Simplified windSpeeds based on the fact that the client protocal tracks at a resolution of 16m private Vector2[] windSpeeds = new Vector2[16 * 16]; - private IConfig windConfig; #region IRegion Methods - public void Initialise(IConfigSource config) + public void Initialise(Scene scene, IConfigSource config) { - windConfig = config.Configs["Wind"]; - m_desiredWindPlugin = m_dWindPluginName; + IConfig windConfig = config.Configs["Wind"]; + string desiredWindPlugin = m_dWindPluginName; if (windConfig != null) { @@ -78,18 +76,10 @@ namespace OpenSim.Region.CoreModules // Determine which wind model plugin is desired if (windConfig.Contains("wind_plugin")) { - m_desiredWindPlugin = windConfig.GetString("wind_plugin"); + desiredWindPlugin = windConfig.GetString("wind_plugin"); } } - } - - public Type ReplaceableInterface - { - get { return null; } - } - public void AddRegion(Scene scene) - { if (m_enabled) { m_log.InfoFormat("[WIND] Enabled with an update rate of {0} frames.", m_frameUpdateRate); @@ -105,30 +95,30 @@ namespace OpenSim.Region.CoreModules } // Check for desired plugin - if (m_availableWindPlugins.ContainsKey(m_desiredWindPlugin)) + if (m_availableWindPlugins.ContainsKey(desiredWindPlugin)) { - m_activeWindPlugin = m_availableWindPlugins[m_desiredWindPlugin]; + m_activeWindPlugin = m_availableWindPlugins[desiredWindPlugin]; - m_log.InfoFormat("[WIND] {0} plugin found, initializing.", m_desiredWindPlugin); + m_log.InfoFormat("[WIND] {0} plugin found, initializing.", desiredWindPlugin); if (windConfig != null) { m_activeWindPlugin.Initialise(); m_activeWindPlugin.WindConfig(m_scene, windConfig); } - } + } // if the plug-in wasn't found, default to no wind. if (m_activeWindPlugin == null) { - m_log.ErrorFormat("[WIND] Could not find specified wind plug-in: {0}", m_desiredWindPlugin); + m_log.ErrorFormat("[WIND] Could not find specified wind plug-in: {0}", desiredWindPlugin); m_log.ErrorFormat("[WIND] Defaulting to no wind."); } // This one puts an entry in the main help screen m_scene.AddCommand(this, String.Empty, "wind", "Usage: wind [value] - Get or Update Wind paramaters", null); - + // This one enables the ability to type just the base command without any parameters m_scene.AddCommand(this, "wind", "", "", HandleConsoleCommand); @@ -137,7 +127,7 @@ namespace OpenSim.Region.CoreModules { m_scene.AddCommand(this, String.Format("wind base wind_plugin {0}", windPlugin.Name), String.Format("{0} - {1}", windPlugin.Name, windPlugin.Description), "", HandleConsoleBaseCommand); m_scene.AddCommand(this, String.Format("wind base wind_update_rate"), "Change the wind update rate.", "", HandleConsoleBaseCommand); - + foreach (KeyValuePair kvp in windPlugin.WindParams()) { m_scene.AddCommand(this, String.Format("wind {0} {1}", windPlugin.Name, kvp.Key), String.Format("{0} : {1} - {2}", windPlugin.Name, kvp.Key, kvp.Value), "", HandleConsoleParamCommand); @@ -159,17 +149,11 @@ namespace OpenSim.Region.CoreModules m_ready = true; } - } - public void RegionLoaded(Scene scene) - { } - public void RemoveRegion(Scene scene) + public void PostInitialise() { - scene.EventManager.OnFrame -= WindUpdate; - scene.EventManager.OnMakeRootAgent -= OnAgentEnteredRegion; - scene.UnregisterModuleInterface(this); } public void Close() @@ -198,6 +182,11 @@ namespace OpenSim.Region.CoreModules get { return "WindModule"; } } + public bool IsSharedModule + { + get { return false; } + } + #endregion diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs index 6bda1e9..285d36a 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs @@ -30,7 +30,6 @@ using System.Collections.Generic; using System.Drawing; using System.Reflection; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenMetaverse.Imaging; @@ -60,8 +59,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap public face[] trns; } - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class MapImageModule : IMapImageGenerator, INonSharedRegionModule + public class MapImageModule : IMapImageGenerator, IRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -130,38 +128,25 @@ namespace OpenSim.Region.CoreModules.World.WorldMap #endregion - #region INonSharedRegionModule Members + #region IRegionModule Members - public void Initialise(IConfigSource source) + public void Initialise(Scene scene, IConfigSource source) { + m_scene = scene; m_config = source; IConfig startupConfig = m_config.Configs["Startup"]; if (startupConfig.GetString("MapImageModule", "MapImageModule") != "MapImageModule") return; - } - public void AddRegion(Scene scene) - { - m_scene = scene; m_scene.RegisterModuleInterface(this); } - public Type ReplaceableInterface - { - get { return null; } - } - - public void RegionLoaded(Scene scene) + public void PostInitialise() { } - public void RemoveRegion(Scene scene) - { - scene.UnregisterModuleInterface(this); - } - public void Close() { } @@ -171,6 +156,11 @@ namespace OpenSim.Region.CoreModules.World.WorldMap get { return "MapImageModule"; } } + public bool IsSharedModule + { + get { return false; } + } + #endregion // TODO: unused: diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs index dd33673..be46fa5 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs @@ -24,12 +24,9 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -using System; using System.Collections.Generic; using System.Reflection; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -41,8 +38,7 @@ using GridRegion = OpenSim.Services.Interfaces.GridRegion; namespace OpenSim.Region.CoreModules.World.WorldMap { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class MapSearchModule : ISharedRegionModule + public class MapSearchModule : IRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -50,12 +46,8 @@ namespace OpenSim.Region.CoreModules.World.WorldMap Scene m_scene = null; // only need one for communication with GridService List m_scenes = new List(); - #region ISharedRegionModule Members - public void Initialise(IConfigSource source) - { - } - - public void AddRegion(Scene scene) + #region IRegionModule Members + public void Initialise(Scene scene, IConfigSource source) { if (m_scene == null) { @@ -66,22 +58,6 @@ namespace OpenSim.Region.CoreModules.World.WorldMap scene.EventManager.OnNewClient += OnNewClient; } - public Type ReplaceableInterface - { - get { return null; } - } - - public void RegionLoaded(Scene scene) - { - } - - public void RemoveRegion(Scene scene) - { - if(m_scenes.Contains(scene)) - m_scenes.Remove(scene); - scene.EventManager.OnNewClient -= OnNewClient; - } - public void PostInitialise() { } @@ -97,6 +73,11 @@ namespace OpenSim.Region.CoreModules.World.WorldMap get { return "MapSearchModule"; } } + public bool IsSharedModule + { + get { return true; } + } + #endregion private void OnNewClient(IClientAPI client) -- cgit v1.1 From 536a6bac72b33220dc785e70dd703b02330f3812 Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 29 Jan 2010 07:42:45 +0000 Subject: Resolve one more conflict I overlooked --- .../CoreModules/Scripting/WorldComm/WorldCommModule.cs | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs index 93aa88c..60df2e7 100644 --- a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs @@ -120,20 +120,6 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm if (maxlisteners < 1) maxlisteners = int.MaxValue; if (maxhandles < 1) maxhandles = int.MaxValue; -<<<<<<< HEAD:OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs - m_listenerManager = new ListenerManager(maxlisteners, maxhandles); - m_pendingQ = new Queue(); - m_pending = Queue.Synchronized(m_pendingQ); - } - - public void PostInitialise() - { - } - - public void AddRegion(Scene scene) - { -======= ->>>>>>> ec3c31e... Updates all IRegionModules to the new style region modules.:OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs m_scene = scene; m_scene.RegisterModuleInterface(this); m_listenerManager = new ListenerManager(maxlisteners, maxhandles); -- cgit v1.1 From ae2174d8f526b225c3cccf551f1a9f01d6569203 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 29 Jan 2010 18:11:53 +0000 Subject: Add method to get all items with the same name from a particular prim Extend load oar test to check loading of a sound item --- OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs index 1200105..bf80a1c 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs @@ -237,6 +237,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests SceneObjectGroup object1 = new SceneObjectGroup(part1); // Let's put some inventory items into our object + string soundItemName = "sound-item1"; UUID soundItemUuid = UUID.Parse("00000000-0000-0000-0000-000000000002"); Type type = GetType(); Assembly assembly = type.Assembly; @@ -269,7 +270,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests asset1FileName = ArchiveConstants.ASSETS_PATH + soundUuid + ".wav"; */ - TaskInventoryItem item1 = new TaskInventoryItem { AssetID = soundUuid, ItemID = soundItemUuid }; + TaskInventoryItem item1 + = new TaskInventoryItem { AssetID = soundUuid, ItemID = soundItemUuid, Name = soundItemName }; part1.Inventory.AddInventoryItem(item1, true); } } @@ -305,14 +307,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests Assert.That( object1PartLoaded.OffsetPosition, Is.EqualTo(offsetPosition), "object1 offset position not equal"); - // Need to implement a method to get the task inventory item by name (since the uuid will have changed on load) - /* - TaskInventoryItem loadedSoundItem = object1PartLoaded.Inventory.GetInventoryItem(soundItemUuid); + TaskInventoryItem loadedSoundItem = object1PartLoaded.Inventory.GetInventoryItems(soundItemName)[0]; Assert.That(loadedSoundItem, Is.Not.Null, "loaded sound item was null"); AssetBase loadedSoundAsset = scene.AssetService.Get(loadedSoundItem.AssetID.ToString()); Assert.That(loadedSoundAsset, Is.Not.Null, "loaded sound asset was null"); Assert.That(loadedSoundAsset.Data, Is.EqualTo(soundData), "saved and loaded sound data do not match"); - */ // Temporary Console.WriteLine("Successfully completed {0}", MethodBase.GetCurrentMethod()); -- cgit v1.1 From c1da07e4eb3510588e97f4652d72f875be51faa8 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 29 Jan 2010 20:59:56 +0000 Subject: factor out scene setup in ArchiverTests --- .../World/Archiver/Tests/ArchiverTests.cs | 93 ++++++++++++---------- 1 file changed, 53 insertions(+), 40 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs index bf80a1c..5a177b2 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs @@ -42,6 +42,7 @@ using OpenSim.Region.CoreModules.World.Terrain; using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Framework.Scenes.Serialization; using OpenSim.Tests.Common; +using OpenSim.Tests.Common.Mock; using OpenSim.Tests.Common.Setup; namespace OpenSim.Region.CoreModules.World.Archiver.Tests @@ -51,6 +52,20 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests { private Guid m_lastRequestId; private string m_lastErrorMessage; + + protected TestScene m_scene; + protected ArchiverModule m_archiverModule; + + [SetUp] + public void SetUp() + { + m_archiverModule = new ArchiverModule(); + SerialiserModule serialiserModule = new SerialiserModule(); + TerrainModule terrainModule = new TerrainModule(); + + m_scene = SceneSetupHelpers.SetupScene("scene1"); + SceneSetupHelpers.SetupSceneModules(m_scene, m_archiverModule, serialiserModule, terrainModule); + } private void LoadCompleted(Guid requestId, string errorMessage) { @@ -75,6 +90,23 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests } } +// protected void AddSceneObject1() +// { +// string partName = "My Little Pony"; +// UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000015"); +// PrimitiveBaseShape shape = PrimitiveBaseShape.CreateSphere(); +// Vector3 groupPosition = new Vector3(10, 20, 30); +// Quaternion rotationOffset = new Quaternion(20, 30, 40, 50); +// Vector3 offsetPosition = new Vector3(5, 10, 15); +// +// part1 +// = new SceneObjectPart( +// ownerId, shape, groupPosition, rotationOffset, offsetPosition); +// part1.Name = partName; +// +// scene.AddNewSceneObject(new SceneObjectGroup(part1), false); +// } + /// /// Test saving a V0.2 OpenSim Region Archive. /// @@ -84,13 +116,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests TestHelper.InMethod(); //log4net.Config.XmlConfigurator.Configure(); - ArchiverModule archiverModule = new ArchiverModule(); - SerialiserModule serialiserModule = new SerialiserModule(); - TerrainModule terrainModule = new TerrainModule(); - - Scene scene = SceneSetupHelpers.SetupScene("asset"); - SceneSetupHelpers.SetupSceneModules(scene, archiverModule, serialiserModule, terrainModule); - SceneObjectPart part1; // Create and add prim 1 @@ -107,7 +132,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests ownerId, shape, groupPosition, rotationOffset, offsetPosition); part1.Name = partName; - scene.AddNewSceneObject(new SceneObjectGroup(part1), false); + m_scene.AddNewSceneObject(new SceneObjectGroup(part1), false); } SceneObjectPart part2; @@ -126,17 +151,17 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests ownerId, shape, groupPosition, rotationOffset, offsetPosition); part2.Name = partName; - scene.AddNewSceneObject(new SceneObjectGroup(part2), false); + m_scene.AddNewSceneObject(new SceneObjectGroup(part2), false); } MemoryStream archiveWriteStream = new MemoryStream(); - scene.EventManager.OnOarFileSaved += SaveCompleted; + m_scene.EventManager.OnOarFileSaved += SaveCompleted; Guid requestId = new Guid("00000000-0000-0000-0000-808080808080"); lock (this) { - archiverModule.ArchiveRegion(archiveWriteStream, requestId); + m_archiverModule.ArchiveRegion(archiveWriteStream, requestId); //AssetServerBase assetServer = (AssetServerBase)scene.CommsManager.AssetCache.AssetServer; //while (assetServer.HasWaitingRequests()) // assetServer.ProcessNextRequest(); @@ -224,11 +249,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests Quaternion rotationOffset = new Quaternion(60, 70, 80, 90); Vector3 offsetPosition = new Vector3(20, 25, 30); - SerialiserModule serialiserModule = new SerialiserModule(); - ArchiverModule archiverModule = new ArchiverModule(); - - Scene scene = SceneSetupHelpers.SetupScene(); - SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); +// SerialiserModule serialiserModule = new SerialiserModule(); +// ArchiverModule archiverModule = new ArchiverModule(); +// +// Scene scene = SceneSetupHelpers.SetupScene(); +// SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); SceneObjectPart part1 = new SceneObjectPart( @@ -276,7 +301,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests } } - scene.AddNewSceneObject(object1, false); + m_scene.AddNewSceneObject(object1, false); string object1FileName = string.Format( "{0}_{1:000}-{2:000}-{3:000}__{4}.xml", @@ -291,13 +316,13 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests lock (this) { - scene.EventManager.OnOarFileLoaded += LoadCompleted; - archiverModule.DearchiveRegion(archiveReadStream); + m_scene.EventManager.OnOarFileLoaded += LoadCompleted; + m_archiverModule.DearchiveRegion(archiveReadStream); } Assert.That(m_lastErrorMessage, Is.Null); - SceneObjectPart object1PartLoaded = scene.GetSceneObjectPart(part1Name); + SceneObjectPart object1PartLoaded = m_scene.GetSceneObjectPart(part1Name); Assert.That(object1PartLoaded, Is.Not.Null, "object1 was not loaded"); Assert.That(object1PartLoaded.Name, Is.EqualTo(part1Name), "object1 names not identical"); @@ -309,7 +334,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests TaskInventoryItem loadedSoundItem = object1PartLoaded.Inventory.GetInventoryItems(soundItemName)[0]; Assert.That(loadedSoundItem, Is.Not.Null, "loaded sound item was null"); - AssetBase loadedSoundAsset = scene.AssetService.Get(loadedSoundItem.AssetID.ToString()); + AssetBase loadedSoundAsset = m_scene.AssetService.Get(loadedSoundItem.AssetID.ToString()); Assert.That(loadedSoundAsset, Is.Not.Null, "loaded sound asset was null"); Assert.That(loadedSoundAsset.Data, Is.EqualTo(soundData), "saved and loaded sound data do not match"); @@ -324,12 +349,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests public void TestLoadOarV0_2RegionSettings() { TestHelper.InMethod(); - //log4net.Config.XmlConfigurator.Configure(); - - SerialiserModule serialiserModule = new SerialiserModule(); - ArchiverModule archiverModule = new ArchiverModule(); - Scene scene = SceneSetupHelpers.SetupScene(); - SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); + //log4net.Config.XmlConfigurator.Configure(); MemoryStream archiveWriteStream = new MemoryStream(); TarArchiveWriter tar = new TarArchiveWriter(archiveWriteStream); @@ -376,12 +396,12 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests lock (this) { - scene.EventManager.OnOarFileLoaded += LoadCompleted; - archiverModule.DearchiveRegion(archiveReadStream); + m_scene.EventManager.OnOarFileLoaded += LoadCompleted; + m_archiverModule.DearchiveRegion(archiveReadStream); } Assert.That(m_lastErrorMessage, Is.Null); - RegionSettings loadedRs = scene.RegionInfo.RegionSettings; + RegionSettings loadedRs = m_scene.RegionInfo.RegionSettings; Assert.That(loadedRs.AgentLimit, Is.EqualTo(17)); Assert.That(loadedRs.AllowDamage, Is.True); @@ -433,27 +453,20 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests // Create an oar file that we can use for the merge { - ArchiverModule archiverModule = new ArchiverModule(); - SerialiserModule serialiserModule = new SerialiserModule(); - TerrainModule terrainModule = new TerrainModule(); - - Scene scene = SceneSetupHelpers.SetupScene(); - SceneSetupHelpers.SetupSceneModules(scene, archiverModule, serialiserModule, terrainModule); - SceneObjectPart part2 = new SceneObjectPart( UUID.Zero, part2Shape, part2GroupPosition, part2RotationOffset, part2OffsetPosition); part2.Name = part2Name; SceneObjectGroup object2 = new SceneObjectGroup(part2); - scene.AddNewSceneObject(object2, false); + m_scene.AddNewSceneObject(object2, false); // Write out this scene - scene.EventManager.OnOarFileSaved += SaveCompleted; + m_scene.EventManager.OnOarFileSaved += SaveCompleted; lock (this) { - archiverModule.ArchiveRegion(archiveWriteStream); + m_archiverModule.ArchiveRegion(archiveWriteStream); Monitor.Wait(this, 60000); } } -- cgit v1.1 From 115e66218eaa6ca4fed8b754765e4c289c24a207 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 29 Jan 2010 21:10:14 +0000 Subject: refactor out scene object 1 creation n ArchiverTetss --- .../World/Archiver/Tests/ArchiverTests.cs | 66 ++++++++-------------- 1 file changed, 22 insertions(+), 44 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs index 5a177b2..b4af8a6 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs @@ -55,6 +55,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests protected TestScene m_scene; protected ArchiverModule m_archiverModule; + + protected SceneObjectPart m_part1; [SetUp] public void SetUp() @@ -90,22 +92,20 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests } } -// protected void AddSceneObject1() -// { -// string partName = "My Little Pony"; -// UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000015"); -// PrimitiveBaseShape shape = PrimitiveBaseShape.CreateSphere(); -// Vector3 groupPosition = new Vector3(10, 20, 30); -// Quaternion rotationOffset = new Quaternion(20, 30, 40, 50); -// Vector3 offsetPosition = new Vector3(5, 10, 15); -// -// part1 -// = new SceneObjectPart( -// ownerId, shape, groupPosition, rotationOffset, offsetPosition); -// part1.Name = partName; -// -// scene.AddNewSceneObject(new SceneObjectGroup(part1), false); -// } + protected void AddSceneObject1() + { + string partName = "My Little Pony"; + UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000015"); + PrimitiveBaseShape shape = PrimitiveBaseShape.CreateSphere(); + Vector3 groupPosition = new Vector3(10, 20, 30); + Quaternion rotationOffset = new Quaternion(20, 30, 40, 50); + Vector3 offsetPosition = new Vector3(5, 10, 15); + + m_part1 + = new SceneObjectPart(ownerId, shape, groupPosition, rotationOffset, offsetPosition) { Name = partName }; + + m_scene.AddNewSceneObject(new SceneObjectGroup(m_part1), false); + } /// /// Test saving a V0.2 OpenSim Region Archive. @@ -116,24 +116,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests TestHelper.InMethod(); //log4net.Config.XmlConfigurator.Configure(); - SceneObjectPart part1; - - // Create and add prim 1 - { - string partName = "My Little Pony"; - UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000015"); - PrimitiveBaseShape shape = PrimitiveBaseShape.CreateSphere(); - Vector3 groupPosition = new Vector3(10, 20, 30); - Quaternion rotationOffset = new Quaternion(20, 30, 40, 50); - Vector3 offsetPosition = new Vector3(5, 10, 15); - - part1 - = new SceneObjectPart( - ownerId, shape, groupPosition, rotationOffset, offsetPosition); - part1.Name = partName; - - m_scene.AddNewSceneObject(new SceneObjectGroup(part1), false); - } + AddSceneObject1(); SceneObjectPart part2; @@ -180,9 +163,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests bool gotObject2File = false; string expectedObject1FileName = string.Format( "{0}_{1:000}-{2:000}-{3:000}__{4}.xml", - part1.Name, - Math.Round(part1.GroupPosition.X), Math.Round(part1.GroupPosition.Y), Math.Round(part1.GroupPosition.Z), - part1.UUID); + m_part1.Name, + Math.Round(m_part1.GroupPosition.X), Math.Round(m_part1.GroupPosition.Y), Math.Round(m_part1.GroupPosition.Z), + m_part1.UUID); string expectedObject2FileName = string.Format( "{0}_{1:000}-{2:000}-{3:000}__{4}.xml", part2.Name, @@ -202,7 +185,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests { string fileName = filePath.Remove(0, ArchiveConstants.OBJECTS_PATH.Length); - if (fileName.StartsWith(part1.Name)) + if (fileName.StartsWith(m_part1.Name)) { Assert.That(fileName, Is.EqualTo(expectedObject1FileName)); gotObject1File = true; @@ -243,18 +226,13 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests tar.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, ArchiveWriteRequestExecution.Create0p2ControlFile()); + AddSceneObject1(); string part1Name = "object1"; PrimitiveBaseShape shape = PrimitiveBaseShape.CreateCylinder(); Vector3 groupPosition = new Vector3(90, 80, 70); Quaternion rotationOffset = new Quaternion(60, 70, 80, 90); Vector3 offsetPosition = new Vector3(20, 25, 30); -// SerialiserModule serialiserModule = new SerialiserModule(); -// ArchiverModule archiverModule = new ArchiverModule(); -// -// Scene scene = SceneSetupHelpers.SetupScene(); -// SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); - SceneObjectPart part1 = new SceneObjectPart( UUID.Zero, shape, groupPosition, rotationOffset, offsetPosition); -- cgit v1.1 From 75dcd721de7aec4e43d091724ac883b1d945aae2 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 29 Jan 2010 21:27:14 +0000 Subject: use common part1 creation in ArchiverTests.TestLoadOarV0_2() --- .../World/Archiver/Tests/ArchiverTests.cs | 58 +++++++++++----------- 1 file changed, 28 insertions(+), 30 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs index b4af8a6..a0958d1 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs @@ -55,8 +55,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests protected TestScene m_scene; protected ArchiverModule m_archiverModule; - - protected SceneObjectPart m_part1; [SetUp] public void SetUp() @@ -92,7 +90,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests } } - protected void AddSceneObject1() + protected SceneObjectPart CreateSceneObjectPart1() { string partName = "My Little Pony"; UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000015"); @@ -101,10 +99,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests Quaternion rotationOffset = new Quaternion(20, 30, 40, 50); Vector3 offsetPosition = new Vector3(5, 10, 15); - m_part1 - = new SceneObjectPart(ownerId, shape, groupPosition, rotationOffset, offsetPosition) { Name = partName }; - - m_scene.AddNewSceneObject(new SceneObjectGroup(m_part1), false); + return new SceneObjectPart(ownerId, shape, groupPosition, rotationOffset, offsetPosition) { Name = partName }; } /// @@ -116,7 +111,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests TestHelper.InMethod(); //log4net.Config.XmlConfigurator.Configure(); - AddSceneObject1(); + SceneObjectPart part1 = CreateSceneObjectPart1(); + m_scene.AddNewSceneObject(new SceneObjectGroup(part1), false); SceneObjectPart part2; @@ -163,9 +159,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests bool gotObject2File = false; string expectedObject1FileName = string.Format( "{0}_{1:000}-{2:000}-{3:000}__{4}.xml", - m_part1.Name, - Math.Round(m_part1.GroupPosition.X), Math.Round(m_part1.GroupPosition.Y), Math.Round(m_part1.GroupPosition.Z), - m_part1.UUID); + part1.Name, + Math.Round(part1.GroupPosition.X), Math.Round(part1.GroupPosition.Y), Math.Round(part1.GroupPosition.Z), + part1.UUID); string expectedObject2FileName = string.Format( "{0}_{1:000}-{2:000}-{3:000}__{4}.xml", part2.Name, @@ -185,7 +181,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests { string fileName = filePath.Remove(0, ArchiveConstants.OBJECTS_PATH.Length); - if (fileName.StartsWith(m_part1.Name)) + if (fileName.StartsWith(part1.Name)) { Assert.That(fileName, Is.EqualTo(expectedObject1FileName)); gotObject1File = true; @@ -226,19 +222,21 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests tar.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, ArchiveWriteRequestExecution.Create0p2ControlFile()); - AddSceneObject1(); - string part1Name = "object1"; - PrimitiveBaseShape shape = PrimitiveBaseShape.CreateCylinder(); - Vector3 groupPosition = new Vector3(90, 80, 70); - Quaternion rotationOffset = new Quaternion(60, 70, 80, 90); - Vector3 offsetPosition = new Vector3(20, 25, 30); - - SceneObjectPart part1 - = new SceneObjectPart( - UUID.Zero, shape, groupPosition, rotationOffset, offsetPosition); - part1.Name = part1Name; + SceneObjectPart part1 = CreateSceneObjectPart1(); SceneObjectGroup object1 = new SceneObjectGroup(part1); +// string part1Name = "object1"; +// PrimitiveBaseShape shape = PrimitiveBaseShape.CreateCylinder(); +// Vector3 groupPosition = new Vector3(90, 80, 70); +// Quaternion rotationOffset = new Quaternion(60, 70, 80, 90); +// Vector3 offsetPosition = new Vector3(20, 25, 30); +// +// SceneObjectPart part1 +// = new SceneObjectPart( +// UUID.Zero, shape, groupPosition, rotationOffset, offsetPosition); +// part1.Name = part1Name; +// SceneObjectGroup object1 = new SceneObjectGroup(part1); + // Let's put some inventory items into our object string soundItemName = "sound-item1"; UUID soundItemUuid = UUID.Parse("00000000-0000-0000-0000-000000000002"); @@ -283,8 +281,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests string object1FileName = string.Format( "{0}_{1:000}-{2:000}-{3:000}__{4}.xml", - part1Name, - Math.Round(groupPosition.X), Math.Round(groupPosition.Y), Math.Round(groupPosition.Z), + part1.Name, + Math.Round(part1.GroupPosition.X), Math.Round(part1.GroupPosition.Y), Math.Round(part1.GroupPosition.Z), part1.UUID); tar.WriteFile(ArchiveConstants.OBJECTS_PATH + object1FileName, SceneObjectSerializer.ToXml2Format(object1)); @@ -300,15 +298,15 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests Assert.That(m_lastErrorMessage, Is.Null); - SceneObjectPart object1PartLoaded = m_scene.GetSceneObjectPart(part1Name); + SceneObjectPart object1PartLoaded = m_scene.GetSceneObjectPart(part1.Name); Assert.That(object1PartLoaded, Is.Not.Null, "object1 was not loaded"); - Assert.That(object1PartLoaded.Name, Is.EqualTo(part1Name), "object1 names not identical"); - Assert.That(object1PartLoaded.GroupPosition, Is.EqualTo(groupPosition), "object1 group position not equal"); + Assert.That(object1PartLoaded.Name, Is.EqualTo(part1.Name), "object1 names not identical"); + Assert.That(object1PartLoaded.GroupPosition, Is.EqualTo(part1.GroupPosition), "object1 group position not equal"); Assert.That( - object1PartLoaded.RotationOffset, Is.EqualTo(rotationOffset), "object1 rotation offset not equal"); + object1PartLoaded.RotationOffset, Is.EqualTo(part1.RotationOffset), "object1 rotation offset not equal"); Assert.That( - object1PartLoaded.OffsetPosition, Is.EqualTo(offsetPosition), "object1 offset position not equal"); + object1PartLoaded.OffsetPosition, Is.EqualTo(part1.OffsetPosition), "object1 offset position not equal"); TaskInventoryItem loadedSoundItem = object1PartLoaded.Inventory.GetInventoryItems(soundItemName)[0]; Assert.That(loadedSoundItem, Is.Not.Null, "loaded sound item was null"); -- cgit v1.1 From 055d991cc12f8c3720b41ffc314d95b8dbd7ce1a Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 29 Jan 2010 21:33:11 +0000 Subject: minor: swap which part uses the automatically set up scene in TestMergeOarV0_2() --- .../World/Archiver/Tests/ArchiverTests.cs | 38 ++++++++-------------- 1 file changed, 13 insertions(+), 25 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs index a0958d1..930ea1c 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs @@ -225,18 +225,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests SceneObjectPart part1 = CreateSceneObjectPart1(); SceneObjectGroup object1 = new SceneObjectGroup(part1); -// string part1Name = "object1"; -// PrimitiveBaseShape shape = PrimitiveBaseShape.CreateCylinder(); -// Vector3 groupPosition = new Vector3(90, 80, 70); -// Quaternion rotationOffset = new Quaternion(60, 70, 80, 90); -// Vector3 offsetPosition = new Vector3(20, 25, 30); -// -// SceneObjectPart part1 -// = new SceneObjectPart( -// UUID.Zero, shape, groupPosition, rotationOffset, offsetPosition); -// part1.Name = part1Name; -// SceneObjectGroup object1 = new SceneObjectGroup(part1); - // Let's put some inventory items into our object string soundItemName = "sound-item1"; UUID soundItemUuid = UUID.Parse("00000000-0000-0000-0000-000000000002"); @@ -429,16 +417,23 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests // Create an oar file that we can use for the merge { + ArchiverModule archiverModule = new ArchiverModule(); + SerialiserModule serialiserModule = new SerialiserModule(); + TerrainModule terrainModule = new TerrainModule(); + + Scene scene = SceneSetupHelpers.SetupScene(); + SceneSetupHelpers.SetupSceneModules(scene, archiverModule, serialiserModule, terrainModule); + SceneObjectPart part2 = new SceneObjectPart( UUID.Zero, part2Shape, part2GroupPosition, part2RotationOffset, part2OffsetPosition); part2.Name = part2Name; SceneObjectGroup object2 = new SceneObjectGroup(part2); - m_scene.AddNewSceneObject(object2, false); + scene.AddNewSceneObject(object2, false); // Write out this scene - m_scene.EventManager.OnOarFileSaved += SaveCompleted; + scene.EventManager.OnOarFileSaved += SaveCompleted; lock (this) { @@ -448,13 +443,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests } { - ArchiverModule archiverModule = new ArchiverModule(); - SerialiserModule serialiserModule = new SerialiserModule(); - TerrainModule terrainModule = new TerrainModule(); - - Scene scene = SceneSetupHelpers.SetupScene(); - SceneSetupHelpers.SetupSceneModules(scene, archiverModule, serialiserModule, terrainModule); - string part1Name = "objectExisting"; PrimitiveBaseShape part1Shape = PrimitiveBaseShape.CreateCylinder(); Vector3 part1GroupPosition = new Vector3(80, 70, 60); @@ -467,20 +455,20 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests part1.Name = part1Name; SceneObjectGroup object1 = new SceneObjectGroup(part1); - scene.AddNewSceneObject(object1, false); + m_scene.AddNewSceneObject(object1, false); // Merge in the archive we created earlier byte[] archive = archiveWriteStream.ToArray(); MemoryStream archiveReadStream = new MemoryStream(archive); - archiverModule.DearchiveRegion(archiveReadStream, true, Guid.Empty); + m_archiverModule.DearchiveRegion(archiveReadStream, true, Guid.Empty); - SceneObjectPart object1Existing = scene.GetSceneObjectPart(part1Name); + SceneObjectPart object1Existing = m_scene.GetSceneObjectPart(part1Name); Assert.That(object1Existing, Is.Not.Null, "object1 was not present after merge"); Assert.That(object1Existing.Name, Is.EqualTo(part1Name), "object1 names not identical after merge"); Assert.That(object1Existing.GroupPosition, Is.EqualTo(part1GroupPosition), "object1 group position not equal after merge"); - SceneObjectPart object2PartMerged = scene.GetSceneObjectPart(part2Name); + SceneObjectPart object2PartMerged = m_scene.GetSceneObjectPart(part2Name); Assert.That(object2PartMerged, Is.Not.Null, "object2 was not present after merge"); Assert.That(object2PartMerged.Name, Is.EqualTo(part2Name), "object2 names not identical after merge"); Assert.That(object2PartMerged.GroupPosition, Is.EqualTo(part2GroupPosition), "object2 group position not equal after merge"); -- cgit v1.1 From 0c3043a298070b95dd782a9193b9c245aa7894ee Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 29 Jan 2010 21:37:25 +0000 Subject: use common part1 createio nin TestMergeOarV0_2() --- .../World/Archiver/Tests/ArchiverTests.cs | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs index 930ea1c..dea8a45 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs @@ -443,19 +443,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests } { - string part1Name = "objectExisting"; - PrimitiveBaseShape part1Shape = PrimitiveBaseShape.CreateCylinder(); - Vector3 part1GroupPosition = new Vector3(80, 70, 60); - Quaternion part1RotationOffset = new Quaternion(50, 60, 70, 80); - Vector3 part1OffsetPosition = new Vector3(15, 20, 25); - - SceneObjectPart part1 - = new SceneObjectPart( - UUID.Zero, part1Shape, part1GroupPosition, part1RotationOffset, part1OffsetPosition); - part1.Name = part1Name; - SceneObjectGroup object1 = new SceneObjectGroup(part1); - - m_scene.AddNewSceneObject(object1, false); + SceneObjectPart part1 = CreateSceneObjectPart1(); + m_scene.AddNewSceneObject(new SceneObjectGroup(part1), false); // Merge in the archive we created earlier byte[] archive = archiveWriteStream.ToArray(); @@ -463,10 +452,10 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests m_archiverModule.DearchiveRegion(archiveReadStream, true, Guid.Empty); - SceneObjectPart object1Existing = m_scene.GetSceneObjectPart(part1Name); + SceneObjectPart object1Existing = m_scene.GetSceneObjectPart(part1.Name); Assert.That(object1Existing, Is.Not.Null, "object1 was not present after merge"); - Assert.That(object1Existing.Name, Is.EqualTo(part1Name), "object1 names not identical after merge"); - Assert.That(object1Existing.GroupPosition, Is.EqualTo(part1GroupPosition), "object1 group position not equal after merge"); + Assert.That(object1Existing.Name, Is.EqualTo(part1.Name), "object1 names not identical after merge"); + Assert.That(object1Existing.GroupPosition, Is.EqualTo(part1.GroupPosition), "object1 group position not equal after merge"); SceneObjectPart object2PartMerged = m_scene.GetSceneObjectPart(part2Name); Assert.That(object2PartMerged, Is.Not.Null, "object2 was not present after merge"); -- cgit v1.1 From 68c7218fa1557a8e00c3f74829b91a5b43d94069 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 29 Jan 2010 21:42:27 +0000 Subject: make TestSaveOarV0_2() use a common part2 construction --- .../World/Archiver/Tests/ArchiverTests.cs | 32 ++++++++++------------ 1 file changed, 14 insertions(+), 18 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs index dea8a45..ae4aece 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs @@ -102,6 +102,18 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests return new SceneObjectPart(ownerId, shape, groupPosition, rotationOffset, offsetPosition) { Name = partName }; } + protected SceneObjectPart CreateSceneObjectPart2() + { + string partName = "Action Man"; + UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000016"); + PrimitiveBaseShape shape = PrimitiveBaseShape.CreateCylinder(); + Vector3 groupPosition = new Vector3(90, 80, 70); + Quaternion rotationOffset = new Quaternion(60, 70, 80, 90); + Vector3 offsetPosition = new Vector3(20, 25, 30); + + return new SceneObjectPart(ownerId, shape, groupPosition, rotationOffset, offsetPosition) { Name = partName }; + } + /// /// Test saving a V0.2 OpenSim Region Archive. /// @@ -114,24 +126,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests SceneObjectPart part1 = CreateSceneObjectPart1(); m_scene.AddNewSceneObject(new SceneObjectGroup(part1), false); - SceneObjectPart part2; - - // Create and add prim 2 - { - string partName = "Action Man"; - UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000016"); - PrimitiveBaseShape shape = PrimitiveBaseShape.CreateCylinder(); - Vector3 groupPosition = new Vector3(90, 80, 70); - Quaternion rotationOffset = new Quaternion(60, 70, 80, 90); - Vector3 offsetPosition = new Vector3(20, 25, 30); - - part2 - = new SceneObjectPart( - ownerId, shape, groupPosition, rotationOffset, offsetPosition); - part2.Name = partName; - - m_scene.AddNewSceneObject(new SceneObjectGroup(part2), false); - } + SceneObjectPart part2 = CreateSceneObjectPart2(); + m_scene.AddNewSceneObject(new SceneObjectGroup(part2), false); MemoryStream archiveWriteStream = new MemoryStream(); m_scene.EventManager.OnOarFileSaved += SaveCompleted; -- cgit v1.1 From 0cf88b34c9690a5c3d1d9983b59abed3b1e67911 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 29 Jan 2010 21:45:07 +0000 Subject: use common sop2 setup for TestMergeOarV0_2() --- .../World/Archiver/Tests/ArchiverTests.cs | 28 ++++++++++------------ 1 file changed, 12 insertions(+), 16 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs index ae4aece..c3e57f0 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs @@ -405,11 +405,13 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests MemoryStream archiveWriteStream = new MemoryStream(); - string part2Name = "objectMerge"; - PrimitiveBaseShape part2Shape = PrimitiveBaseShape.CreateCylinder(); - Vector3 part2GroupPosition = new Vector3(90, 80, 70); - Quaternion part2RotationOffset = new Quaternion(60, 70, 80, 90); - Vector3 part2OffsetPosition = new Vector3(20, 25, 30); +// string part2Name = "objectMerge"; +// PrimitiveBaseShape part2Shape = PrimitiveBaseShape.CreateCylinder(); +// Vector3 part2GroupPosition = new Vector3(90, 80, 70); +// Quaternion part2RotationOffset = new Quaternion(60, 70, 80, 90); +// Vector3 part2OffsetPosition = new Vector3(20, 25, 30); + + SceneObjectPart part2 = CreateSceneObjectPart2(); // Create an oar file that we can use for the merge { @@ -418,15 +420,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests TerrainModule terrainModule = new TerrainModule(); Scene scene = SceneSetupHelpers.SetupScene(); - SceneSetupHelpers.SetupSceneModules(scene, archiverModule, serialiserModule, terrainModule); - - SceneObjectPart part2 - = new SceneObjectPart( - UUID.Zero, part2Shape, part2GroupPosition, part2RotationOffset, part2OffsetPosition); - part2.Name = part2Name; - SceneObjectGroup object2 = new SceneObjectGroup(part2); + SceneSetupHelpers.SetupSceneModules(scene, archiverModule, serialiserModule, terrainModule); - scene.AddNewSceneObject(object2, false); + m_scene.AddNewSceneObject(new SceneObjectGroup(part2), false); // Write out this scene scene.EventManager.OnOarFileSaved += SaveCompleted; @@ -453,10 +449,10 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests Assert.That(object1Existing.Name, Is.EqualTo(part1.Name), "object1 names not identical after merge"); Assert.That(object1Existing.GroupPosition, Is.EqualTo(part1.GroupPosition), "object1 group position not equal after merge"); - SceneObjectPart object2PartMerged = m_scene.GetSceneObjectPart(part2Name); + SceneObjectPart object2PartMerged = m_scene.GetSceneObjectPart(part2.Name); Assert.That(object2PartMerged, Is.Not.Null, "object2 was not present after merge"); - Assert.That(object2PartMerged.Name, Is.EqualTo(part2Name), "object2 names not identical after merge"); - Assert.That(object2PartMerged.GroupPosition, Is.EqualTo(part2GroupPosition), "object2 group position not equal after merge"); + Assert.That(object2PartMerged.Name, Is.EqualTo(part2.Name), "object2 names not identical after merge"); + Assert.That(object2PartMerged.GroupPosition, Is.EqualTo(part2.GroupPosition), "object2 group position not equal after merge"); } } } -- cgit v1.1 From 7b53067d6d503fd3d94a4a0ab3955071ef96669c Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 29 Jan 2010 21:52:13 +0000 Subject: Apply http://opensimulator.org/mantis/view.php?id=4548 Fix command params check on fcache expire Thanks coyled --- OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs index adcf6bd..9216e0b 100644 --- a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs @@ -762,7 +762,7 @@ namespace Flotsam.RegionModules.AssetCache case "expire": - if (cmdparams.Length >= 3) + if (cmdparams.Length < 3) { m_log.InfoFormat("[FLOTSAM ASSET CACHE] Invalid parameters for Expire, please specify a valid date & time", cmd); break; -- cgit v1.1 From bbd41de6d5a4aa0301b408be28957b0a15bcc53d Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 2 Feb 2010 20:38:58 +0000 Subject: refactor: move world comm message queueing into its own method --- .../Scripting/WorldComm/WorldCommModule.cs | 36 ++++++++-------------- 1 file changed, 13 insertions(+), 23 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs index 60df2e7..d647e71 100644 --- a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs @@ -262,44 +262,34 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm { case ChatTypeEnum.Whisper: if (dis < m_whisperdistance) - { - lock (m_pending.SyncRoot) - { - m_pending.Enqueue(new ListenerInfo(li,name,id,msg)); - } - } + QueueMessage(new ListenerInfo(li, name, id, msg)); break; case ChatTypeEnum.Say: if (dis < m_saydistance) - { - lock (m_pending.SyncRoot) - { - m_pending.Enqueue(new ListenerInfo(li,name,id,msg)); - } - } + QueueMessage(new ListenerInfo(li, name, id, msg)); break; case ChatTypeEnum.Shout: if (dis < m_shoutdistance) - { - lock (m_pending.SyncRoot) - { - m_pending.Enqueue(new ListenerInfo(li,name,id,msg)); - } - } + QueueMessage(new ListenerInfo(li, name, id, msg)); break; case ChatTypeEnum.Region: - lock (m_pending.SyncRoot) - { - m_pending.Enqueue(new ListenerInfo(li,name,id,msg)); - } + QueueMessage(new ListenerInfo(li, name, id, msg)); break; } } } + protected void QueueMessage(ListenerInfo li) + { + lock (m_pending.SyncRoot) + { + m_pending.Enqueue(li); + } + } + /// /// Are there any listen events ready to be dispatched? /// @@ -319,7 +309,7 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm lock (m_pending.SyncRoot) { - li = (ListenerInfo) m_pending.Dequeue(); + li = (ListenerInfo)m_pending.Dequeue(); } return li; -- cgit v1.1 From 7c69badd3daa81464f00aa1009941c7c4825cc2b Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 3 Feb 2010 19:34:08 +0000 Subject: minor: remove one mono compiler warning --- .../CoreModules/Framework/Library/LibraryModule.cs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs b/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs index 6941e00..13f58bd 100644 --- a/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs +++ b/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs @@ -174,18 +174,16 @@ namespace OpenSim.Region.CoreModules.Framework.Library { m_log.DebugFormat("[LIBRARY MODULE]: Exception when processing archive {0}: {1}", iarFileName, e.Message); } - } - - } - - private void DumpLibrary() - { - InventoryFolderImpl lib = m_Scene.CommsManager.UserProfileCacheService.LibraryRoot; - - m_log.DebugFormat(" - folder {0}", lib.Name); - DumpFolder(lib); } +// +// private void DumpLibrary() +// { +// InventoryFolderImpl lib = m_Scene.CommsManager.UserProfileCacheService.LibraryRoot; +// +// m_log.DebugFormat(" - folder {0}", lib.Name); +// DumpFolder(lib); +// } private void DumpFolder(InventoryFolderImpl folder) { -- cgit v1.1 From bde7f361fa6e8151d2780f8b9ca0cfae97f8736b Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 3 Feb 2010 19:46:33 +0000 Subject: minor: remove one mono compiler warning --- OpenSim/Region/CoreModules/World/Access/AccessModule.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/World/Access/AccessModule.cs b/OpenSim/Region/CoreModules/World/Access/AccessModule.cs index dfa8df6..73f7ae3 100644 --- a/OpenSim/Region/CoreModules/World/Access/AccessModule.cs +++ b/OpenSim/Region/CoreModules/World/Access/AccessModule.cs @@ -42,9 +42,7 @@ namespace OpenSim.Region.CoreModules.World { public class AccessModule : ISharedRegionModule { - private static readonly ILog m_log = - LogManager.GetLogger( - MethodBase.GetCurrentMethod().DeclaringType); +// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private List m_SceneList = new List(); -- cgit v1.1 From f1b99c4a7f9543c3a2aa36de2e659bdefca9e68b Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 4 Feb 2010 21:35:56 +0000 Subject: minor: one method doc --- OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs index d57a8e5..3291be4 100644 --- a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs @@ -342,6 +342,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender m_log.Error( "[VECTORRENDERMODULE]: OpenJpeg Encode Failed. Empty byte data returned!"); } + m_textureManager.ReturnData(id, imageJ2000); } -- cgit v1.1 From 7058a4c2597a2b76704e906b73ae7077ff805b16 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 5 Feb 2010 18:09:27 +0000 Subject: Old OpenSim installations may have no AssetCaching setting in config-include/StandaloneCommon.ini [Modules] (or no [Modules] at all) If this is the case, this patch makes CenomeAssetCache the default cache (which matches that selected in StandaloneCommon.ini.example) Not having an asset cache may lead to a continual loop of appearance baking failures and cause dynamic textures not to work, among other effects --- OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs b/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs index 1add0ab..e0e4cc6 100644 --- a/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs @@ -324,7 +324,9 @@ namespace OpenSim.Region.CoreModules.Asset if (moduleConfig == null) return; - string name = moduleConfig.GetString("AssetCaching"); + // We're going to make CenomeAssetCache the default if there is no AssetCaching setting at all. This + // matches the default StandaloneCommon.ini.example + string name = moduleConfig.GetString("AssetCaching", Name); //Log.DebugFormat("[XXX] name = {0} (this module's name: {1}", name, Name); if (name != Name) -- cgit v1.1 From 68bb2dac45d7ce0d280cdfa66de3d142bb05c8cc Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 5 Feb 2010 19:21:27 +0000 Subject: Revert "Old OpenSim installations may have no AssetCaching setting in config-include/StandaloneCommon.ini [Modules] (or no [Modules] at all)" This will be replaced by a better solution where an enabled baking module will fail if no cache is in place (same for dynamic texture modules) This reverts commit 7058a4c2597a2b76704e906b73ae7077ff805b16. --- OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs b/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs index e0e4cc6..1add0ab 100644 --- a/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs @@ -324,9 +324,7 @@ namespace OpenSim.Region.CoreModules.Asset if (moduleConfig == null) return; - // We're going to make CenomeAssetCache the default if there is no AssetCaching setting at all. This - // matches the default StandaloneCommon.ini.example - string name = moduleConfig.GetString("AssetCaching", Name); + string name = moduleConfig.GetString("AssetCaching"); //Log.DebugFormat("[XXX] name = {0} (this module's name: {1}", name, Name); if (name != Name) -- cgit v1.1 From 59f6606ecf4ea7ac3928aec20d1528222961458b Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Sat, 6 Feb 2010 00:37:07 -0500 Subject: Endline fix --- .../DynamicTexture/DynamicTextureModule.cs | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs index 679c871..e3c7bbf 100644 --- a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs @@ -358,18 +358,18 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture // tmptex.DefaultTexture.Fullbright = true; part.UpdateTexture(tmptex); - } - - if (oldID != UUID.Zero && ((Disp & DISP_EXPIRE) != 0)) - { - if (oldAsset == null) oldAsset = scene.AssetService.Get(oldID.ToString()); - if (oldAsset != null) - { - if (oldAsset.Temporary == true) - { - scene.AssetService.Delete(oldID.ToString()); - } - } + } + + if (oldID != UUID.Zero && ((Disp & DISP_EXPIRE) != 0)) + { + if (oldAsset == null) oldAsset = scene.AssetService.Get(oldID.ToString()); + if (oldAsset != null) + { + if (oldAsset.Temporary == true) + { + scene.AssetService.Delete(oldID.ToString()); + } + } } } -- cgit v1.1 From fabf10f1cf29a20332f5ab3b5b467a6954a83b34 Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Sat, 6 Feb 2010 00:38:22 -0500 Subject: endline fix 2 --- .../ServiceConnectorsOut/Interregion/RESTInterregionComms.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs index 44458d1..fa3681a 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs @@ -436,12 +436,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion } OSDMap resp = new OSDMap(2); - string reason = String.Empty; - uint teleportFlags = 0; - if (args.ContainsKey("teleport_flags")) - { - teleportFlags = args["teleport_flags"].AsUInteger(); - } + string reason = String.Empty; + uint teleportFlags = 0; + if (args.ContainsKey("teleport_flags")) + { + teleportFlags = args["teleport_flags"].AsUInteger(); + } // This is the meaning of POST agent m_regionClient.AdjustUserInformation(aCircuit); -- cgit v1.1