diff options
author | Justin Clark-Casey (justincc) | 2014-12-04 22:52:46 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2014-12-04 22:52:46 +0000 |
commit | bee3f203cd93ed3816ff9d24ea04d4aa898cf779 (patch) | |
tree | db5ff0c4579db75df99f4f68d0565559dd10596d /OpenSim | |
parent | minor: Add doc about [InventoryService] AllowDelete setting to robust ini exa... (diff) | |
download | opensim-SC-bee3f203cd93ed3816ff9d24ea04d4aa898cf779.zip opensim-SC-bee3f203cd93ed3816ff9d24ea04d4aa898cf779.tar.gz opensim-SC-bee3f203cd93ed3816ff9d24ea04d4aa898cf779.tar.bz2 opensim-SC-bee3f203cd93ed3816ff9d24ea04d4aa898cf779.tar.xz |
Allow scripts in attachments on an owned NPC to call NPC functions on that NPC
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/Framework/Interfaces/INPCModule.cs | 11 | ||||
-rw-r--r-- | OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | 9 |
2 files changed, 19 insertions, 1 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/INPCModule.cs b/OpenSim/Region/Framework/Interfaces/INPCModule.cs index d5dcddd..478833e 100644 --- a/OpenSim/Region/Framework/Interfaces/INPCModule.cs +++ b/OpenSim/Region/Framework/Interfaces/INPCModule.cs | |||
@@ -122,6 +122,17 @@ namespace OpenSim.Region.Framework.Interfaces | |||
122 | /// <summary> | 122 | /// <summary> |
123 | /// Check if the caller has permission to manipulate the given NPC. | 123 | /// Check if the caller has permission to manipulate the given NPC. |
124 | /// </summary> | 124 | /// </summary> |
125 | /// <remarks> | ||
126 | /// A caller has permission if | ||
127 | /// * An NPC exists with the given npcID. | ||
128 | /// * The caller UUID given is UUID.Zero. | ||
129 | /// * The avatar is unowned (owner is UUID.Zero). | ||
130 | /// * The avatar is owned and the owner and callerID match. | ||
131 | /// * The avatar is owned and the callerID matches its agentID. | ||
132 | /// </remarks> | ||
133 | /// <param name="av"></param> | ||
134 | /// <param name="callerID"></param> | ||
135 | /// <returns>true if they do, false if they don't.</returns> | ||
125 | /// <param name="npcID"></param> | 136 | /// <param name="npcID"></param> |
126 | /// <param name="callerID"></param> | 137 | /// <param name="callerID"></param> |
127 | /// <returns> | 138 | /// <returns> |
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs index 95e59ab..b834619 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | |||
@@ -441,13 +441,20 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
441 | /// <summary> | 441 | /// <summary> |
442 | /// Check if the caller has permission to manipulate the given NPC. | 442 | /// Check if the caller has permission to manipulate the given NPC. |
443 | /// </summary> | 443 | /// </summary> |
444 | /// <remarks> | ||
445 | /// A caller has permission if | ||
446 | /// * The caller UUID given is UUID.Zero. | ||
447 | /// * The avatar is unowned (owner is UUID.Zero). | ||
448 | /// * The avatar is owned and the owner and callerID match. | ||
449 | /// * The avatar is owned and the callerID matches its agentID. | ||
450 | /// </remarks> | ||
444 | /// <param name="av"></param> | 451 | /// <param name="av"></param> |
445 | /// <param name="callerID"></param> | 452 | /// <param name="callerID"></param> |
446 | /// <returns>true if they do, false if they don't.</returns> | 453 | /// <returns>true if they do, false if they don't.</returns> |
447 | private bool CheckPermissions(NPCAvatar av, UUID callerID) | 454 | private bool CheckPermissions(NPCAvatar av, UUID callerID) |
448 | { | 455 | { |
449 | return callerID == UUID.Zero || av.OwnerID == UUID.Zero || | 456 | return callerID == UUID.Zero || av.OwnerID == UUID.Zero || |
450 | av.OwnerID == callerID; | 457 | av.OwnerID == callerID || av.AgentId == callerID; |
451 | } | 458 | } |
452 | } | 459 | } |
453 | } \ No newline at end of file | 460 | } \ No newline at end of file |