diff options
author | Melanie | 2012-01-06 22:35:06 +0000 |
---|---|---|
committer | Melanie | 2012-01-06 22:35:06 +0000 |
commit | 7518b075b76fea062971a9e5fb716118130ebe43 (patch) | |
tree | df4449fdfe02de0b706cac6024603e4ebabdb256 | |
parent | eliminate a few tabs from OpenSimDefaults.ini (diff) | |
download | opensim-SC-7518b075b76fea062971a9e5fb716118130ebe43.zip opensim-SC-7518b075b76fea062971a9e5fb716118130ebe43.tar.gz opensim-SC-7518b075b76fea062971a9e5fb716118130ebe43.tar.bz2 opensim-SC-7518b075b76fea062971a9e5fb716118130ebe43.tar.xz |
Add osNpcCreateOwned to create an owned NPC. Those can be sensed only by the owner, can be destroyed only by the owner and only the owner can save their appearance. Added "NPC" as a flag to llSensor to sense NPCs and exclude them from "AGENT" results.
9 files changed, 94 insertions, 20 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/INPCModule.cs b/OpenSim/Region/Framework/Interfaces/INPCModule.cs index b65f82c..cac8479 100644 --- a/OpenSim/Region/Framework/Interfaces/INPCModule.cs +++ b/OpenSim/Region/Framework/Interfaces/INPCModule.cs | |||
@@ -42,7 +42,7 @@ namespace OpenSim.Region.Framework.Interfaces | |||
42 | /// <param name="scene"></param> | 42 | /// <param name="scene"></param> |
43 | /// <param name="appearance">The avatar appearance to use for the new NPC.</param> | 43 | /// <param name="appearance">The avatar appearance to use for the new NPC.</param> |
44 | /// <returns>The UUID of the ScenePresence created.</returns> | 44 | /// <returns>The UUID of the ScenePresence created.</returns> |
45 | UUID CreateNPC(string firstname, string lastname, Vector3 position, Scene scene, AvatarAppearance appearance); | 45 | UUID CreateNPC(string firstname, string lastname, Vector3 position, UUID owner, Scene scene, AvatarAppearance appearance); |
46 | 46 | ||
47 | /// <summary> | 47 | /// <summary> |
48 | /// Check if the agent is an NPC. | 48 | /// Check if the agent is an NPC. |
@@ -117,6 +117,13 @@ namespace OpenSim.Region.Framework.Interfaces | |||
117 | /// <param name="agentID">The UUID of the NPC</param> | 117 | /// <param name="agentID">The UUID of the NPC</param> |
118 | /// <param name="scene"></param> | 118 | /// <param name="scene"></param> |
119 | /// <returns>True if the operation succeeded, false if there was no such agent or the agent was not an NPC</returns> | 119 | /// <returns>True if the operation succeeded, false if there was no such agent or the agent was not an NPC</returns> |
120 | bool DeleteNPC(UUID agentID, Scene scene); | 120 | bool DeleteNPC(UUID agentID, UUID CallerID, Scene scene); |
121 | |||
122 | /// <summary> | ||
123 | /// Get the owner of a NPC | ||
124 | /// </summary> | ||
125 | /// <param name="agentID">The UUID of the NPC</param> | ||
126 | /// <returns>UUID of owner if the NPC exists, UUID.Zero if there was no such agent, the agent is unowned or the agent was not an NPC</returns> | ||
127 | UUID GetOwner(UUID agentID); | ||
121 | } | 128 | } |
122 | } \ No newline at end of file | 129 | } |
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index 84055cc..5f4f937 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs | |||
@@ -42,13 +42,15 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
42 | private readonly Vector3 m_startPos; | 42 | private readonly Vector3 m_startPos; |
43 | private readonly UUID m_uuid = UUID.Random(); | 43 | private readonly UUID m_uuid = UUID.Random(); |
44 | private readonly Scene m_scene; | 44 | private readonly Scene m_scene; |
45 | private readonly UUID m_ownerID; | ||
45 | 46 | ||
46 | public NPCAvatar(string firstname, string lastname, Vector3 position, Scene scene) | 47 | public NPCAvatar(string firstname, string lastname, Vector3 position, UUID ownerID, Scene scene) |
47 | { | 48 | { |
48 | m_firstname = firstname; | 49 | m_firstname = firstname; |
49 | m_lastname = lastname; | 50 | m_lastname = lastname; |
50 | m_startPos = position; | 51 | m_startPos = position; |
51 | m_scene = scene; | 52 | m_scene = scene; |
53 | m_ownerID = ownerID; | ||
52 | } | 54 | } |
53 | 55 | ||
54 | public IScene Scene | 56 | public IScene Scene |
@@ -56,6 +58,11 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
56 | get { return m_scene; } | 58 | get { return m_scene; } |
57 | } | 59 | } |
58 | 60 | ||
61 | public UUID OwnerID | ||
62 | { | ||
63 | get { return m_ownerID; } | ||
64 | } | ||
65 | |||
59 | public ISceneAgent SceneAgent { get { throw new NotImplementedException(); } } | 66 | public ISceneAgent SceneAgent { get { throw new NotImplementedException(); } } |
60 | 67 | ||
61 | public void Say(string message) | 68 | public void Say(string message) |
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs index 56ff367..e874417 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | |||
@@ -91,9 +91,9 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
91 | } | 91 | } |
92 | 92 | ||
93 | public UUID CreateNPC( | 93 | public UUID CreateNPC( |
94 | string firstname, string lastname, Vector3 position, Scene scene, AvatarAppearance appearance) | 94 | string firstname, string lastname, Vector3 position, UUID owner, Scene scene, AvatarAppearance appearance) |
95 | { | 95 | { |
96 | NPCAvatar npcAvatar = new NPCAvatar(firstname, lastname, position, scene); | 96 | NPCAvatar npcAvatar = new NPCAvatar(firstname, lastname, position, owner, scene); |
97 | npcAvatar.CircuitCode = (uint)Util.RandomClass.Next(0, int.MaxValue); | 97 | npcAvatar.CircuitCode = (uint)Util.RandomClass.Next(0, int.MaxValue); |
98 | 98 | ||
99 | m_log.DebugFormat( | 99 | m_log.DebugFormat( |
@@ -234,12 +234,30 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
234 | return false; | 234 | return false; |
235 | } | 235 | } |
236 | 236 | ||
237 | public bool DeleteNPC(UUID agentID, Scene scene) | 237 | public UUID GetOwner(UUID agentID) |
238 | { | 238 | { |
239 | lock (m_avatars) | 239 | lock (m_avatars) |
240 | { | 240 | { |
241 | if (m_avatars.ContainsKey(agentID)) | 241 | NPCAvatar av; |
242 | if (m_avatars.TryGetValue(agentID, out av)) | ||
242 | { | 243 | { |
244 | return av.OwnerID; | ||
245 | } | ||
246 | } | ||
247 | |||
248 | return UUID.Zero; | ||
249 | } | ||
250 | |||
251 | public bool DeleteNPC(UUID agentID, UUID callerID, Scene scene) | ||
252 | { | ||
253 | lock (m_avatars) | ||
254 | { | ||
255 | NPCAvatar av; | ||
256 | if (m_avatars.TryGetValue(agentID, out av)) | ||
257 | { | ||
258 | if (av.OwnerID != UUID.Zero && callerID != UUID.Zero && av.OwnerID != callerID) | ||
259 | return false; | ||
260 | |||
243 | scene.RemoveClient(agentID, false); | 261 | scene.RemoveClient(agentID, false); |
244 | m_avatars.Remove(agentID); | 262 | m_avatars.Remove(agentID); |
245 | 263 | ||
@@ -268,4 +286,4 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
268 | get { return true; } | 286 | get { return true; } |
269 | } | 287 | } |
270 | } | 288 | } |
271 | } \ No newline at end of file | 289 | } |
diff --git a/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs b/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs index 9c66b25..571d33d 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs | |||
@@ -109,7 +109,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests | |||
109 | afm.SetAppearance(sp, originalTe, null); | 109 | afm.SetAppearance(sp, originalTe, null); |
110 | 110 | ||
111 | INPCModule npcModule = scene.RequestModuleInterface<INPCModule>(); | 111 | INPCModule npcModule = scene.RequestModuleInterface<INPCModule>(); |
112 | UUID npcId = npcModule.CreateNPC("John", "Smith", new Vector3(128, 128, 30), scene, sp.Appearance); | 112 | UUID npcId = npcModule.CreateNPC("John", "Smith", new Vector3(128, 128, 30), UUID.Zero, scene, sp.Appearance); |
113 | 113 | ||
114 | ScenePresence npc = scene.GetScenePresence(npcId); | 114 | ScenePresence npc = scene.GetScenePresence(npcId); |
115 | 115 | ||
@@ -137,7 +137,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests | |||
137 | am.RezSingleAttachmentFromInventory(sp, attItemId, (uint)AttachmentPoint.Chest); | 137 | am.RezSingleAttachmentFromInventory(sp, attItemId, (uint)AttachmentPoint.Chest); |
138 | 138 | ||
139 | INPCModule npcModule = scene.RequestModuleInterface<INPCModule>(); | 139 | INPCModule npcModule = scene.RequestModuleInterface<INPCModule>(); |
140 | UUID npcId = npcModule.CreateNPC("John", "Smith", new Vector3(128, 128, 30), scene, sp.Appearance); | 140 | UUID npcId = npcModule.CreateNPC("John", "Smith", new Vector3(128, 128, 30), UUID.Zero, scene, sp.Appearance); |
141 | 141 | ||
142 | ScenePresence npc = scene.GetScenePresence(npcId); | 142 | ScenePresence npc = scene.GetScenePresence(npcId); |
143 | 143 | ||
@@ -169,7 +169,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests | |||
169 | 169 | ||
170 | Vector3 startPos = new Vector3(128, 128, 30); | 170 | Vector3 startPos = new Vector3(128, 128, 30); |
171 | INPCModule npcModule = scene.RequestModuleInterface<INPCModule>(); | 171 | INPCModule npcModule = scene.RequestModuleInterface<INPCModule>(); |
172 | UUID npcId = npcModule.CreateNPC("John", "Smith", startPos, scene, sp.Appearance); | 172 | UUID npcId = npcModule.CreateNPC("John", "Smith", startPos, UUID.Zero, scene, sp.Appearance); |
173 | 173 | ||
174 | ScenePresence npc = scene.GetScenePresence(npcId); | 174 | ScenePresence npc = scene.GetScenePresence(npcId); |
175 | Assert.That(npc.AbsolutePosition, Is.EqualTo(startPos)); | 175 | Assert.That(npc.AbsolutePosition, Is.EqualTo(startPos)); |
@@ -240,7 +240,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests | |||
240 | 240 | ||
241 | Vector3 startPos = new Vector3(128, 128, 30); | 241 | Vector3 startPos = new Vector3(128, 128, 30); |
242 | INPCModule npcModule = scene.RequestModuleInterface<INPCModule>(); | 242 | INPCModule npcModule = scene.RequestModuleInterface<INPCModule>(); |
243 | UUID npcId = npcModule.CreateNPC("John", "Smith", startPos, scene, sp.Appearance); | 243 | UUID npcId = npcModule.CreateNPC("John", "Smith", startPos, UUID.Zero, scene, sp.Appearance); |
244 | 244 | ||
245 | ScenePresence npc = scene.GetScenePresence(npcId); | 245 | ScenePresence npc = scene.GetScenePresence(npcId); |
246 | SceneObjectPart part = SceneHelpers.AddSceneObject(scene); | 246 | SceneObjectPart part = SceneHelpers.AddSceneObject(scene); |
@@ -273,7 +273,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests | |||
273 | Vector3 startPos = new Vector3(1, 1, 1); | 273 | Vector3 startPos = new Vector3(1, 1, 1); |
274 | 274 | ||
275 | INPCModule npcModule = scene.RequestModuleInterface<INPCModule>(); | 275 | INPCModule npcModule = scene.RequestModuleInterface<INPCModule>(); |
276 | UUID npcId = npcModule.CreateNPC("John", "Smith", startPos, scene, sp.Appearance); | 276 | UUID npcId = npcModule.CreateNPC("John", "Smith", startPos, UUID.Zero, scene, sp.Appearance); |
277 | 277 | ||
278 | ScenePresence npc = scene.GetScenePresence(npcId); | 278 | ScenePresence npc = scene.GetScenePresence(npcId); |
279 | SceneObjectPart part = SceneHelpers.AddSceneObject(scene); | 279 | SceneObjectPart part = SceneHelpers.AddSceneObject(scene); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index bb0ba3d..c1a700a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -2067,10 +2067,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2067 | return retVal; | 2067 | return retVal; |
2068 | } | 2068 | } |
2069 | 2069 | ||
2070 | public LSL_Key osNpcCreateOwned(string firstname, string lastname, LSL_Vector position, string notecard) | ||
2071 | { | ||
2072 | CheckThreatLevel(ThreatLevel.High, "osNpcCreateOwned"); | ||
2073 | return NpcCreate(firstname, lastname, position, notecard, true); | ||
2074 | } | ||
2075 | |||
2070 | public LSL_Key osNpcCreate(string firstname, string lastname, LSL_Vector position, string notecard) | 2076 | public LSL_Key osNpcCreate(string firstname, string lastname, LSL_Vector position, string notecard) |
2071 | { | 2077 | { |
2072 | CheckThreatLevel(ThreatLevel.High, "osNpcCreate"); | 2078 | CheckThreatLevel(ThreatLevel.High, "osNpcCreated"); |
2079 | return NpcCreate(firstname, lastname, position, notecard, false); | ||
2080 | } | ||
2073 | 2081 | ||
2082 | private LSL_Key NpcCreate(string firstname, string lastname, LSL_Vector position, string notecard, bool owned) | ||
2083 | { | ||
2074 | INPCModule module = World.RequestModuleInterface<INPCModule>(); | 2084 | INPCModule module = World.RequestModuleInterface<INPCModule>(); |
2075 | if (module != null) | 2085 | if (module != null) |
2076 | { | 2086 | { |
@@ -2099,11 +2109,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2099 | if (appearance == null) | 2109 | if (appearance == null) |
2100 | return new LSL_Key(UUID.Zero.ToString()); | 2110 | return new LSL_Key(UUID.Zero.ToString()); |
2101 | 2111 | ||
2112 | UUID ownerID = UUID.Zero; | ||
2113 | if (owned) | ||
2114 | ownerID = m_host.OwnerID; | ||
2102 | UUID x = module.CreateNPC(firstname, | 2115 | UUID x = module.CreateNPC(firstname, |
2103 | lastname, | 2116 | lastname, |
2104 | new Vector3((float) position.x, (float) position.y, (float) position.z), | 2117 | new Vector3((float) position.x, (float) position.y, (float) position.z), |
2105 | World, | 2118 | ownerID, |
2106 | appearance); | 2119 | World,appearance); |
2107 | 2120 | ||
2108 | return new LSL_Key(x.ToString()); | 2121 | return new LSL_Key(x.ToString()); |
2109 | } | 2122 | } |
@@ -2132,6 +2145,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2132 | if (!npcModule.IsNPC(npcId, m_host.ParentGroup.Scene)) | 2145 | if (!npcModule.IsNPC(npcId, m_host.ParentGroup.Scene)) |
2133 | return new LSL_Key(UUID.Zero.ToString()); | 2146 | return new LSL_Key(UUID.Zero.ToString()); |
2134 | 2147 | ||
2148 | UUID ownerID = npcModule.GetOwner(npcId); | ||
2149 | if (ownerID != UUID.Zero && ownerID != m_host.OwnerID) | ||
2150 | return new LSL_Key(UUID.Zero.ToString()); | ||
2151 | |||
2135 | return SaveAppearanceToNotecard(npcId, notecard); | 2152 | return SaveAppearanceToNotecard(npcId, notecard); |
2136 | } | 2153 | } |
2137 | 2154 | ||
@@ -2311,7 +2328,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2311 | INPCModule module = World.RequestModuleInterface<INPCModule>(); | 2328 | INPCModule module = World.RequestModuleInterface<INPCModule>(); |
2312 | if (module != null) | 2329 | if (module != null) |
2313 | { | 2330 | { |
2314 | module.DeleteNPC(new UUID(npc.m_string), World); | 2331 | module.DeleteNPC(new UUID(npc.m_string), m_host.OwnerID, World); |
2315 | } | 2332 | } |
2316 | } | 2333 | } |
2317 | 2334 | ||
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs index 3eeb23d..7d7813d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs | |||
@@ -26,10 +26,13 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Reflection; | ||
29 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
30 | using OpenMetaverse; | 31 | using OpenMetaverse; |
31 | using OpenSim.Framework; | 32 | using OpenSim.Framework; |
33 | using log4net; | ||
32 | 34 | ||
35 | using OpenSim.Region.Framework.Interfaces; | ||
33 | using OpenSim.Region.Framework.Scenes; | 36 | using OpenSim.Region.Framework.Scenes; |
34 | using OpenSim.Region.ScriptEngine.Shared; | 37 | using OpenSim.Region.ScriptEngine.Shared; |
35 | using OpenSim.Region.ScriptEngine.Shared.Api; | 38 | using OpenSim.Region.ScriptEngine.Shared.Api; |
@@ -51,6 +54,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins | |||
51 | 54 | ||
52 | private const int AGENT = 1; | 55 | private const int AGENT = 1; |
53 | private const int AGENT_BY_USERNAME = 0x10; | 56 | private const int AGENT_BY_USERNAME = 0x10; |
57 | private const int NPC = 0x20; | ||
54 | private const int ACTIVE = 2; | 58 | private const int ACTIVE = 2; |
55 | private const int PASSIVE = 4; | 59 | private const int PASSIVE = 4; |
56 | private const int SCRIPTED = 8; | 60 | private const int SCRIPTED = 8; |
@@ -203,7 +207,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins | |||
203 | List<SensedEntity> sensedEntities = new List<SensedEntity>(); | 207 | List<SensedEntity> sensedEntities = new List<SensedEntity>(); |
204 | 208 | ||
205 | // Is the sensor type is AGENT and not SCRIPTED then include agents | 209 | // Is the sensor type is AGENT and not SCRIPTED then include agents |
206 | if ((ts.type & (AGENT | AGENT_BY_USERNAME)) != 0 && (ts.type & SCRIPTED) == 0) | 210 | if ((ts.type & (AGENT | AGENT_BY_USERNAME | NPC)) != 0 && (ts.type & SCRIPTED) == 0) |
207 | { | 211 | { |
208 | sensedEntities.AddRange(doAgentSensor(ts)); | 212 | sensedEntities.AddRange(doAgentSensor(ts)); |
209 | } | 213 | } |
@@ -413,6 +417,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins | |||
413 | 417 | ||
414 | private List<SensedEntity> doAgentSensor(SenseRepeatClass ts) | 418 | private List<SensedEntity> doAgentSensor(SenseRepeatClass ts) |
415 | { | 419 | { |
420 | INPCModule npcModule = m_CmdManager.m_ScriptEngine.World.RequestModuleInterface<INPCModule>(); | ||
421 | |||
416 | List<SensedEntity> sensedEntities = new List<SensedEntity>(); | 422 | List<SensedEntity> sensedEntities = new List<SensedEntity>(); |
417 | 423 | ||
418 | // If nobody about quit fast | 424 | // If nobody about quit fast |
@@ -441,6 +447,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins | |||
441 | 447 | ||
442 | Action<ScenePresence> senseEntity = new Action<ScenePresence>(delegate(ScenePresence presence) | 448 | Action<ScenePresence> senseEntity = new Action<ScenePresence>(delegate(ScenePresence presence) |
443 | { | 449 | { |
450 | if ((ts.type & NPC) == 0 && presence.PresenceType == PresenceType.Npc) | ||
451 | return; | ||
452 | if ((ts.type & AGENT) == 0 && presence.PresenceType == PresenceType.User) | ||
453 | return; | ||
454 | |||
444 | if (presence.IsDeleted || presence.IsChildAgent || presence.GodLevel > 0.0) | 455 | if (presence.IsDeleted || presence.IsChildAgent || presence.GodLevel > 0.0) |
445 | return; | 456 | return; |
446 | 457 | ||
@@ -452,6 +463,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins | |||
452 | toRegionPos = presence.AbsolutePosition; | 463 | toRegionPos = presence.AbsolutePosition; |
453 | dis = Math.Abs(Util.GetDistanceTo(toRegionPos, fromRegionPos)); | 464 | dis = Math.Abs(Util.GetDistanceTo(toRegionPos, fromRegionPos)); |
454 | 465 | ||
466 | if (presence.PresenceType == PresenceType.Npc && npcModule != null) | ||
467 | { | ||
468 | UUID npcOwner = npcModule.GetOwner(presence.UUID); | ||
469 | if (npcOwner != UUID.Zero && npcOwner != SensePoint.OwnerID) | ||
470 | return; | ||
471 | } | ||
472 | |||
455 | // are they in range | 473 | // are they in range |
456 | if (dis <= ts.range) | 474 | if (dis <= ts.range) |
457 | { | 475 | { |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index f5ee733..1380ed4 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | |||
@@ -172,6 +172,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces | |||
172 | LSL_List osGetLinkPrimitiveParams(int linknumber, LSL_List rules); | 172 | LSL_List osGetLinkPrimitiveParams(int linknumber, LSL_List rules); |
173 | 173 | ||
174 | key osNpcCreate(string user, string name, vector position, string notecard); | 174 | key osNpcCreate(string user, string name, vector position, string notecard); |
175 | key osNpcCreateOwned(string user, string name, vector position, string notecard); | ||
175 | LSL_Key osNpcSaveAppearance(key npc, string notecard); | 176 | LSL_Key osNpcSaveAppearance(key npc, string notecard); |
176 | void osNpcLoadAppearance(key npc, string notecard); | 177 | void osNpcLoadAppearance(key npc, string notecard); |
177 | vector osNpcGetPos(key npc); | 178 | vector osNpcGetPos(key npc); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs index fd08373..b58cf57 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs | |||
@@ -52,6 +52,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
52 | public const int AGENT = 1; | 52 | public const int AGENT = 1; |
53 | public const int AGENT_BY_LEGACY_NAME = 1; | 53 | public const int AGENT_BY_LEGACY_NAME = 1; |
54 | public const int AGENT_BY_USERNAME = 0x10; | 54 | public const int AGENT_BY_USERNAME = 0x10; |
55 | public const int NPC = 0x20; | ||
55 | public const int ACTIVE = 2; | 56 | public const int ACTIVE = 2; |
56 | public const int PASSIVE = 4; | 57 | public const int PASSIVE = 4; |
57 | public const int SCRIPTED = 8; | 58 | public const int SCRIPTED = 8; |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index 0d7d5ea..6572def 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | |||
@@ -488,6 +488,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
488 | return m_OSSL_Functions.osNpcCreate(user, name, position, cloneFrom); | 488 | return m_OSSL_Functions.osNpcCreate(user, name, position, cloneFrom); |
489 | } | 489 | } |
490 | 490 | ||
491 | public key osNpcCreateOwned(string user, string name, vector position, key cloneFrom) | ||
492 | { | ||
493 | return m_OSSL_Functions.osNpcCreateOwned(user, name, position, cloneFrom); | ||
494 | } | ||
495 | |||
491 | public key osNpcSaveAppearance(key npc, string notecard) | 496 | public key osNpcSaveAppearance(key npc, string notecard) |
492 | { | 497 | { |
493 | return m_OSSL_Functions.osNpcSaveAppearance(npc, notecard); | 498 | return m_OSSL_Functions.osNpcSaveAppearance(npc, notecard); |
@@ -818,4 +823,4 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
818 | return m_OSSL_Functions.osUnixTimeToTimestamp(time); | 823 | return m_OSSL_Functions.osUnixTimeToTimestamp(time); |
819 | } | 824 | } |
820 | } | 825 | } |
821 | } \ No newline at end of file | 826 | } |