aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorUbitUmarov2016-06-28 23:30:04 +0100
committerUbitUmarov2016-06-28 23:30:04 +0100
commit90b825cda8eac02d9bb0af0dd734a662014b4d26 (patch)
treefa12574b7df2b386951860ffd275772111f95daa
parentfix NPCs OS_NPC_OBJECT_GROUP option. group ID needs to be set during creation... (diff)
downloadopensim-SC-90b825cda8eac02d9bb0af0dd734a662014b4d26.zip
opensim-SC-90b825cda8eac02d9bb0af0dd734a662014b4d26.tar.gz
opensim-SC-90b825cda8eac02d9bb0af0dd734a662014b4d26.tar.bz2
opensim-SC-90b825cda8eac02d9bb0af0dd734a662014b4d26.tar.xz
if a NPC is owned, allow access if ownerID matchs parcel owner or it is in the access list. option OS_NPC_OBJECT_GROUP it still needed if access is by group (this option should also work with not owned NPC) NEEDS TESTING, may prove to be a bad solution
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandObject.cs25
-rw-r--r--OpenSim/Region/Framework/Interfaces/INPCModule.cs1
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs4
3 files changed, 29 insertions, 1 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
index 6b37dad..4cea7bb 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
@@ -694,7 +694,30 @@ namespace OpenSim.Region.CoreModules.World.Land
694 if (HasGroupAccess(avatar)) 694 if (HasGroupAccess(avatar))
695 return false; 695 return false;
696 696
697 return !IsInLandAccessList(avatar); 697 if(IsInLandAccessList(avatar))
698 return false;
699
700 // check for a NPC
701 ScenePresence sp;
702 if (!m_scene.TryGetScenePresence(avatar, out sp))
703 return true;
704
705 if(sp==null || !sp.isNPC)
706 return true;
707
708 INPC npccli = (INPC)sp.ControllingClient;
709 if(npccli== null)
710 return true;
711
712 UUID owner = npccli.Owner;
713
714 if(owner == UUID.Zero)
715 return true;
716
717 if (owner == LandData.OwnerID)
718 return false;
719
720 return !IsInLandAccessList(owner);
698 } 721 }
699 722
700 public bool IsInLandAccessList(UUID avatar) 723 public bool IsInLandAccessList(UUID avatar)
diff --git a/OpenSim/Region/Framework/Interfaces/INPCModule.cs b/OpenSim/Region/Framework/Interfaces/INPCModule.cs
index 14610ff..58ea309 100644
--- a/OpenSim/Region/Framework/Interfaces/INPCModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/INPCModule.cs
@@ -57,6 +57,7 @@ namespace OpenSim.Region.Framework.Interfaces
57 /// </summary> 57 /// </summary>
58 bool SenseAsAgent { get; } 58 bool SenseAsAgent { get; }
59 UUID ActiveGroupId { get; set; } 59 UUID ActiveGroupId { get; set; }
60 UUID Owner { get; }
60 } 61 }
61 62
62 public interface INPCModule 63 public interface INPCModule
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
index 95cf73c..43b4e02 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
@@ -43,6 +43,10 @@ namespace OpenSim.Region.OptionalModules.World.NPC
43 public class NPCAvatar : IClientAPI, INPC 43 public class NPCAvatar : IClientAPI, INPC
44 { 44 {
45 public bool SenseAsAgent { get; set; } 45 public bool SenseAsAgent { get; set; }
46 public UUID Owner
47 {
48 get { return m_ownerID;}
49 }
46 50
47 public delegate void ChatToNPC( 51 public delegate void ChatToNPC(
48 string message, byte type, Vector3 fromPos, string fromName, 52 string message, byte type, Vector3 fromPos, string fromName,