diff options
author | Justin Clark-Casey (justincc) | 2010-07-12 22:00:45 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2010-07-26 23:34:20 +0100 |
commit | 39a38c4901f00eae15c2eed38191944f8f419f8b (patch) | |
tree | c7da1d3f05cab0d27d96217ee8d971a885949151 | |
parent | fix issue with GetMediaEntry if the face requested wasn't set to a media texture (diff) | |
download | opensim-SC_OLD-39a38c4901f00eae15c2eed38191944f8f419f8b.zip opensim-SC_OLD-39a38c4901f00eae15c2eed38191944f8f419f8b.tar.gz opensim-SC_OLD-39a38c4901f00eae15c2eed38191944f8f419f8b.tar.bz2 opensim-SC_OLD-39a38c4901f00eae15c2eed38191944f8f419f8b.tar.xz |
implement llClearPrimMedia()
untested
3 files changed, 35 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs b/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs index 43953a7..8699800 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 | |||
129 | part.ScheduleFullUpdate(); | 129 | part.ScheduleFullUpdate(); |
130 | } | 130 | } |
131 | 131 | ||
132 | public void ClearMediaEntry(SceneObjectPart part, int face) | ||
133 | { | ||
134 | SetMediaEntry(part, face, null); | ||
135 | } | ||
136 | |||
132 | /// <summary> | 137 | /// <summary> |
133 | /// Sets or gets per face media textures. | 138 | /// Sets or gets per face media textures. |
134 | /// </summary> | 139 | /// </summary> |
diff --git a/OpenSim/Region/Framework/Interfaces/IMoapModule.cs b/OpenSim/Region/Framework/Interfaces/IMoapModule.cs index 31bb6d8..24b6860 100644 --- a/OpenSim/Region/Framework/Interfaces/IMoapModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IMoapModule.cs | |||
@@ -53,5 +53,15 @@ namespace OpenSim.Region.Framework.Interfaces | |||
53 | /// <param name="face"></param> | 53 | /// <param name="face"></param> |
54 | /// <param name="me"></param> | 54 | /// <param name="me"></param> |
55 | void SetMediaEntry(SceneObjectPart part, int face, MediaEntry me); | 55 | void SetMediaEntry(SceneObjectPart part, int face, MediaEntry me); |
56 | |||
57 | /// <summary> | ||
58 | /// Clear the media entry for a given prim face. | ||
59 | /// </summary> | ||
60 | /// | ||
61 | /// This is the equivalent of setting a media entry of null | ||
62 | /// | ||
63 | /// <param name="part"></param> | ||
64 | /// <param name="face">/param> | ||
65 | void ClearMediaEntry(SceneObjectPart part, int face); | ||
56 | } | 66 | } |
57 | } \ No newline at end of file | 67 | } \ 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 f5089aa..8903c3b 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 | |||
8023 | return ScriptBaseClass.LSL_STATUS_OK; | 8023 | return ScriptBaseClass.LSL_STATUS_OK; |
8024 | } | 8024 | } |
8025 | 8025 | ||
8026 | public LSL_Integer llClearPrimMedia(LSL_Integer face) | ||
8027 | { | ||
8028 | m_host.AddScriptLPS(1); | ||
8029 | ScriptSleep(1000); | ||
8030 | |||
8031 | // LSL Spec http://wiki.secondlife.com/wiki/LlClearPrimMedia says to fail silently if face is invalid | ||
8032 | // Assuming silently fail means sending back LSL_STATUS_OK. Ideally, need to check this. | ||
8033 | // FIXME: Don't perform the media check directly | ||
8034 | if (face < 0 || face > m_host.GetNumberOfSides() - 1) | ||
8035 | return ScriptBaseClass.LSL_STATUS_OK; | ||
8036 | |||
8037 | IMoapModule module = m_ScriptEngine.World.RequestModuleInterface<IMoapModule>(); | ||
8038 | if (null == module) | ||
8039 | throw new Exception("Media on a prim functions not available"); | ||
8040 | |||
8041 | module.ClearMediaEntry(m_host, face); | ||
8042 | |||
8043 | return ScriptBaseClass.LSL_STATUS_OK; | ||
8044 | } | ||
8045 | |||
8026 | // <remarks> | 8046 | // <remarks> |
8027 | // <para> | 8047 | // <para> |
8028 | // The .NET definition of base 64 is: | 8048 | // The .NET definition of base 64 is: |