29 using System.Collections.Generic;
30 using System.Reflection;
32 using System.Threading;
37 using NUnit.Framework;
39 using OpenSim.Framework;
40 using OpenSim.Framework.Servers;
41 using OpenSim.Framework.Servers.HttpServer;
42 using OpenSim.Region.CoreModules.Avatar.Attachments;
43 using OpenSim.Region.CoreModules.Framework;
44 using OpenSim.Region.CoreModules.Framework.EntityTransfer;
45 using OpenSim.Region.CoreModules.Framework.InventoryAccess;
46 using OpenSim.Region.CoreModules.Scripting.WorldComm;
47 using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation;
48 using OpenSim.Region.CoreModules.World.Serialiser;
49 using OpenSim.Region.Framework.Scenes;
50 using OpenSim.Region.Framework.Interfaces;
51 using OpenSim.Region.ScriptEngine.Interfaces;
52 using OpenSim.Region.ScriptEngine.XEngine;
53 using OpenSim.Services.Interfaces;
54 using OpenSim.Tests.Common;
64 private AutoResetEvent m_chatEvent =
new AutoResetEvent(
false);
68 private int m_numberOfAttachEventsFired;
74 Util.FireAndForgetMethod = FireAndForgetMethod.None;
82 Util.FireAndForgetMethod = Util.DefaultFireAndForgetMethod;
85 private void OnChatFromWorld(
object sender,
OSChatMessage oscm)
93 private Scene CreateTestScene()
95 IConfigSource config =
new IniConfigSource();
96 List<object> modules =
new List<object>();
98 AddCommonConfig(config, modules);
102 "attachments-test-scene", TestHelpers.ParseTail(999), 1000, 1000, config);
103 SceneHelpers.SetupSceneModules(scene, config, modules.ToArray());
105 scene.EventManager.OnAttach += (localID, itemID, avatarID) => m_numberOfAttachEventsFired++;
110 private Scene CreateScriptingEnabledTestScene()
112 IConfigSource config =
new IniConfigSource();
113 List<object> modules =
new List<object>();
115 AddCommonConfig(config, modules);
116 AddScriptingConfig(config, modules);
120 "attachments-test-scene", TestHelpers.ParseTail(999), 1000, 1000, config);
121 SceneHelpers.SetupSceneModules(scene, config, modules.ToArray());
123 scene.StartScripts();
128 private void AddCommonConfig(IConfigSource config, List<object> modules)
130 config.AddConfig(
"Modules");
131 config.Configs[
"Modules"].Set(
"InventoryAccessModule",
"BasicInventoryAccessModule");
134 attMod.DebugLevel = 1;
139 private void AddScriptingConfig(IConfigSource config, List<object> modules)
141 IConfig startupConfig = config.AddConfig(
"Startup");
142 startupConfig.Set(
"DefaultScriptEngine",
"XEngine");
144 IConfig xEngineConfig = config.AddConfig(
"XEngine");
145 xEngineConfig.Set(
"Enabled",
"true");
146 xEngineConfig.Set(
"StartDelay",
"0");
150 xEngineConfig.Set(
"AppDomainLoading",
"false");
174 Scene scene, UUID userId,
string attName,
int rawItemId,
int rawAssetId)
176 return UserInventoryHelpers.CreateInventoryItem(
179 TestHelpers.ParseTail(rawItemId),
182 InventoryType.Object);
188 TestHelpers.InMethod();
191 m_numberOfAttachEventsFired = 0;
193 Scene scene = CreateTestScene();
194 UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene, 0x1);
195 ScenePresence sp = SceneHelpers.AddScenePresence(scene, ua1);
197 string attName =
"att";
200 Assert.That(so.Backup, Is.True);
202 m_numberOfAttachEventsFired = 0;
203 scene.AttachmentsModule.AttachObject(sp, so, (uint)
AttachmentPoint.Chest,
false,
true,
false);
206 Assert.That(sp.HasAttachments(), Is.True);
207 List<SceneObjectGroup> attachments = sp.GetAttachments();
208 Assert.That(attachments.Count, Is.EqualTo(1));
210 Assert.That(attSo.Name, Is.EqualTo(attName));
211 Assert.That(attSo.AttachmentPoint, Is.EqualTo((byte)
AttachmentPoint.Chest));
212 Assert.That(attSo.IsAttachment);
213 Assert.That(attSo.UsesPhysics, Is.False);
214 Assert.That(attSo.IsTemporary, Is.False);
215 Assert.That(attSo.Backup, Is.False);
223 Assert.That(attachmentItem, Is.Not.Null);
224 Assert.That(attachmentItem.Name, Is.EqualTo(attName));
226 InventoryFolderBase targetFolder = scene.InventoryService.GetFolderForType(sp.UUID, FolderType.Object);
227 Assert.That(attachmentItem.Folder, Is.EqualTo(targetFolder.ID));
229 Assert.That(scene.GetSceneObjectGroups().Count, Is.EqualTo(1));
232 Assert.That(m_numberOfAttachEventsFired, Is.EqualTo(1));
238 TestHelpers.InMethod();
241 Scene scene = CreateTestScene();
242 UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene, 0x1);
243 ScenePresence sp = SceneHelpers.AddScenePresence(scene, ua1);
250 m_numberOfAttachEventsFired = 0;
251 scene.AttachmentsModule.AttachObject(sp, so, (uint)
AttachmentPoint.Default,
false,
true,
false);
254 Assert.That(sp.HasAttachments(), Is.True);
255 List<SceneObjectGroup> attachments = sp.GetAttachments();
256 Assert.That(attachments.Count, Is.EqualTo(1));
258 Assert.That(attSo.Name, Is.EqualTo(so.Name));
259 Assert.That(attSo.AttachmentPoint, Is.EqualTo((byte)
AttachmentPoint.LeftHand));
260 Assert.That(attSo.IsAttachment);
261 Assert.That(attSo.UsesPhysics, Is.False);
262 Assert.That(attSo.IsTemporary, Is.False);
270 Assert.That(attachmentItem, Is.Not.Null);
271 Assert.That(attachmentItem.Name, Is.EqualTo(so.Name));
273 InventoryFolderBase targetFolder = scene.InventoryService.GetFolderForType(sp.UUID, FolderType.Object);
274 Assert.That(attachmentItem.Folder, Is.EqualTo(targetFolder.ID));
276 Assert.That(scene.GetSceneObjectGroups().Count, Is.EqualTo(2));
279 Assert.That(m_numberOfAttachEventsFired, Is.EqualTo(1));
284 scene.AttachmentsModule.AttachObject(sp, so2, (uint)
AttachmentPoint.Default,
false,
true,
false);
287 Assert.That(sp.HasAttachments(), Is.True);
288 List<SceneObjectGroup> attachments = sp.GetAttachments();
289 Assert.That(attachments.Count, Is.EqualTo(1));
291 Assert.That(attSo.Name, Is.EqualTo(so2.Name));
292 Assert.That(attSo.AttachmentPoint, Is.EqualTo((byte)
AttachmentPoint.LeftHand));
293 Assert.That(attSo.IsAttachment);
294 Assert.That(attSo.UsesPhysics, Is.False);
295 Assert.That(attSo.IsTemporary, Is.False);
303 Assert.That(attachmentItem, Is.Not.Null);
304 Assert.That(attachmentItem.Name, Is.EqualTo(so2.Name));
306 InventoryFolderBase targetFolder = scene.InventoryService.GetFolderForType(sp.UUID, FolderType.Object);
307 Assert.That(attachmentItem.Folder, Is.EqualTo(targetFolder.ID));
309 Assert.That(scene.GetSceneObjectGroups().Count, Is.EqualTo(1));
312 Assert.That(m_numberOfAttachEventsFired, Is.EqualTo(3));
317 scene.AttachmentsModule.AttachObject(sp, so2, (uint)
AttachmentPoint.Default,
false,
true,
false);
320 Assert.That(sp.HasAttachments(), Is.True);
321 List<SceneObjectGroup> attachments = sp.GetAttachments();
322 Assert.That(attachments.Count, Is.EqualTo(1));
324 Assert.That(attSo.Name, Is.EqualTo(so2.Name));
325 Assert.That(attSo.AttachmentPoint, Is.EqualTo((byte)
AttachmentPoint.LeftHand));
326 Assert.That(attSo.IsAttachment);
327 Assert.That(attSo.UsesPhysics, Is.False);
328 Assert.That(attSo.IsTemporary, Is.False);
336 Assert.That(attachmentItem, Is.Not.Null);
337 Assert.That(attachmentItem.Name, Is.EqualTo(so2.Name));
339 InventoryFolderBase targetFolder = scene.InventoryService.GetFolderForType(sp.UUID, FolderType.Object);
340 Assert.That(attachmentItem.Folder, Is.EqualTo(targetFolder.ID));
342 Assert.That(scene.GetSceneObjectGroups().Count, Is.EqualTo(1));
345 Assert.That(m_numberOfAttachEventsFired, Is.EqualTo(3));
355 TestHelpers.InMethod();
358 m_numberOfAttachEventsFired = 0;
360 Scene scene = CreateTestScene();
361 UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene, 0x1);
362 ScenePresence sp = SceneHelpers.AddScenePresence(scene, ua1);
364 string attName =
"att";
368 UserAccount ua2 = UserAccountHelpers.CreateUserWithInventory(scene, 0x2);
369 ScenePresence sp2 = SceneHelpers.AddScenePresence(scene, ua2);
372 sp2.AbsolutePosition =
new Vector3(0, 0, 0);
373 sp2.HandleAgentRequestSit(sp2.ControllingClient, sp2.UUID, so.UUID, Vector3.Zero);
375 scene.AttachmentsModule.AttachObject(sp, so, (uint)
AttachmentPoint.Chest,
false,
true,
false);
377 Assert.That(sp.HasAttachments(), Is.False);
378 Assert.That(scene.GetSceneObjectGroups().Count, Is.EqualTo(1));
381 Assert.That(m_numberOfAttachEventsFired, Is.EqualTo(0));
387 TestHelpers.InMethod();
390 Scene scene = CreateTestScene();
391 UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene, 0x1);
392 ScenePresence sp = SceneHelpers.AddScenePresence(scene, ua1.PrincipalID);
397 scene.AttachmentsModule.RezSingleAttachmentFromInventory(
401 Assert.That(sp.HasAttachments(), Is.True);
402 List<SceneObjectGroup> attachments = sp.GetAttachments();
403 Assert.That(attachments.Count, Is.EqualTo(1));
405 Assert.That(attSo.Name, Is.EqualTo(attItem.Name));
406 Assert.That(attSo.AttachmentPoint, Is.EqualTo((byte)
AttachmentPoint.Chest));
407 Assert.That(attSo.IsAttachment);
408 Assert.That(attSo.UsesPhysics, Is.False);
409 Assert.That(attSo.IsTemporary, Is.False);
410 Assert.IsFalse(attSo.Backup);
415 Assert.That(scene.GetSceneObjectGroups().Count, Is.EqualTo(1));
418 Assert.That(m_numberOfAttachEventsFired, Is.EqualTo(1));
423 scene.AttachmentsModule.RezSingleAttachmentFromInventory(
427 Assert.That(sp.HasAttachments(), Is.True);
428 List<SceneObjectGroup> attachments = sp.GetAttachments();
429 Assert.That(attachments.Count, Is.EqualTo(1));
431 Assert.That(attSo.Name, Is.EqualTo(attItem.Name));
432 Assert.That(attSo.AttachmentPoint, Is.EqualTo((byte)
AttachmentPoint.Chest));
433 Assert.That(attSo.IsAttachment);
434 Assert.That(attSo.UsesPhysics, Is.False);
435 Assert.That(attSo.IsTemporary, Is.False);
440 Assert.That(scene.GetSceneObjectGroups().Count, Is.EqualTo(1));
443 Assert.That(m_numberOfAttachEventsFired, Is.EqualTo(1));
453 TestHelpers.InMethod();
456 Scene scene = CreateTestScene();
457 UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene, 0x1);
458 ScenePresence sp = SceneHelpers.AddScenePresence(scene, ua1.PrincipalID);
464 m_numberOfAttachEventsFired = 0;
465 scene.AttachmentsModule.RezSingleAttachmentFromInventory(sp, attItem1.ID, (uint)
AttachmentPoint.Default);
468 Assert.That(sp.HasAttachments(), Is.True);
469 List<SceneObjectGroup> attachments = sp.GetAttachments();
470 Assert.That(attachments.Count, Is.EqualTo(1));
472 Assert.That(attSo.Name, Is.EqualTo(attItem1.Name));
473 Assert.That(attSo.AttachmentPoint, Is.EqualTo((byte)
AttachmentPoint.LeftHand));
474 Assert.That(attSo.IsAttachment);
479 Assert.That(scene.GetSceneObjectGroups().Count, Is.EqualTo(1));
482 Assert.That(m_numberOfAttachEventsFired, Is.EqualTo(1));
490 scene.AttachmentsModule.RezSingleAttachmentFromInventory(sp, attItem2.ID, (uint)
AttachmentPoint.Default);
493 Assert.That(sp.HasAttachments(), Is.True);
494 List<SceneObjectGroup> attachments = sp.GetAttachments();
495 Assert.That(attachments.Count, Is.EqualTo(1));
497 Assert.That(attSo.Name, Is.EqualTo(attItem2.Name));
498 Assert.That(attSo.AttachmentPoint, Is.EqualTo((byte)
AttachmentPoint.LeftHand));
499 Assert.That(attSo.IsAttachment);
504 Assert.That(scene.GetSceneObjectGroups().Count, Is.EqualTo(1));
507 Assert.That(m_numberOfAttachEventsFired, Is.EqualTo(3));
512 scene.AttachmentsModule.RezSingleAttachmentFromInventory(sp, attItem2.ID, (uint)
AttachmentPoint.Default);
515 Assert.That(sp.HasAttachments(), Is.True);
516 List<SceneObjectGroup> attachments = sp.GetAttachments();
517 Assert.That(attachments.Count, Is.EqualTo(1));
519 Assert.That(attSo.Name, Is.EqualTo(attItem2.Name));
520 Assert.That(attSo.AttachmentPoint, Is.EqualTo((byte)
AttachmentPoint.LeftHand));
521 Assert.That(attSo.IsAttachment);
526 Assert.That(scene.GetSceneObjectGroups().Count, Is.EqualTo(1));
529 Assert.That(m_numberOfAttachEventsFired, Is.EqualTo(3));
539 TestHelpers.InMethod();
541 Scene scene = CreateScriptingEnabledTestScene();
542 UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene, 0x1);
543 ScenePresence sp = SceneHelpers.AddScenePresence(scene, ua1);
545 SceneObjectGroup so = SceneHelpers.CreateSceneObject(1, sp.UUID,
"att-name", 0x10);
547 = TaskInventoryHelpers.AddScript(
551 "default { attach(key id) { if (id != NULL_KEY) { llSay(0, \"Hello World\"); } } }");
553 InventoryItemBase userItem = UserInventoryHelpers.AddInventoryItem(scene, so, 0x100, 0x1000);
557 scene.EventManager.OnChatFromWorld += OnChatFromWorld;
560 scene.AttachmentsModule.RezSingleAttachmentFromInventory(sp, userItem.ID, (uint)
AttachmentPoint.Chest);
562 m_chatEvent.WaitOne(60000);
568 Assert.That(attSo.ContainsScripts(), Is.True);
570 TaskInventoryItem reRezzedScriptItem = attSo.RootPart.Inventory.GetInventoryItem(scriptItem.Name);
572 Assert.That(xengine.GetScriptState(reRezzedScriptItem.ItemID), Is.True);
578 TestHelpers.InMethod();
581 Scene scene = CreateTestScene();
582 UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene, 0x1);
583 ScenePresence sp = SceneHelpers.AddScenePresence(scene, ua1.PrincipalID);
588 = scene.AttachmentsModule.RezSingleAttachmentFromInventory(
591 m_numberOfAttachEventsFired = 0;
592 scene.AttachmentsModule.DetachSingleAttachmentToGround(sp, so.LocalId);
595 Assert.That(sp.HasAttachments(), Is.False);
596 List<SceneObjectGroup> attachments = sp.GetAttachments();
597 Assert.That(attachments.Count, Is.EqualTo(0));
603 Assert.That(scene.InventoryService.GetItem(
new InventoryItemBase(attItem.ID)), Is.Null);
607 Assert.That(soInScene, Is.Not.Null);
608 Assert.IsTrue(soInScene.Backup);
611 Assert.That(m_numberOfAttachEventsFired, Is.EqualTo(1));
617 TestHelpers.InMethod();
619 Scene scene = CreateTestScene();
620 UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene, 0x1);
621 ScenePresence sp = SceneHelpers.AddScenePresence(scene, ua1.PrincipalID);
626 = (
SceneObjectGroup)scene.AttachmentsModule.RezSingleAttachmentFromInventory(
629 m_numberOfAttachEventsFired = 0;
630 scene.AttachmentsModule.DetachSingleAttachmentToInv(sp, so);
633 Assert.That(sp.HasAttachments(), Is.False);
634 List<SceneObjectGroup> attachments = sp.GetAttachments();
635 Assert.That(attachments.Count, Is.EqualTo(0));
640 Assert.That(scene.GetSceneObjectGroups().Count, Is.EqualTo(0));
643 Assert.That(m_numberOfAttachEventsFired, Is.EqualTo(1));
652 TestHelpers.InMethod();
655 Scene scene = CreateScriptingEnabledTestScene();
656 UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene, 0x1);
657 ScenePresence sp = SceneHelpers.AddScenePresence(scene, ua1);
659 SceneObjectGroup so = SceneHelpers.CreateSceneObject(1, sp.UUID,
"att-name", 0x10);
661 = TaskInventoryHelpers.AddScript(
665 "default { attach(key id) { if (id != NULL_KEY) { llSay(0, \"Hello World\"); } } }");
667 InventoryItemBase userItem = UserInventoryHelpers.AddInventoryItem(scene, so, 0x100, 0x1000);
671 scene.EventManager.OnChatFromWorld += OnChatFromWorld;
678 m_chatEvent.WaitOne(60000);
680 scene.AttachmentsModule.DetachSingleAttachmentToInv(sp, rezzedSo);
683 AssetBase asset = scene.AssetService.Get(userItemUpdated.AssetID.ToString());
687 XmlDocument soXml =
new XmlDocument();
688 soXml.LoadXml(Encoding.UTF8.GetString(asset.Data));
690 XmlNodeList scriptStateNodes = soXml.GetElementsByTagName(
"ScriptState");
691 Assert.That(scriptStateNodes.Count, Is.EqualTo(1));
697 m_chatEvent.WaitOne(60000);
699 TaskInventoryItem reRezzedScriptItem = reRezzedSo.RootPart.Inventory.GetInventoryItem(scriptTaskItem.Name);
701 Assert.That(xengine.GetScriptState(reRezzedScriptItem.ItemID), Is.True);
712 TestHelpers.InMethod();
715 Scene scene = CreateTestScene();
716 UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene, 0x1);
721 acd.Appearance.SetAttachment((int)
AttachmentPoint.Chest, attItem.ID, attItem.AssetID);
722 ScenePresence presence = SceneHelpers.AddScenePresence(scene, acd);
724 UUID rezzedAttID = presence.GetAttachments()[0].
UUID;
726 m_numberOfAttachEventsFired = 0;
727 scene.CloseAgent(presence.UUID,
false);
730 Assert.That(scene.GetSceneObjectGroup(rezzedAttID), Is.Null);
733 Assert.That(m_numberOfAttachEventsFired, Is.EqualTo(0));
739 TestHelpers.InMethod();
742 Scene scene = CreateTestScene();
743 UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene, 0x1);
748 acd.Appearance.SetAttachment((int)
AttachmentPoint.Chest, attItem.ID, attItem.AssetID);
750 m_numberOfAttachEventsFired = 0;
751 ScenePresence presence = SceneHelpers.AddScenePresence(scene, acd);
753 Assert.That(presence.HasAttachments(), Is.True);
754 List<SceneObjectGroup> attachments = presence.GetAttachments();
756 Assert.That(attachments.Count, Is.EqualTo(1));
758 Assert.That(attSo.Name, Is.EqualTo(attItem.Name));
759 Assert.That(attSo.AttachmentPoint, Is.EqualTo((byte)
AttachmentPoint.Chest));
760 Assert.That(attSo.IsAttachment);
761 Assert.That(attSo.UsesPhysics, Is.False);
762 Assert.That(attSo.IsTemporary, Is.False);
763 Assert.IsFalse(attSo.Backup);
766 List<AvatarAttachment> retreivedAttachments = presence.Appearance.GetAttachments();
767 Assert.That(retreivedAttachments.Count, Is.EqualTo(1));
768 Assert.That(retreivedAttachments[0].AttachPoint, Is.EqualTo((int)
AttachmentPoint.Chest));
769 Assert.That(retreivedAttachments[0].ItemID, Is.EqualTo(attItem.ID));
770 Assert.That(retreivedAttachments[0].AssetID, Is.EqualTo(attItem.AssetID));
771 Assert.That(presence.Appearance.GetAttachpoint(attItem.ID), Is.EqualTo((
int)
AttachmentPoint.Chest));
773 Assert.That(scene.GetSceneObjectGroups().Count, Is.EqualTo(1));
776 Assert.That(m_numberOfAttachEventsFired, Is.EqualTo(1));
782 TestHelpers.InMethod();
784 Scene scene = CreateTestScene();
785 UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene, 0x1);
790 acd.Appearance.SetAttachment((int)
AttachmentPoint.Chest, attItem.ID, attItem.AssetID);
791 ScenePresence sp = SceneHelpers.AddScenePresence(scene, acd);
795 Vector3 newPosition =
new Vector3(1, 2, 4);
797 m_numberOfAttachEventsFired = 0;
798 scene.SceneGraph.UpdatePrimGroupPosition(attSo.LocalId, newPosition, sp.ControllingClient);
800 Assert.That(attSo.AbsolutePosition, Is.EqualTo(sp.AbsolutePosition));
801 Assert.That(attSo.RootPart.AttachedPos, Is.EqualTo(newPosition));
804 Assert.That(m_numberOfAttachEventsFired, Is.EqualTo(0));
920 TestHelpers.InMethod();
933 IConfigSource config =
new IniConfigSource();
934 IConfig modulesConfig = config.AddConfig(
"Modules");
935 modulesConfig.Set(
"EntityTransferModule", etmA.Name);
936 modulesConfig.Set(
"SimulationServices", lscm.Name);
938 modulesConfig.Set(
"InventoryAccessModule",
"BasicInventoryAccessModule");
941 TestScene sceneA = sh.SetupScene(
"sceneA", TestHelpers.ParseTail(0x100), 1000, 1000);
942 TestScene sceneB = sh.SetupScene(
"sceneB", TestHelpers.ParseTail(0x200), 1001, 1000);
944 SceneHelpers.SetupSceneModules(
new Scene[] { sceneA, sceneB }, config, lscm);
945 SceneHelpers.SetupSceneModules(
947 SceneHelpers.SetupSceneModules(
950 UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(sceneA, 0x1);
954 List<TestClient> destinationTestClients =
new List<TestClient>();
955 EntityTransferHelpers.SetupInformClientOfNeighbourTriggersNeighbourClientCreate(tc, destinationTestClients);
957 ScenePresence beforeTeleportSp = SceneHelpers.AddScenePresence(sceneA, tc, acd);
958 beforeTeleportSp.AbsolutePosition =
new Vector3(30, 31, 32);
960 Assert.That(destinationTestClients.Count, Is.EqualTo(1));
961 Assert.That(destinationTestClients[0], Is.Not.Null);
963 InventoryItemBase attItem = CreateAttachmentItem(sceneA, ua1.PrincipalID,
"att", 0x10, 0x20);
965 sceneA.AttachmentsModule.RezSingleAttachmentFromInventory(
968 Vector3 teleportPosition =
new Vector3(10, 11, 12);
969 Vector3 teleportLookAt =
new Vector3(20, 21, 22);
977 tc.OnTestClientSendRegionTeleport
978 += (regionHandle, simAccess, regionExternalEndPoint, locationID, flags, capsURL)
979 => ThreadPool.UnsafeQueueUserWorkItem(o => destinationTestClients[0].CompleteMovement(), null);
981 m_numberOfAttachEventsFired = 0;
982 sceneA.RequestTeleportLocation(
983 beforeTeleportSp.ControllingClient,
984 sceneB.RegionInfo.RegionHandle,
990 ScenePresence afterTeleportSceneBSp = sceneB.GetScenePresence(ua1.PrincipalID);
993 List<AvatarAttachment> sceneBAttachments = afterTeleportSceneBSp.Appearance.GetAttachments();
994 Assert.That(sceneBAttachments.Count, Is.EqualTo(1));
995 Assert.That(sceneBAttachments[0].AttachPoint, Is.EqualTo((int)
AttachmentPoint.Chest));
996 Assert.That(sceneBAttachments[0].ItemID, Is.EqualTo(attItem.ID));
997 Assert.That(sceneBAttachments[0].AssetID, Is.EqualTo(attItem.AssetID));
998 Assert.That(afterTeleportSceneBSp.Appearance.GetAttachpoint(attItem.ID), Is.EqualTo((
int)
AttachmentPoint.Chest));
1001 List<SceneObjectGroup> actualSceneBAttachments = afterTeleportSceneBSp.GetAttachments();
1002 Assert.That(actualSceneBAttachments.Count, Is.EqualTo(1));
1004 Assert.That(actualSceneBAtt.Name, Is.EqualTo(attItem.Name));
1005 Assert.That(actualSceneBAtt.AttachmentPoint, Is.EqualTo((uint)
AttachmentPoint.Chest));
1006 Assert.IsFalse(actualSceneBAtt.Backup);
1008 Assert.That(sceneB.GetSceneObjectGroups().Count, Is.EqualTo(1));
1011 ScenePresence afterTeleportSceneASp = sceneA.GetScenePresence(ua1.PrincipalID);
1014 List<AvatarAttachment> sceneAAttachments = afterTeleportSceneASp.Appearance.GetAttachments();
1015 Assert.That(sceneAAttachments.Count, Is.EqualTo(1));
1016 Assert.That(afterTeleportSceneASp.Appearance.GetAttachpoint(attItem.ID), Is.EqualTo((
int)
AttachmentPoint.Chest));
1019 List<SceneObjectGroup> actualSceneAAttachments = afterTeleportSceneASp.GetAttachments();
1020 Assert.That(actualSceneAAttachments.Count, Is.EqualTo(0));
1022 Assert.That(sceneA.GetSceneObjectGroups().Count, Is.EqualTo(0));
1025 Assert.That(m_numberOfAttachEventsFired, Is.EqualTo(0));
UUID FromItemID
The item ID that this object was rezzed from, if applicable.
void TestRezAttachmentFromInventory()
OpenSim.Framework.Constants.TeleportFlags TeleportFlags
void TestDetachScriptedAttachmentToInventory()
Test specific conditions associated with detaching a scripted attachment from inventory.
void TestWearAttachmentFromInventory()
Test wearing an attachment from inventory, as opposed to explicit choosing the rez point ...
Contains the Avatar's Appearance and methods to manipulate the appearance.
A scene object group is conceptually an object in the scene. The object is constituted of SceneObject...
Represents an item in a task inventory
void TestDetachAttachmentToInventory()
void TestSameSimulatorNeighbouringRegionsTeleportV2()
System.Timers.Timer Timer
void TestAddSatOnAttachmentFromGround()
Test that we do not attempt to attach an in-world object that someone else is sitting on...
System.Timers.Timer Timer
Asset class. All Assets are reference by this class or a class derived from this class ...
static UUID ParseTail(int tail)
Parse tail section into full UUID.
void TestWearAttachmentFromGround()
Circuit data for an agent. Connection information shared between regions that accept UDP connections ...
void TestRezScriptedAttachmentFromInventory()
Test specific conditions associated with rezzing a scripted attachment from inventory.
Inventory Item - contains all the properties associated with an individual inventory piece...
void TestDetachAttachmentToGround()
Helpers for setting up scenes.
void TestRemoveAttachmentsOnAvatarExit()
Test that attachments don't hang about in the scene when the agent is closed
Interactive OpenSim region server
void TestAddAttachmentFromGround()
void TestRezAttachmentsOnAvatarEntrance()
void TestUpdateAttachmentPosition()