mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 17:55:48 +08:00
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
This commit is contained in:
@@ -694,7 +694,30 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
if (HasGroupAccess(avatar))
|
||||
return false;
|
||||
|
||||
return !IsInLandAccessList(avatar);
|
||||
if(IsInLandAccessList(avatar))
|
||||
return false;
|
||||
|
||||
// check for a NPC
|
||||
ScenePresence sp;
|
||||
if (!m_scene.TryGetScenePresence(avatar, out sp))
|
||||
return true;
|
||||
|
||||
if(sp==null || !sp.isNPC)
|
||||
return true;
|
||||
|
||||
INPC npccli = (INPC)sp.ControllingClient;
|
||||
if(npccli== null)
|
||||
return true;
|
||||
|
||||
UUID owner = npccli.Owner;
|
||||
|
||||
if(owner == UUID.Zero)
|
||||
return true;
|
||||
|
||||
if (owner == LandData.OwnerID)
|
||||
return false;
|
||||
|
||||
return !IsInLandAccessList(owner);
|
||||
}
|
||||
|
||||
public bool IsInLandAccessList(UUID avatar)
|
||||
|
||||
@@ -57,6 +57,7 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||
/// </summary>
|
||||
bool SenseAsAgent { get; }
|
||||
UUID ActiveGroupId { get; set; }
|
||||
UUID Owner { get; }
|
||||
}
|
||||
|
||||
public interface INPCModule
|
||||
|
||||
@@ -43,6 +43,10 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
||||
public class NPCAvatar : IClientAPI, INPC
|
||||
{
|
||||
public bool SenseAsAgent { get; set; }
|
||||
public UUID Owner
|
||||
{
|
||||
get { return m_ownerID;}
|
||||
}
|
||||
|
||||
public delegate void ChatToNPC(
|
||||
string message, byte type, Vector3 fromPos, string fromName,
|
||||
|
||||
Reference in New Issue
Block a user