public void TestCreate() { TestHelpers.InMethod(); // log4net.Config.XmlConfigurator.Configure(); ScenePresence sp = SceneHelpers.AddScenePresence(m_scene, TestHelpers.ParseTail(0x1)); // ScenePresence originalAvatar = scene.GetScenePresence(originalClient.AgentId); // 8 is the index of the first baked texture in AvatarAppearance UUID originalFace8TextureId = TestHelpers.ParseTail(0x10); Primitive.TextureEntry originalTe = new Primitive.TextureEntry(UUID.Zero); Primitive.TextureEntryFace originalTef = originalTe.CreateFace(8); originalTef.TextureID = originalFace8TextureId; // We also need to add the texture to the asset service, otherwise the AvatarFactoryModule will tell // ScenePresence.SendInitialData() to reset our entire appearance. m_scene.AssetService.Store(AssetHelpers.CreateNotecardAsset(originalFace8TextureId)); m_afMod.SetAppearance(sp, originalTe, null); UUID npcId = m_npcMod.CreateNPC("John", "Smith", new Vector3(128, 128, 30), UUID.Zero, true, m_scene, sp.Appearance); ScenePresence npc = m_scene.GetScenePresence(npcId); Assert.That(npc, Is.Not.Null); Assert.That(npc.Appearance.Texture.FaceTextures[8].TextureID, Is.EqualTo(originalFace8TextureId)); Assert.That(m_umMod.GetUserName(npc.UUID), Is.EqualTo(string.Format("{0} {1}", npc.Firstname, npc.Lastname))); }
public void TestEnqueueMessageToNpc() { TestHelpers.InMethod(); // TestHelpers.EnableLogging(); UUID npcId = m_npcMod.CreateNPC( "John", "Smith", new Vector3(128, 128, 30), UUID.Zero, true, m_scene, new AvatarAppearance()); ScenePresence npc = m_scene.GetScenePresence(npcId); string messageName = "TestMessage"; m_eqgMod.Enqueue(m_eqgMod.BuildEvent(messageName, new OSDMap()), npc.UUID); Hashtable eventsResponse = m_eqgMod.GetEvents(UUID.Zero, npc.UUID); Assert.That((int)eventsResponse["int_response_code"], Is.EqualTo((int)HttpStatusCode.BadGateway)); }
private void createActor(UUID originalUuid, string firstName, string lastName, string appearanceNotecard) { if (actors.ContainsKey(originalUuid)) { return; } if (npc == null) { npc = (NPCModule)m_scene.RequestModuleInterface <INPCModule>(); } //read appearance out of notecard AvatarAppearance appearance = loadAvatarAppearance(appearanceNotecard); //create npc UUID uuid = npc.CreateNPC(firstName, lastName, Vector3.Zero, UUID.Zero, false, m_scene, appearance); ScenePresence presence; m_scene.TryGetScenePresence(uuid, out presence); actors[originalUuid] = presence; }