aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Tests
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-08-11 22:26:47 +0100
committerJustin Clark-Casey (justincc)2011-08-11 22:26:47 +0100
commitb1ae930c6b8e7d985e2c148a4e18a59ac880dcbd (patch)
tree22bcbbd9275672651699420ee0b4f347ec2c8c8f /OpenSim/Region/ScriptEngine/Shared/Tests
parentadd regression test for osNpcCreate when cloning an in-region avatar (diff)
downloadopensim-SC_OLD-b1ae930c6b8e7d985e2c148a4e18a59ac880dcbd.zip
opensim-SC_OLD-b1ae930c6b8e7d985e2c148a4e18a59ac880dcbd.tar.gz
opensim-SC_OLD-b1ae930c6b8e7d985e2c148a4e18a59ac880dcbd.tar.bz2
opensim-SC_OLD-b1ae930c6b8e7d985e2c148a4e18a59ac880dcbd.tar.xz
Implement osAgentSaveAppearance() to save the appearance of an avatar in the region to a notecard
This is separate from osOwnerSaveAppearance() so that owner saves can be allowed without allowing arbitrary avatar saves
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Tests')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAppearanceTest.cs41
1 files changed, 41 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAppearanceTest.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAppearanceTest.cs
index 7f778d7..85cf507 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAppearanceTest.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAppearanceTest.cs
@@ -184,5 +184,46 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
184 184
185 Assert.That(savedAppearance.AvatarHeight, Is.EqualTo(sp.Appearance.AvatarHeight)); 185 Assert.That(savedAppearance.AvatarHeight, Is.EqualTo(sp.Appearance.AvatarHeight));
186 } 186 }
187
188 [Test]
189 public void TestOsAgentSaveAppearance()
190 {
191 TestHelpers.InMethod();
192// log4net.Config.XmlConfigurator.Configure();
193
194 UUID ownerId = TestHelpers.ParseTail(0x1);
195 UUID nonOwnerId = TestHelpers.ParseTail(0x2);
196 float newHeight = 1.9f;
197
198 ScenePresence sp = SceneHelpers.AddScenePresence(m_scene, nonOwnerId);
199 sp.Appearance.AvatarHeight = newHeight;
200 SceneObjectGroup so = SceneHelpers.CreateSceneObject(1, ownerId);
201 SceneObjectPart part = so.RootPart;
202 m_scene.AddSceneObject(so);
203
204 OSSL_Api osslApi = new OSSL_Api();
205 osslApi.Initialize(m_engine, part, part.LocalId, part.UUID);
206
207 string notecardName = "appearanceNc";
208
209 osslApi.osAgentSaveAppearance(new LSL_Types.LSLString(nonOwnerId.ToString()), notecardName);
210
211 IList<TaskInventoryItem> items = part.Inventory.GetInventoryItems(notecardName);
212 Assert.That(items.Count, Is.EqualTo(1));
213
214 TaskInventoryItem ncItem = items[0];
215 Assert.That(ncItem.Name, Is.EqualTo(notecardName));
216
217 AssetBase ncAsset = m_scene.AssetService.Get(ncItem.AssetID.ToString());
218 Assert.That(ncAsset, Is.Not.Null);
219
220 AssetNotecard anc = new AssetNotecard(UUID.Zero, ncAsset.Data);
221 anc.Decode();
222 OSDMap appearanceOsd = (OSDMap)OSDParser.DeserializeLLSDXml(anc.BodyText);
223 AvatarAppearance savedAppearance = new AvatarAppearance();
224 savedAppearance.Unpack(appearanceOsd);
225
226 Assert.That(savedAppearance.AvatarHeight, Is.EqualTo(sp.Appearance.AvatarHeight));
227 }
187 } 228 }
188} \ No newline at end of file 229} \ No newline at end of file