From 4b0c5711b5099f3611783e103629deaa9033cd7f Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Mon, 12 Jul 2010 22:00:45 +0100 Subject: [PATCH] implement llClearPrimMedia() untested --- .../World/Media/Moap/MoapModule.cs | 5 +++++ .../Framework/Interfaces/IMoapModule.cs | 10 ++++++++++ .../Shared/Api/Implementation/LSL_Api.cs | 20 +++++++++++++++++++ 3 files changed, 35 insertions(+) diff --git a/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs b/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs index 43953a7eff..8699800704 100644 --- a/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs +++ b/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs @@ -129,6 +129,11 @@ namespace OpenSim.Region.CoreModules.Media.Moap part.ScheduleFullUpdate(); } + public void ClearMediaEntry(SceneObjectPart part, int face) + { + SetMediaEntry(part, face, null); + } + /// /// Sets or gets per face media textures. /// diff --git a/OpenSim/Region/Framework/Interfaces/IMoapModule.cs b/OpenSim/Region/Framework/Interfaces/IMoapModule.cs index 31bb6d87c0..24b6860742 100644 --- a/OpenSim/Region/Framework/Interfaces/IMoapModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IMoapModule.cs @@ -53,5 +53,15 @@ namespace OpenSim.Region.Framework.Interfaces /// /// void SetMediaEntry(SceneObjectPart part, int face, MediaEntry me); + + /// + /// Clear the media entry for a given prim face. + /// + /// + /// This is the equivalent of setting a media entry of null + /// + /// + /// /param> + void ClearMediaEntry(SceneObjectPart part, int face); } } \ No newline at end of file diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index ff2f6a2071..4773a503af 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -8023,6 +8023,26 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return ScriptBaseClass.LSL_STATUS_OK; } + public LSL_Integer llClearPrimMedia(LSL_Integer face) + { + m_host.AddScriptLPS(1); + ScriptSleep(1000); + + // LSL Spec http://wiki.secondlife.com/wiki/LlClearPrimMedia says to fail silently if face is invalid + // Assuming silently fail means sending back LSL_STATUS_OK. Ideally, need to check this. + // FIXME: Don't perform the media check directly + if (face < 0 || face > m_host.GetNumberOfSides() - 1) + return ScriptBaseClass.LSL_STATUS_OK; + + IMoapModule module = m_ScriptEngine.World.RequestModuleInterface(); + if (null == module) + throw new Exception("Media on a prim functions not available"); + + module.ClearMediaEntry(m_host, face); + + return ScriptBaseClass.LSL_STATUS_OK; + } + // // // The .NET definition of base 64 is: