Fixed: the parcel flag "Allow Scripts from Group" should only check if the parcel has a Group set; it doesn't have to be *deeded* to the group

Also some cleanup of the use of Group ID's (with no change to functionality).
0.8.0.3
Oren Hurvitz 2014-04-16 11:43:30 +03:00
parent 63fd027494
commit a780e01a54
4 changed files with 25 additions and 31 deletions

View File

@ -633,12 +633,19 @@ namespace OpenSim.Region.CoreModules.World.Archiver
// Validate User and Group UUID's // Validate User and Group UUID's
if (!ResolveGroupUuid(parcel.GroupID))
parcel.GroupID = UUID.Zero;
if (parcel.IsGroupOwned) if (parcel.IsGroupOwned)
{ {
if (!ResolveGroupUuid(parcel.GroupID)) if (parcel.GroupID != UUID.Zero)
{
// In group-owned parcels, OwnerID=GroupID. This should already be the case, but let's make sure.
parcel.OwnerID = parcel.GroupID;
}
else
{ {
parcel.OwnerID = m_rootScene.RegionInfo.EstateSettings.EstateOwner; parcel.OwnerID = m_rootScene.RegionInfo.EstateSettings.EstateOwner;
parcel.GroupID = UUID.Zero;
parcel.IsGroupOwned = false; parcel.IsGroupOwned = false;
} }
} }
@ -646,9 +653,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver
{ {
if (!ResolveUserUuid(scene, parcel.OwnerID)) if (!ResolveUserUuid(scene, parcel.OwnerID))
parcel.OwnerID = m_rootScene.RegionInfo.EstateSettings.EstateOwner; parcel.OwnerID = m_rootScene.RegionInfo.EstateSettings.EstateOwner;
if (!ResolveGroupUuid(parcel.GroupID))
parcel.GroupID = UUID.Zero;
} }
List<LandAccessEntry> accessList = new List<LandAccessEntry>(); List<LandAccessEntry> accessList = new List<LandAccessEntry>();

View File

@ -1543,8 +1543,7 @@ namespace OpenSim.Region.CoreModules.World.Land
private void IncomingLandObjectFromStorage(LandData data) private void IncomingLandObjectFromStorage(LandData data)
{ {
ILandObject new_land = new LandObject(data.OwnerID, data.IsGroupOwned, m_scene); ILandObject new_land = new LandObject(data, m_scene);
new_land.LandData = data.Copy();
new_land.SetLandBitmapFromByteArray(); new_land.SetLandBitmapFromByteArray();
AddLandObject(new_land); AddLandObject(new_land);
} }

View File

@ -120,6 +120,12 @@ namespace OpenSim.Region.CoreModules.World.Land
#region Constructors #region Constructors
public LandObject(LandData landData, Scene scene)
{
LandData = landData.Copy();
m_scene = scene;
}
public LandObject(UUID owner_id, bool is_group_owned, Scene scene) public LandObject(UUID owner_id, bool is_group_owned, Scene scene)
{ {
m_scene = scene; m_scene = scene;
@ -163,12 +169,8 @@ namespace OpenSim.Region.CoreModules.World.Land
public ILandObject Copy() public ILandObject Copy()
{ {
ILandObject newLand = new LandObject(LandData.OwnerID, LandData.IsGroupOwned, m_scene); ILandObject newLand = new LandObject(LandData, m_scene);
//Place all new variables here!
newLand.LandBitmap = (bool[,]) (LandBitmap.Clone()); newLand.LandBitmap = (bool[,]) (LandBitmap.Clone());
newLand.LandData = LandData.Copy();
return newLand; return newLand;
} }

View File

@ -4516,11 +4516,12 @@ namespace OpenSim.Region.Framework.Scenes
{ {
return true; return true;
} }
else if ((parcel.LandData.Flags & (uint)ParcelFlags.AllowGroupScripts) != 0) else if ((part.OwnerID == parcel.LandData.OwnerID) || Permissions.IsGod(part.OwnerID))
{ {
if (part.OwnerID == parcel.LandData.OwnerID return true;
|| (parcel.LandData.IsGroupOwned && part.GroupID == parcel.LandData.GroupID) }
|| Permissions.IsGod(part.OwnerID)) else if (((parcel.LandData.Flags & (uint)ParcelFlags.AllowGroupScripts) != 0)
&& (parcel.LandData.GroupID != UUID.Zero) && (parcel.LandData.GroupID == part.GroupID))
{ {
return true; return true;
} }
@ -4530,18 +4531,6 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
else else
{
if (part.OwnerID == parcel.LandData.OwnerID)
{
return true;
}
else
{
return false;
}
}
}
else
{ {
if (pos.X > 0f && pos.X < RegionInfo.RegionSizeX && pos.Y > 0f && pos.Y < RegionInfo.RegionSizeY) if (pos.X > 0f && pos.X < RegionInfo.RegionSizeX && pos.Y > 0f && pos.Y < RegionInfo.RegionSizeY)