diff options
author | Justin Clark-Casey (justincc) | 2014-03-12 23:54:20 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2014-03-12 23:54:20 +0000 |
commit | 6a279feb2fdd9f85876b6533fed1020fdbffc20a (patch) | |
tree | 4b5afa819a8b7ee32a4e8db95eab9dce61082d0d /OpenSim/Region/ScriptEngine/Shared/Tests | |
parent | Implement osForceCreateLink() and osForceBreakLink() (diff) | |
download | opensim-SC-6a279feb2fdd9f85876b6533fed1020fdbffc20a.zip opensim-SC-6a279feb2fdd9f85876b6533fed1020fdbffc20a.tar.gz opensim-SC-6a279feb2fdd9f85876b6533fed1020fdbffc20a.tar.bz2 opensim-SC-6a279feb2fdd9f85876b6533fed1020fdbffc20a.tar.xz |
Only allow llBreakAllLinks() to work if script has received PERMISSION_CHANGE_LINKS
As per http://wiki.secondlife.com/wiki/LlBreakAllLinks
Same as existing llCreateLink() and llBreakLink()
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Tests')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiLinkingTests.cs | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiLinkingTests.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiLinkingTests.cs index ac9f93b..4c5a501 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiLinkingTests.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiLinkingTests.cs | |||
@@ -141,5 +141,47 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests | |||
141 | SceneObjectGroup grp2 = m_scene.GetSceneObjectGroup("grp1-Part1"); | 141 | SceneObjectGroup grp2 = m_scene.GetSceneObjectGroup("grp1-Part1"); |
142 | Assert.That(grp2, Is.Not.Null); | 142 | Assert.That(grp2, Is.Not.Null); |
143 | } | 143 | } |
144 | |||
145 | [Test] | ||
146 | public void TestllBreakAllLinks() | ||
147 | { | ||
148 | TestHelpers.InMethod(); | ||
149 | |||
150 | UUID ownerId = TestHelpers.ParseTail(0x1); | ||
151 | |||
152 | SceneObjectGroup grp1 = SceneHelpers.CreateSceneObject(3, ownerId, "grp1-", 0x10); | ||
153 | grp1.AbsolutePosition = new Vector3(10, 10, 10); | ||
154 | m_scene.AddSceneObject(grp1); | ||
155 | |||
156 | // FIXME: This should really be a script item (with accompanying script) | ||
157 | TaskInventoryItem grp1Item | ||
158 | = TaskInventoryHelpers.AddNotecard( | ||
159 | m_scene, grp1.RootPart, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900), "Hello World!"); | ||
160 | |||
161 | grp1Item.PermsMask |= ScriptBaseClass.PERMISSION_CHANGE_LINKS; | ||
162 | |||
163 | LSL_Api apiGrp1 = new LSL_Api(); | ||
164 | apiGrp1.Initialize(m_engine, grp1.RootPart, grp1Item, null); | ||
165 | |||
166 | apiGrp1.llBreakAllLinks(); | ||
167 | |||
168 | { | ||
169 | SceneObjectGroup nowGrp = m_scene.GetSceneObjectGroup("grp1-Part1"); | ||
170 | Assert.That(nowGrp, Is.Not.Null); | ||
171 | Assert.That(nowGrp.Parts.Length, Is.EqualTo(1)); | ||
172 | } | ||
173 | |||
174 | { | ||
175 | SceneObjectGroup nowGrp = m_scene.GetSceneObjectGroup("grp1-Part2"); | ||
176 | Assert.That(nowGrp, Is.Not.Null); | ||
177 | Assert.That(nowGrp.Parts.Length, Is.EqualTo(1)); | ||
178 | } | ||
179 | |||
180 | { | ||
181 | SceneObjectGroup nowGrp = m_scene.GetSceneObjectGroup("grp1-Part3"); | ||
182 | Assert.That(nowGrp, Is.Not.Null); | ||
183 | Assert.That(nowGrp.Parts.Length, Is.EqualTo(1)); | ||
184 | } | ||
185 | } | ||
144 | } | 186 | } |
145 | } \ No newline at end of file | 187 | } \ No newline at end of file |