aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMelanie2011-10-25 02:27:26 +0100
committerMelanie2011-10-25 02:27:26 +0100
commit496c647ab59f47cf51538ec544b8e8c1f94a9cf4 (patch)
tree9272918f5694f62b37c54c0594fbe287371f6b99
parentMerge commit 'ddcb88ff53d2348dfc81451a3ec61bb643c49aff' into bigmerge (diff)
parentImplement osNpcStand(<npc-id>) (diff)
downloadopensim-SC_OLD-496c647ab59f47cf51538ec544b8e8c1f94a9cf4.zip
opensim-SC_OLD-496c647ab59f47cf51538ec544b8e8c1f94a9cf4.tar.gz
opensim-SC_OLD-496c647ab59f47cf51538ec544b8e8c1f94a9cf4.tar.bz2
opensim-SC_OLD-496c647ab59f47cf51538ec544b8e8c1f94a9cf4.tar.xz
Merge commit 'de161585c0960a93911f446f0179441ba5470245' into bigmerge
-rw-r--r--OpenSim/Region/Framework/Interfaces/INPCModule.cs8
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs17
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs8
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs11
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs1
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs5
6 files changed, 48 insertions, 2 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/INPCModule.cs b/OpenSim/Region/Framework/Interfaces/INPCModule.cs
index 9dd8c79..b65f82c 100644
--- a/OpenSim/Region/Framework/Interfaces/INPCModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/INPCModule.cs
@@ -104,6 +104,14 @@ namespace OpenSim.Region.Framework.Interfaces
104 bool Sit(UUID agentID, UUID partID, Scene scene); 104 bool Sit(UUID agentID, UUID partID, Scene scene);
105 105
106 /// <summary> 106 /// <summary>
107 /// Stand a sitting NPC.
108 /// </summary>
109 /// <param name="agentID"></param>
110 /// <param name="scene"></param>
111 /// <returns>true if the stand succeeded, false if not</returns>
112 bool Stand(UUID agentID, Scene scene);
113
114 /// <summary>
107 /// Delete an NPC. 115 /// Delete an NPC.
108 /// </summary> 116 /// </summary>
109 /// <param name="agentID">The UUID of the NPC</param> 117 /// <param name="agentID">The UUID of the NPC</param>
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
index be73639..e94ed85 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
@@ -217,6 +217,23 @@ namespace OpenSim.Region.OptionalModules.World.NPC
217 return false; 217 return false;
218 } 218 }
219 219
220 public bool Stand(UUID agentID, Scene scene)
221 {
222 lock (m_avatars)
223 {
224 if (m_avatars.ContainsKey(agentID))
225 {
226 ScenePresence sp;
227 scene.TryGetScenePresence(agentID, out sp);
228 sp.StandUp();
229
230 return true;
231 }
232 }
233
234 return false;
235 }
236
220 public bool DeleteNPC(UUID agentID, Scene scene) 237 public bool DeleteNPC(UUID agentID, Scene scene)
221 { 238 {
222 lock (m_avatars) 239 lock (m_avatars)
diff --git a/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs b/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs
index c5be0b6..be1ecd0 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs
@@ -231,7 +231,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests
231 } 231 }
232 232
233 [Test] 233 [Test]
234 public void TestSit() 234 public void TestSitAndStand()
235 { 235 {
236 TestHelpers.InMethod(); 236 TestHelpers.InMethod();
237// log4net.Config.XmlConfigurator.Configure(); 237// log4net.Config.XmlConfigurator.Configure();
@@ -249,9 +249,13 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests
249 part.SitTargetPosition = new Vector3(0, 0, 1); 249 part.SitTargetPosition = new Vector3(0, 0, 1);
250 npcModule.Sit(npc.UUID, part.UUID, scene); 250 npcModule.Sit(npc.UUID, part.UUID, scene);
251 251
252 // Assertions?
253 Assert.That(part.SitTargetAvatar, Is.EqualTo(npcId)); 252 Assert.That(part.SitTargetAvatar, Is.EqualTo(npcId));
254 Assert.That(npc.ParentID, Is.EqualTo(part.LocalId)); 253 Assert.That(npc.ParentID, Is.EqualTo(part.LocalId));
254
255 npcModule.Stand(npc.UUID, scene);
256
257 Assert.That(part.SitTargetAvatar, Is.EqualTo(UUID.Zero));
258 Assert.That(npc.ParentID, Is.EqualTo(0));
255 } 259 }
256 } 260 }
257} \ No newline at end of file 261} \ No newline at end of file
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index bfe62c7..bcbb8ef 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -2370,6 +2370,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2370 } 2370 }
2371 } 2371 }
2372 2372
2373 public void osNpcStand(LSL_Key npc)
2374 {
2375 CheckThreatLevel(ThreatLevel.High, "osNpcStand");
2376
2377 INPCModule module = World.RequestModuleInterface<INPCModule>();
2378 if (module != null)
2379 {
2380 module.Stand(new UUID(npc.m_string), World);
2381 }
2382 }
2383
2373 public void osNpcRemove(LSL_Key npc) 2384 public void osNpcRemove(LSL_Key npc)
2374 { 2385 {
2375 CheckThreatLevel(ThreatLevel.High, "osNpcRemove"); 2386 CheckThreatLevel(ThreatLevel.High, "osNpcRemove");
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
index 8fe43dd..a61d553 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
@@ -179,6 +179,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
179 void osNpcStopMoveToTarget(LSL_Key npc); 179 void osNpcStopMoveToTarget(LSL_Key npc);
180 void osNpcSay(key npc, string message); 180 void osNpcSay(key npc, string message);
181 void osNpcSit(key npc, key target, int options); 181 void osNpcSit(key npc, key target, int options);
182 void osNpcStand(LSL_Key npc);
182 void osNpcRemove(key npc); 183 void osNpcRemove(key npc);
183 184
184 LSL_Key osOwnerSaveAppearance(string notecard); 185 LSL_Key osOwnerSaveAppearance(string notecard);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
index 38391df..9e7c8da 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
@@ -533,6 +533,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
533 m_OSSL_Functions.osNpcSit(npc, target, options); 533 m_OSSL_Functions.osNpcSit(npc, target, options);
534 } 534 }
535 535
536 public void osNpcStand(LSL_Key npc)
537 {
538 m_OSSL_Functions.osNpcStand(npc);
539 }
540
536 public void osNpcRemove(key npc) 541 public void osNpcRemove(key npc)
537 { 542 {
538 m_OSSL_Functions.osNpcRemove(npc); 543 m_OSSL_Functions.osNpcRemove(npc);