diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAppearanceTest.cs | 70 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiNpcTests.cs | 69 |
2 files changed, 69 insertions, 70 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAppearanceTest.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAppearanceTest.cs index c8718d9..c401794 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAppearanceTest.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAppearanceTest.cs | |||
@@ -75,76 +75,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests | |||
75 | m_engine.AddRegion(m_scene); | 75 | m_engine.AddRegion(m_scene); |
76 | } | 76 | } |
77 | 77 | ||
78 | /// <summary> | ||
79 | /// Test creation of an NPC where the appearance data comes from a notecard | ||
80 | /// </summary> | ||
81 | [Test] | ||
82 | public void TestOsNpcCreateUsingAppearanceFromNotecard() | ||
83 | { | ||
84 | TestHelpers.InMethod(); | ||
85 | // log4net.Config.XmlConfigurator.Configure(); | ||
86 | |||
87 | // Store an avatar with a different height from default in a notecard. | ||
88 | UUID userId = TestHelpers.ParseTail(0x1); | ||
89 | float newHeight = 1.9f; | ||
90 | |||
91 | ScenePresence sp = SceneHelpers.AddScenePresence(m_scene, userId); | ||
92 | sp.Appearance.AvatarHeight = newHeight; | ||
93 | SceneObjectGroup so = SceneHelpers.CreateSceneObject(1, userId, 0x10); | ||
94 | SceneObjectPart part = so.RootPart; | ||
95 | m_scene.AddSceneObject(so); | ||
96 | |||
97 | OSSL_Api osslApi = new OSSL_Api(); | ||
98 | osslApi.Initialize(m_engine, part, null); | ||
99 | |||
100 | string notecardName = "appearanceNc"; | ||
101 | osslApi.osOwnerSaveAppearance(notecardName); | ||
102 | |||
103 | // Try creating a bot using the appearance in the notecard. | ||
104 | string npcRaw = osslApi.osNpcCreate("Jane", "Doe", new LSL_Types.Vector3(128, 128, 128), notecardName); | ||
105 | Assert.That(npcRaw, Is.Not.Null); | ||
106 | |||
107 | UUID npcId = new UUID(npcRaw); | ||
108 | ScenePresence npc = m_scene.GetScenePresence(npcId); | ||
109 | Assert.That(npc, Is.Not.Null); | ||
110 | Assert.That(npc.Appearance.AvatarHeight, Is.EqualTo(newHeight)); | ||
111 | } | ||
112 | |||
113 | /// <summary> | ||
114 | /// Test creation of an NPC where the appearance data comes from an avatar already in the region. | ||
115 | /// </summary> | ||
116 | [Test] | ||
117 | public void TestOsNpcCreateUsingAppearanceFromAvatar() | ||
118 | { | ||
119 | TestHelpers.InMethod(); | ||
120 | // TestHelpers.EnableLogging(); | ||
121 | |||
122 | // Store an avatar with a different height from default in a notecard. | ||
123 | UUID userId = TestHelpers.ParseTail(0x1); | ||
124 | float newHeight = 1.9f; | ||
125 | |||
126 | ScenePresence sp = SceneHelpers.AddScenePresence(m_scene, userId); | ||
127 | sp.Appearance.AvatarHeight = newHeight; | ||
128 | SceneObjectGroup so = SceneHelpers.CreateSceneObject(1, userId, 0x10); | ||
129 | SceneObjectPart part = so.RootPart; | ||
130 | m_scene.AddSceneObject(so); | ||
131 | |||
132 | OSSL_Api osslApi = new OSSL_Api(); | ||
133 | osslApi.Initialize(m_engine, part, null); | ||
134 | |||
135 | string notecardName = "appearanceNc"; | ||
136 | osslApi.osOwnerSaveAppearance(notecardName); | ||
137 | |||
138 | // Try creating a bot using the existing avatar's appearance | ||
139 | string npcRaw = osslApi.osNpcCreate("Jane", "Doe", new LSL_Types.Vector3(128, 128, 128), sp.UUID.ToString()); | ||
140 | Assert.That(npcRaw, Is.Not.Null); | ||
141 | |||
142 | UUID npcId = new UUID(npcRaw); | ||
143 | ScenePresence npc = m_scene.GetScenePresence(npcId); | ||
144 | Assert.That(npc, Is.Not.Null); | ||
145 | Assert.That(npc.Appearance.AvatarHeight, Is.EqualTo(newHeight)); | ||
146 | } | ||
147 | |||
148 | [Test] | 78 | [Test] |
149 | public void TestOsOwnerSaveAppearance() | 79 | public void TestOsOwnerSaveAppearance() |
150 | { | 80 | { |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiNpcTests.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiNpcTests.cs index 25679a6..b5a4d93 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiNpcTests.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiNpcTests.cs | |||
@@ -79,6 +79,75 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests | |||
79 | } | 79 | } |
80 | 80 | ||
81 | /// <summary> | 81 | /// <summary> |
82 | /// Test creation of an NPC where the appearance data comes from a notecard | ||
83 | /// </summary> | ||
84 | [Test] | ||
85 | public void TestOsNpcCreateUsingAppearanceFromNotecard() | ||
86 | { | ||
87 | TestHelpers.InMethod(); | ||
88 | |||
89 | // Store an avatar with a different height from default in a notecard. | ||
90 | UUID userId = TestHelpers.ParseTail(0x1); | ||
91 | float newHeight = 1.9f; | ||
92 | |||
93 | ScenePresence sp = SceneHelpers.AddScenePresence(m_scene, userId); | ||
94 | sp.Appearance.AvatarHeight = newHeight; | ||
95 | SceneObjectGroup so = SceneHelpers.CreateSceneObject(1, userId, 0x10); | ||
96 | SceneObjectPart part = so.RootPart; | ||
97 | m_scene.AddSceneObject(so); | ||
98 | |||
99 | OSSL_Api osslApi = new OSSL_Api(); | ||
100 | osslApi.Initialize(m_engine, part, null); | ||
101 | |||
102 | string notecardName = "appearanceNc"; | ||
103 | osslApi.osOwnerSaveAppearance(notecardName); | ||
104 | |||
105 | // Try creating a bot using the appearance in the notecard. | ||
106 | string npcRaw = osslApi.osNpcCreate("Jane", "Doe", new LSL_Types.Vector3(128, 128, 128), notecardName); | ||
107 | Assert.That(npcRaw, Is.Not.Null); | ||
108 | |||
109 | UUID npcId = new UUID(npcRaw); | ||
110 | ScenePresence npc = m_scene.GetScenePresence(npcId); | ||
111 | Assert.That(npc, Is.Not.Null); | ||
112 | Assert.That(npc.Appearance.AvatarHeight, Is.EqualTo(newHeight)); | ||
113 | } | ||
114 | |||
115 | /// <summary> | ||
116 | /// Test creation of an NPC where the appearance data comes from an avatar already in the region. | ||
117 | /// </summary> | ||
118 | [Test] | ||
119 | public void TestOsNpcCreateUsingAppearanceFromAvatar() | ||
120 | { | ||
121 | TestHelpers.InMethod(); | ||
122 | // TestHelpers.EnableLogging(); | ||
123 | |||
124 | // Store an avatar with a different height from default in a notecard. | ||
125 | UUID userId = TestHelpers.ParseTail(0x1); | ||
126 | float newHeight = 1.9f; | ||
127 | |||
128 | ScenePresence sp = SceneHelpers.AddScenePresence(m_scene, userId); | ||
129 | sp.Appearance.AvatarHeight = newHeight; | ||
130 | SceneObjectGroup so = SceneHelpers.CreateSceneObject(1, userId, 0x10); | ||
131 | SceneObjectPart part = so.RootPart; | ||
132 | m_scene.AddSceneObject(so); | ||
133 | |||
134 | OSSL_Api osslApi = new OSSL_Api(); | ||
135 | osslApi.Initialize(m_engine, part, null); | ||
136 | |||
137 | string notecardName = "appearanceNc"; | ||
138 | osslApi.osOwnerSaveAppearance(notecardName); | ||
139 | |||
140 | // Try creating a bot using the existing avatar's appearance | ||
141 | string npcRaw = osslApi.osNpcCreate("Jane", "Doe", new LSL_Types.Vector3(128, 128, 128), sp.UUID.ToString()); | ||
142 | Assert.That(npcRaw, Is.Not.Null); | ||
143 | |||
144 | UUID npcId = new UUID(npcRaw); | ||
145 | ScenePresence npc = m_scene.GetScenePresence(npcId); | ||
146 | Assert.That(npc, Is.Not.Null); | ||
147 | Assert.That(npc.Appearance.AvatarHeight, Is.EqualTo(newHeight)); | ||
148 | } | ||
149 | |||
150 | /// <summary> | ||
82 | /// Test removal of an owned NPC. | 151 | /// Test removal of an owned NPC. |
83 | /// </summary> | 152 | /// </summary> |
84 | [Test] | 153 | [Test] |