From 951b45b80fd504b4874b9ec3e0fbff49a25cb46f Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 5 Jul 2012 00:05:06 +0100 Subject: Add OSSL function osForceAttachToAvatarFromInventory() This works like osForceAttachToAvatar() but allows an object to be directly specified from the script object's inventory rather than forcing it to be rezzed in the scene first. Still only attaches objects to the owner of the script. This allows one to bypass the complicated co-ordination of first rezzing objects in the scene before attaching them. Threat level high. --- .../CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs | 2 +- OpenSim/Region/CoreModules/World/Media/Moap/Tests/MoapTests.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs index b0c087f..7856953 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs @@ -122,7 +122,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests string attName = "att"; - SceneObjectGroup so = SceneHelpers.AddSceneObject(scene, attName, sp.UUID).ParentGroup; + SceneObjectGroup so = SceneHelpers.AddSceneObject(scene, attName, sp.UUID); scene.AttachmentsModule.AttachObject(sp, so, (uint)AttachmentPoint.Chest, false); diff --git a/OpenSim/Region/CoreModules/World/Media/Moap/Tests/MoapTests.cs b/OpenSim/Region/CoreModules/World/Media/Moap/Tests/MoapTests.cs index 0545250..396095a 100644 --- a/OpenSim/Region/CoreModules/World/Media/Moap/Tests/MoapTests.cs +++ b/OpenSim/Region/CoreModules/World/Media/Moap/Tests/MoapTests.cs @@ -63,7 +63,7 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap.Tests TestHelpers.InMethod(); // log4net.Config.XmlConfigurator.Configure(); - SceneObjectPart part = SceneHelpers.AddSceneObject(m_scene); + SceneObjectPart part = SceneHelpers.AddSceneObject(m_scene).RootPart; MediaEntry me = new MediaEntry(); m_module.SetMediaEntry(part, 1, me); @@ -88,7 +88,7 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap.Tests string homeUrl = "opensimulator.org"; - SceneObjectPart part = SceneHelpers.AddSceneObject(m_scene); + SceneObjectPart part = SceneHelpers.AddSceneObject(m_scene).RootPart; MediaEntry me = new MediaEntry() { HomeURL = homeUrl }; m_module.SetMediaEntry(part, 1, me); -- cgit v1.1 From 510e809abae3c126d68ffe2b0645b4697f5b56b2 Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Wed, 4 Jul 2012 00:53:16 +0100 Subject: porting console commands from raw2sculpt 3.2 --- .../CoreModules/World/Terrain/TerrainModule.cs | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs index 2eac0fa..3f848ed 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs @@ -1108,6 +1108,32 @@ namespace OpenSim.Region.CoreModules.World.Terrain CheckForTerrainUpdates(); } + private void InterfaceMinTerrain(Object[] args) + { + int x, y; + for (x = 0; x < m_channel.Width; x++) + { + for (y = 0; y < m_channel.Height; y++) + { + m_channel[x, y] = Math.Max((double)args[0], m_channel[x, y]); + } + } + CheckForTerrainUpdates(); + } + + private void InterfaceMaxTerrain(Object[] args) + { + int x, y; + for (x = 0; x < m_channel.Width; x++) + { + for (y = 0; y < m_channel.Height; y++) + { + m_channel[x, y] = Math.Min((double)args[0], m_channel[x, y]); + } + } + CheckForTerrainUpdates(); + } + private void InterfaceShowDebugStats(Object[] args) { double max = Double.MinValue; @@ -1248,6 +1274,12 @@ namespace OpenSim.Region.CoreModules.World.Terrain rescaleCommand.AddArgument("min", "min terrain height after rescaling", "Double"); rescaleCommand.AddArgument("max", "max terrain height after rescaling", "Double"); + Command minCommand = new Command("min", CommandIntentions.COMMAND_HAZARDOUS, InterfaceMinTerrain, "Sets the minimum terrain height to the specified value."); + minCommand.AddArgument("min", "terrain height to use as minimum", "Double"); + + Command maxCommand = new Command("max", CommandIntentions.COMMAND_HAZARDOUS, InterfaceMaxTerrain, "Sets the maximum terrain height to the specified value."); + maxCommand.AddArgument("min", "terrain height to use as maximum", "Double"); + // Debug Command showDebugStatsCommand = @@ -1279,6 +1311,8 @@ namespace OpenSim.Region.CoreModules.World.Terrain m_commander.RegisterCommand("effect", pluginRunCommand); m_commander.RegisterCommand("flip", flipCommand); m_commander.RegisterCommand("rescale", rescaleCommand); + m_commander.RegisterCommand("min", minCommand); + m_commander.RegisterCommand("max", maxCommand); // Add this to our scene so scripts can call these functions m_scene.RegisterModuleCommander(m_commander); -- cgit v1.1