diff options
13 files changed, 93 insertions, 27 deletions
diff --git a/OpenSim/Framework/IMoneyModule.cs b/OpenSim/Framework/IMoneyModule.cs index ea6ed4b..71de93a 100644 --- a/OpenSim/Framework/IMoneyModule.cs +++ b/OpenSim/Framework/IMoneyModule.cs | |||
@@ -36,8 +36,8 @@ namespace OpenSim.Framework | |||
36 | int amount); | 36 | int amount); |
37 | 37 | ||
38 | int GetBalance(UUID agentID); | 38 | int GetBalance(UUID agentID); |
39 | bool UploadCovered(IClientAPI client, int amount); | 39 | bool UploadCovered(UUID agentID, int amount); |
40 | bool AmountCovered(IClientAPI client, int amount); | 40 | bool AmountCovered(UUID agentID, int amount); |
41 | void ApplyCharge(UUID agentID, int amount, string text); | 41 | void ApplyCharge(UUID agentID, int amount, string text); |
42 | void ApplyUploadCharge(UUID agentID, int amount, string text); | 42 | void ApplyUploadCharge(UUID agentID, int amount, string text); |
43 | void MoveMoney(UUID fromUser, UUID toUser, int amount, string text); | 43 | void MoveMoney(UUID fromUser, UUID toUser, int amount, string text); |
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs index 2347cf2..7bc59fc 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs | |||
@@ -366,7 +366,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
366 | 366 | ||
367 | if (mm != null) | 367 | if (mm != null) |
368 | { | 368 | { |
369 | if (!mm.UploadCovered(client, mm.UploadCharge)) | 369 | if (!mm.UploadCovered(client.AgentId, mm.UploadCharge)) |
370 | { | 370 | { |
371 | if (client != null) | 371 | if (client != null) |
372 | client.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false); | 372 | client.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false); |
@@ -1018,4 +1018,4 @@ namespace OpenSim.Region.ClientStack.Linden | |||
1018 | fs.Close(); | 1018 | fs.Close(); |
1019 | } | 1019 | } |
1020 | } | 1020 | } |
1021 | } \ No newline at end of file | 1021 | } |
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/NewFileAgentInventoryVariablePriceModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/NewFileAgentInventoryVariablePriceModule.cs index b2f04f9..aed03b3 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/NewFileAgentInventoryVariablePriceModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/NewFileAgentInventoryVariablePriceModule.cs | |||
@@ -147,7 +147,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
147 | { | 147 | { |
148 | if (m_scene.TryGetClient(agentID, out client)) | 148 | if (m_scene.TryGetClient(agentID, out client)) |
149 | { | 149 | { |
150 | if (!mm.UploadCovered(client, mm.UploadCharge)) | 150 | if (!mm.UploadCovered(client.AgentId, mm.UploadCharge)) |
151 | { | 151 | { |
152 | if (client != null) | 152 | if (client != null) |
153 | client.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false); | 153 | client.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false); |
@@ -268,4 +268,4 @@ namespace OpenSim.Region.ClientStack.Linden | |||
268 | 268 | ||
269 | } | 269 | } |
270 | } | 270 | } |
271 | } \ No newline at end of file | 271 | } |
diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs index a28d5d7..95e3aec 100644 --- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs +++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs | |||
@@ -246,7 +246,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction | |||
246 | 246 | ||
247 | if (mm != null) | 247 | if (mm != null) |
248 | { | 248 | { |
249 | if (!mm.UploadCovered(remoteClient, mm.UploadCharge)) | 249 | if (!mm.UploadCovered(remoteClient.AgentId, mm.UploadCharge)) |
250 | { | 250 | { |
251 | remoteClient.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false); | 251 | remoteClient.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false); |
252 | return; | 252 | return; |
diff --git a/OpenSim/Region/Framework/Interfaces/INPCModule.cs b/OpenSim/Region/Framework/Interfaces/INPCModule.cs index b428c40..2731291 100644 --- a/OpenSim/Region/Framework/Interfaces/INPCModule.cs +++ b/OpenSim/Region/Framework/Interfaces/INPCModule.cs | |||
@@ -31,6 +31,19 @@ using OpenSim.Region.Framework.Scenes; | |||
31 | 31 | ||
32 | namespace OpenSim.Region.Framework.Interfaces | 32 | namespace OpenSim.Region.Framework.Interfaces |
33 | { | 33 | { |
34 | /// <summary> | ||
35 | /// Temporary interface. More methods to come at some point to make NPCs more object oriented rather than | ||
36 | /// controlling purely through module level interface calls (e.g. sit/stand). | ||
37 | /// </summary> | ||
38 | public interface INPC | ||
39 | { | ||
40 | /// <summary> | ||
41 | /// Should this NPC be sensed by LSL sensors as an 'agent' (interpreted here to mean a normal user) | ||
42 | /// rather than an OpenSim specific NPC extension? | ||
43 | /// </summary> | ||
44 | bool SenseAsAgent { get; } | ||
45 | } | ||
46 | |||
34 | public interface INPCModule | 47 | public interface INPCModule |
35 | { | 48 | { |
36 | /// <summary> | 49 | /// <summary> |
@@ -39,10 +52,21 @@ namespace OpenSim.Region.Framework.Interfaces | |||
39 | /// <param name="firstname"></param> | 52 | /// <param name="firstname"></param> |
40 | /// <param name="lastname"></param> | 53 | /// <param name="lastname"></param> |
41 | /// <param name="position"></param> | 54 | /// <param name="position"></param> |
55 | /// <param name="senseAsAgent"> | ||
56 | /// Make the NPC show up as an agent on LSL sensors. The default is that they | ||
57 | /// show up as the NPC type instead, but this is currently an OpenSim-only extension. | ||
58 | /// </param> | ||
42 | /// <param name="scene"></param> | 59 | /// <param name="scene"></param> |
43 | /// <param name="appearance">The avatar appearance to use for the new NPC.</param> | 60 | /// <param name="appearance">The avatar appearance to use for the new NPC.</param> |
44 | /// <returns>The UUID of the ScenePresence created.</returns> | 61 | /// <returns>The UUID of the ScenePresence created.</returns> |
45 | UUID CreateNPC(string firstname, string lastname, Vector3 position, UUID owner, Scene scene, AvatarAppearance appearance); | 62 | UUID CreateNPC( |
63 | string firstname, | ||
64 | string lastname, | ||
65 | Vector3 position, | ||
66 | UUID owner, | ||
67 | bool senseAsAgent, | ||
68 | Scene scene, | ||
69 | AvatarAppearance appearance); | ||
46 | 70 | ||
47 | /// <summary> | 71 | /// <summary> |
48 | /// Check if the agent is an NPC. | 72 | /// Check if the agent is an NPC. |
@@ -53,6 +77,14 @@ namespace OpenSim.Region.Framework.Interfaces | |||
53 | bool IsNPC(UUID agentID, Scene scene); | 77 | bool IsNPC(UUID agentID, Scene scene); |
54 | 78 | ||
55 | /// <summary> | 79 | /// <summary> |
80 | /// Get the NPC. This is not currently complete - manipulation of NPCs still occurs through the region interface | ||
81 | /// </summary> | ||
82 | /// <param name="agentID"></param> | ||
83 | /// <param name="scene"></param> | ||
84 | /// <returns>The NPC. null if it does not exist.</returns> | ||
85 | INPC GetNPC(UUID agentID, Scene scene); | ||
86 | |||
87 | /// <summary> | ||
56 | /// Check if the caller has permission to manipulate the given NPC. | 88 | /// Check if the caller has permission to manipulate the given NPC. |
57 | /// </summary> | 89 | /// </summary> |
58 | /// <param name="npcID"></param> | 90 | /// <param name="npcID"></param> |
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs index 4e214d9..d39b847 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs | |||
@@ -713,7 +713,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
713 | if (money != null) | 713 | if (money != null) |
714 | { | 714 | { |
715 | // do the transaction, that is if the agent has got sufficient funds | 715 | // do the transaction, that is if the agent has got sufficient funds |
716 | if (!money.AmountCovered(remoteClient, money.GroupCreationCharge)) { | 716 | if (!money.AmountCovered(remoteClient.AgentId, money.GroupCreationCharge)) { |
717 | remoteClient.SendCreateGroupReply(UUID.Zero, false, "You have got issuficient funds to create a group."); | 717 | remoteClient.SendCreateGroupReply(UUID.Zero, false, "You have got issuficient funds to create a group."); |
718 | return UUID.Zero; | 718 | return UUID.Zero; |
719 | } | 719 | } |
diff --git a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs index 54d4e92..d206f69 100644 --- a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs +++ b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs | |||
@@ -775,11 +775,11 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule | |||
775 | // Please do not refactor these to be just one method | 775 | // Please do not refactor these to be just one method |
776 | // Existing implementations need the distinction | 776 | // Existing implementations need the distinction |
777 | // | 777 | // |
778 | public bool UploadCovered(IClientAPI client, int amount) | 778 | public bool UploadCovered(UUID agentID, int amount) |
779 | { | 779 | { |
780 | return true; | 780 | return true; |
781 | } | 781 | } |
782 | public bool AmountCovered(IClientAPI client, int amount) | 782 | public bool AmountCovered(UUID agentID, int amount) |
783 | { | 783 | { |
784 | return true; | 784 | return true; |
785 | } | 785 | } |
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index 182bdda..17fd6b1 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs | |||
@@ -31,13 +31,16 @@ using System.Net; | |||
31 | using OpenMetaverse; | 31 | using OpenMetaverse; |
32 | using OpenMetaverse.Packets; | 32 | using OpenMetaverse.Packets; |
33 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
34 | using OpenSim.Region.Framework.Interfaces; | ||
34 | using OpenSim.Region.Framework.Scenes; | 35 | using OpenSim.Region.Framework.Scenes; |
35 | using OpenSim.Region.CoreModules.World.Estate; | 36 | using OpenSim.Region.CoreModules.World.Estate; |
36 | 37 | ||
37 | namespace OpenSim.Region.OptionalModules.World.NPC | 38 | namespace OpenSim.Region.OptionalModules.World.NPC |
38 | { | 39 | { |
39 | public class NPCAvatar : IClientAPI | 40 | public class NPCAvatar : IClientAPI, INPC |
40 | { | 41 | { |
42 | public bool SenseAsAgent { get; set; } | ||
43 | |||
41 | private readonly string m_firstname; | 44 | private readonly string m_firstname; |
42 | private readonly string m_lastname; | 45 | private readonly string m_lastname; |
43 | private readonly Vector3 m_startPos; | 46 | private readonly Vector3 m_startPos; |
@@ -45,13 +48,15 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
45 | private readonly Scene m_scene; | 48 | private readonly Scene m_scene; |
46 | private readonly UUID m_ownerID; | 49 | private readonly UUID m_ownerID; |
47 | 50 | ||
48 | public NPCAvatar(string firstname, string lastname, Vector3 position, UUID ownerID, Scene scene) | 51 | public NPCAvatar( |
52 | string firstname, string lastname, Vector3 position, UUID ownerID, bool senseAsAgent, Scene scene) | ||
49 | { | 53 | { |
50 | m_firstname = firstname; | 54 | m_firstname = firstname; |
51 | m_lastname = lastname; | 55 | m_lastname = lastname; |
52 | m_startPos = position; | 56 | m_startPos = position; |
53 | m_scene = scene; | 57 | m_scene = scene; |
54 | m_ownerID = ownerID; | 58 | m_ownerID = ownerID; |
59 | SenseAsAgent = senseAsAgent; | ||
55 | } | 60 | } |
56 | 61 | ||
57 | public IScene Scene | 62 | public IScene Scene |
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs index d90309f..3831d7a 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | |||
@@ -109,9 +109,15 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
109 | } | 109 | } |
110 | 110 | ||
111 | public UUID CreateNPC( | 111 | public UUID CreateNPC( |
112 | string firstname, string lastname, Vector3 position, UUID owner, Scene scene, AvatarAppearance appearance) | 112 | string firstname, |
113 | string lastname, | ||
114 | Vector3 position, | ||
115 | UUID owner, | ||
116 | bool senseAsAgent, | ||
117 | Scene scene, | ||
118 | AvatarAppearance appearance) | ||
113 | { | 119 | { |
114 | NPCAvatar npcAvatar = new NPCAvatar(firstname, lastname, position, owner, scene); | 120 | NPCAvatar npcAvatar = new NPCAvatar(firstname, lastname, position, owner, senseAsAgent, scene); |
115 | npcAvatar.CircuitCode = (uint)Util.RandomClass.Next(0, int.MaxValue); | 121 | npcAvatar.CircuitCode = (uint)Util.RandomClass.Next(0, int.MaxValue); |
116 | 122 | ||
117 | m_log.DebugFormat( | 123 | m_log.DebugFormat( |
@@ -266,6 +272,17 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
266 | return UUID.Zero; | 272 | return UUID.Zero; |
267 | } | 273 | } |
268 | 274 | ||
275 | public INPC GetNPC(UUID agentID, Scene scene) | ||
276 | { | ||
277 | lock (m_avatars) | ||
278 | { | ||
279 | if (m_avatars.ContainsKey(agentID)) | ||
280 | return m_avatars[agentID]; | ||
281 | else | ||
282 | return null; | ||
283 | } | ||
284 | } | ||
285 | |||
269 | public bool DeleteNPC(UUID agentID, Scene scene) | 286 | public bool DeleteNPC(UUID agentID, Scene scene) |
270 | { | 287 | { |
271 | lock (m_avatars) | 288 | lock (m_avatars) |
diff --git a/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs b/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs index d21d601..d507822 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), UUID.Zero, scene, sp.Appearance); | 112 | UUID npcId = npcModule.CreateNPC("John", "Smith", new Vector3(128, 128, 30), UUID.Zero, true, scene, sp.Appearance); |
113 | 113 | ||
114 | ScenePresence npc = scene.GetScenePresence(npcId); | 114 | ScenePresence npc = scene.GetScenePresence(npcId); |
115 | 115 | ||
@@ -129,7 +129,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests | |||
129 | 129 | ||
130 | Vector3 startPos = new Vector3(128, 128, 30); | 130 | Vector3 startPos = new Vector3(128, 128, 30); |
131 | INPCModule npcModule = scene.RequestModuleInterface<INPCModule>(); | 131 | INPCModule npcModule = scene.RequestModuleInterface<INPCModule>(); |
132 | UUID npcId = npcModule.CreateNPC("John", "Smith", startPos, UUID.Zero, scene, sp.Appearance); | 132 | UUID npcId = npcModule.CreateNPC("John", "Smith", startPos, UUID.Zero, true, scene, sp.Appearance); |
133 | 133 | ||
134 | npcModule.DeleteNPC(npcId, scene); | 134 | npcModule.DeleteNPC(npcId, scene); |
135 | 135 | ||
@@ -157,7 +157,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests | |||
157 | am.RezSingleAttachmentFromInventory(sp, attItemId, (uint)AttachmentPoint.Chest); | 157 | am.RezSingleAttachmentFromInventory(sp, attItemId, (uint)AttachmentPoint.Chest); |
158 | 158 | ||
159 | INPCModule npcModule = scene.RequestModuleInterface<INPCModule>(); | 159 | INPCModule npcModule = scene.RequestModuleInterface<INPCModule>(); |
160 | UUID npcId = npcModule.CreateNPC("John", "Smith", new Vector3(128, 128, 30), UUID.Zero, scene, sp.Appearance); | 160 | UUID npcId = npcModule.CreateNPC("John", "Smith", new Vector3(128, 128, 30), UUID.Zero, true, scene, sp.Appearance); |
161 | 161 | ||
162 | ScenePresence npc = scene.GetScenePresence(npcId); | 162 | ScenePresence npc = scene.GetScenePresence(npcId); |
163 | 163 | ||
@@ -189,7 +189,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests | |||
189 | 189 | ||
190 | Vector3 startPos = new Vector3(128, 128, 30); | 190 | Vector3 startPos = new Vector3(128, 128, 30); |
191 | INPCModule npcModule = scene.RequestModuleInterface<INPCModule>(); | 191 | INPCModule npcModule = scene.RequestModuleInterface<INPCModule>(); |
192 | UUID npcId = npcModule.CreateNPC("John", "Smith", startPos, UUID.Zero, scene, sp.Appearance); | 192 | UUID npcId = npcModule.CreateNPC("John", "Smith", startPos, UUID.Zero, true, scene, sp.Appearance); |
193 | 193 | ||
194 | ScenePresence npc = scene.GetScenePresence(npcId); | 194 | ScenePresence npc = scene.GetScenePresence(npcId); |
195 | Assert.That(npc.AbsolutePosition, Is.EqualTo(startPos)); | 195 | Assert.That(npc.AbsolutePosition, Is.EqualTo(startPos)); |
@@ -260,7 +260,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests | |||
260 | 260 | ||
261 | Vector3 startPos = new Vector3(128, 128, 30); | 261 | Vector3 startPos = new Vector3(128, 128, 30); |
262 | INPCModule npcModule = scene.RequestModuleInterface<INPCModule>(); | 262 | INPCModule npcModule = scene.RequestModuleInterface<INPCModule>(); |
263 | UUID npcId = npcModule.CreateNPC("John", "Smith", startPos, UUID.Zero, scene, sp.Appearance); | 263 | UUID npcId = npcModule.CreateNPC("John", "Smith", startPos, UUID.Zero, true, scene, sp.Appearance); |
264 | 264 | ||
265 | ScenePresence npc = scene.GetScenePresence(npcId); | 265 | ScenePresence npc = scene.GetScenePresence(npcId); |
266 | SceneObjectPart part = SceneHelpers.AddSceneObject(scene); | 266 | SceneObjectPart part = SceneHelpers.AddSceneObject(scene); |
@@ -293,7 +293,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests | |||
293 | Vector3 startPos = new Vector3(1, 1, 1); | 293 | Vector3 startPos = new Vector3(1, 1, 1); |
294 | 294 | ||
295 | INPCModule npcModule = scene.RequestModuleInterface<INPCModule>(); | 295 | INPCModule npcModule = scene.RequestModuleInterface<INPCModule>(); |
296 | UUID npcId = npcModule.CreateNPC("John", "Smith", startPos, UUID.Zero, scene, sp.Appearance); | 296 | UUID npcId = npcModule.CreateNPC("John", "Smith", startPos, UUID.Zero, true, scene, sp.Appearance); |
297 | 297 | ||
298 | ScenePresence npc = scene.GetScenePresence(npcId); | 298 | ScenePresence npc = scene.GetScenePresence(npcId); |
299 | SceneObjectPart part = SceneHelpers.AddSceneObject(scene); | 299 | 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 d059bcb..1cb052d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -2242,7 +2242,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2242 | CheckThreatLevel(ThreatLevel.High, "osNpcCreate"); | 2242 | CheckThreatLevel(ThreatLevel.High, "osNpcCreate"); |
2243 | m_host.AddScriptLPS(1); | 2243 | m_host.AddScriptLPS(1); |
2244 | 2244 | ||
2245 | return NpcCreate(firstname, lastname, position, notecard, true); | 2245 | return NpcCreate(firstname, lastname, position, notecard, false, true); |
2246 | } | 2246 | } |
2247 | 2247 | ||
2248 | public LSL_Key osNpcCreate(string firstname, string lastname, LSL_Vector position, string notecard, int options) | 2248 | public LSL_Key osNpcCreate(string firstname, string lastname, LSL_Vector position, string notecard, int options) |
@@ -2250,10 +2250,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2250 | CheckThreatLevel(ThreatLevel.High, "osNpcCreate"); | 2250 | CheckThreatLevel(ThreatLevel.High, "osNpcCreate"); |
2251 | m_host.AddScriptLPS(1); | 2251 | m_host.AddScriptLPS(1); |
2252 | 2252 | ||
2253 | return NpcCreate(firstname, lastname, position, notecard, (options & ScriptBaseClass.OS_NPC_NOT_OWNED) == 0); | 2253 | return NpcCreate( |
2254 | firstname, lastname, position, notecard, | ||
2255 | (options & ScriptBaseClass.OS_NPC_NOT_OWNED) == 0, | ||
2256 | (options & ScriptBaseClass.OS_NPC_SENSE_AS_AGENT) == 0); | ||
2254 | } | 2257 | } |
2255 | 2258 | ||
2256 | private LSL_Key NpcCreate(string firstname, string lastname, LSL_Vector position, string notecard, bool owned) | 2259 | private LSL_Key NpcCreate( |
2260 | string firstname, string lastname, LSL_Vector position, string notecard, bool owned, bool senseAsAgent) | ||
2257 | { | 2261 | { |
2258 | if (!owned) | 2262 | if (!owned) |
2259 | OSSLError("Unowned NPCs are unsupported"); | 2263 | OSSLError("Unowned NPCs are unsupported"); |
@@ -2301,7 +2305,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2301 | lastname, | 2305 | lastname, |
2302 | new Vector3((float) position.x, (float) position.y, (float) position.z), | 2306 | new Vector3((float) position.x, (float) position.y, (float) position.z), |
2303 | ownerID, | 2307 | ownerID, |
2304 | World,appearance); | 2308 | senseAsAgent, |
2309 | World, | ||
2310 | appearance); | ||
2305 | 2311 | ||
2306 | ScenePresence sp; | 2312 | ScenePresence sp; |
2307 | if (World.TryGetScenePresence(x, out sp)) | 2313 | if (World.TryGetScenePresence(x, out sp)) |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs index dddf913..2a0ce44 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs | |||
@@ -452,9 +452,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins | |||
452 | 452 | ||
453 | Action<ScenePresence> senseEntity = new Action<ScenePresence>(delegate(ScenePresence presence) | 453 | Action<ScenePresence> senseEntity = new Action<ScenePresence>(delegate(ScenePresence presence) |
454 | { | 454 | { |
455 | if ((ts.type & NPC) == 0 && presence.PresenceType == PresenceType.Npc) | 455 | if ((ts.type & NPC) == 0 |
456 | && presence.PresenceType == PresenceType.Npc | ||
457 | && !npcModule.GetNPC(presence.UUID, presence.Scene).SenseAsAgent) | ||
456 | return; | 458 | return; |
457 | if ((ts.type & AGENT) == 0 && presence.PresenceType == PresenceType.User) | 459 | |
460 | if ((ts.type & AGENT) == 0 | ||
461 | && (presence.PresenceType == PresenceType.User | ||
462 | || npcModule.GetNPC(presence.UUID, presence.Scene).SenseAsAgent)) | ||
458 | return; | 463 | return; |
459 | 464 | ||
460 | if (presence.IsDeleted || presence.IsChildAgent || presence.GodLevel > 0.0) | 465 | if (presence.IsDeleted || presence.IsChildAgent || presence.GodLevel > 0.0) |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs index 11a8883..9489957 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs | |||
@@ -619,6 +619,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
619 | 619 | ||
620 | public const int OS_NPC_CREATOR_OWNED = 0x1; | 620 | public const int OS_NPC_CREATOR_OWNED = 0x1; |
621 | public const int OS_NPC_NOT_OWNED = 0x2; | 621 | public const int OS_NPC_NOT_OWNED = 0x2; |
622 | public const int OS_NPC_SENSE_AS_AGENT = 0x4; | ||
622 | 623 | ||
623 | public const string URL_REQUEST_GRANTED = "URL_REQUEST_GRANTED"; | 624 | public const string URL_REQUEST_GRANTED = "URL_REQUEST_GRANTED"; |
624 | public const string URL_REQUEST_DENIED = "URL_REQUEST_DENIED"; | 625 | public const string URL_REQUEST_DENIED = "URL_REQUEST_DENIED"; |