From 6b0521d3c91f4ca6f87734748df553663cbc3e87 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 29 Jul 2014 01:24:43 +0100 Subject: fix the mess about exclusive fields and flags on land overlay --- .../Region/CoreModules/World/Land/LandChannel.cs | 14 +++--- .../CoreModules/World/Land/LandManagementModule.cs | 51 +++++++++++----------- 2 files changed, 34 insertions(+), 31 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/World/Land/LandChannel.cs b/OpenSim/Region/CoreModules/World/Land/LandChannel.cs index faaf41c..beb0a24 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandChannel.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandChannel.cs @@ -50,8 +50,9 @@ namespace OpenSim.Region.CoreModules.World.Land public const int LAND_SELECT_OBJECTS_GROUP = 4; public const int LAND_SELECT_OBJECTS_OTHER = 8; - + public const byte LAND_TYPE_PUBLIC = 0; //Equals 00000000 + // types 1 to 7 are exclusive public const byte LAND_TYPE_OWNED_BY_OTHER = 1; //Equals 00000001 public const byte LAND_TYPE_OWNED_BY_GROUP = 2; //Equals 00000010 public const byte LAND_TYPE_OWNED_BY_REQUESTER = 3; //Equals 00000011 @@ -59,11 +60,12 @@ namespace OpenSim.Region.CoreModules.World.Land public const byte LAND_TYPE_IS_BEING_AUCTIONED = 5; //Equals 00000101 public const byte LAND_TYPE_unused6 = 6; public const byte LAND_TYPE_unused7 = 7; - public const byte LAND_TYPE_unused8 = 8; - public const byte LAND_TYPE_HIDEAVATARS = 0x10; - public const byte LAND_TYPE_LOCALSOUND = 0x20; - public const byte LAND_TYPE_PROPERTY_BORDER_WEST = 0x40; //Equals 01000000 - public const byte LAND_TYPE_PROPERTY_BORDER_SOUTH = 0x80; //Equals 10000000 + // next are flags + public const byte LAND_FLAG_unused8 = 0x08; // this may become excluside in future + public const byte LAND_FLAG_HIDEAVATARS = 0x10; + public const byte LAND_FLAG_LOCALSOUND = 0x20; + public const byte LAND_FLAG_PROPERTY_BORDER_WEST = 0x40; //Equals 01000000 + public const byte LAND_FLAG_PROPERTY_BORDER_SOUTH = 0x80; //Equals 10000000 //These are other constants. Yay! diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 834448c..173dcd5 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs @@ -1040,38 +1040,37 @@ namespace OpenSim.Region.CoreModules.World.Land if (currentParcelBlock != null) { - if (currentParcelBlock.LandData.OwnerID == UUID.Zero) - { - //Public Flag - tempByte |= (byte)LandChannel.LAND_TYPE_PUBLIC; // this does nothing - } - else if (currentParcelBlock.LandData.OwnerID == remote_client.AgentId) + // types + if (currentParcelBlock.LandData.OwnerID == remote_client.AgentId) { //Owner Flag tempByte |= (byte)LandChannel.LAND_TYPE_OWNED_BY_REQUESTER; } - else - { - //Other Flag - tempByte |= (byte)LandChannel.LAND_TYPE_OWNED_BY_OTHER; - } - - if (currentParcelBlock.LandData.IsGroupOwned && remote_client.IsGroupMember(currentParcelBlock.LandData.GroupID)) + else if (currentParcelBlock.LandData.IsGroupOwned && remote_client.IsGroupMember(currentParcelBlock.LandData.GroupID)) { tempByte |= (byte)LandChannel.LAND_TYPE_OWNED_BY_GROUP; } - - if (currentParcelBlock.LandData.SalePrice > 0 && + else if (currentParcelBlock.LandData.SalePrice > 0 && (currentParcelBlock.LandData.AuthBuyerID == UUID.Zero || currentParcelBlock.LandData.AuthBuyerID == remote_client.AgentId)) { - //Sale Flag + //Sale type tempByte |= (byte)LandChannel.LAND_TYPE_IS_FOR_SALE; } + else if(currentParcelBlock.LandData.OwnerID == UUID.Zero) + { + //Public type + tempByte |= (byte)LandChannel.LAND_TYPE_PUBLIC; // this does nothing, its zero + } +// LAND_TYPE_IS_BEING_AUCTIONED still unsuported + else + { + //Other Flag + tempByte |= (byte)LandChannel.LAND_TYPE_OWNED_BY_OTHER; + } - // LAND_TYPE_IS_BEING_AUCTIONED not suported? - - //Now for border control + // now flags + // border control ILandObject westParcel = null; ILandObject southParcel = null; @@ -1086,27 +1085,29 @@ namespace OpenSim.Region.CoreModules.World.Land if (x == 0) { - tempByte |= (byte)LandChannel.LAND_TYPE_PROPERTY_BORDER_WEST; + tempByte |= (byte)LandChannel.LAND_FLAG_PROPERTY_BORDER_WEST; } else if (westParcel != null && westParcel != currentParcelBlock) { - tempByte |= (byte)LandChannel.LAND_TYPE_PROPERTY_BORDER_WEST; + tempByte |= (byte)LandChannel.LAND_FLAG_PROPERTY_BORDER_WEST; } if (y == 0) { - tempByte |= (byte)LandChannel.LAND_TYPE_PROPERTY_BORDER_SOUTH; + tempByte |= (byte)LandChannel.LAND_FLAG_PROPERTY_BORDER_SOUTH; } else if (southParcel != null && southParcel != currentParcelBlock) { - tempByte |= (byte)LandChannel.LAND_TYPE_PROPERTY_BORDER_SOUTH; + tempByte |= (byte)LandChannel.LAND_FLAG_PROPERTY_BORDER_SOUTH; } + // local sound if ((currentParcelBlock.LandData.Flags & (uint)ParcelFlags.SoundLocal) != 0) - tempByte |= (byte)LandChannel.LAND_TYPE_LOCALSOUND; + tempByte |= (byte)LandChannel.LAND_FLAG_LOCALSOUND; + // hide avatars // if ((currentParcelBlock.LandData.Flags & (uint)ParcelFlags.???hideavatar) != 0) -// tempByte |= (byte)LandChannel.LAND_TYPE_HIDEAVATARS; +// tempByte |= (byte)LandChannel.LAND_FLAG_HIDEAVATARS; byteArray[byteArrayCount] = tempByte; -- cgit v1.1