fix the mess about exclusive fields and flags on land overlay

avinationmerge
UbitUmarov 2014-07-29 01:24:43 +01:00
parent 3e1d2df261
commit 6b0521d3c9
2 changed files with 37 additions and 34 deletions

View File

@ -52,6 +52,7 @@ namespace OpenSim.Region.CoreModules.World.Land
public const byte LAND_TYPE_PUBLIC = 0; //Equals 00000000 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_OTHER = 1; //Equals 00000001
public const byte LAND_TYPE_OWNED_BY_GROUP = 2; //Equals 00000010 public const byte LAND_TYPE_OWNED_BY_GROUP = 2; //Equals 00000010
public const byte LAND_TYPE_OWNED_BY_REQUESTER = 3; //Equals 00000011 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_IS_BEING_AUCTIONED = 5; //Equals 00000101
public const byte LAND_TYPE_unused6 = 6; public const byte LAND_TYPE_unused6 = 6;
public const byte LAND_TYPE_unused7 = 7; public const byte LAND_TYPE_unused7 = 7;
public const byte LAND_TYPE_unused8 = 8; // next are flags
public const byte LAND_TYPE_HIDEAVATARS = 0x10; public const byte LAND_FLAG_unused8 = 0x08; // this may become excluside in future
public const byte LAND_TYPE_LOCALSOUND = 0x20; public const byte LAND_FLAG_HIDEAVATARS = 0x10;
public const byte LAND_TYPE_PROPERTY_BORDER_WEST = 0x40; //Equals 01000000 public const byte LAND_FLAG_LOCALSOUND = 0x20;
public const byte LAND_TYPE_PROPERTY_BORDER_SOUTH = 0x80; //Equals 10000000 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! //These are other constants. Yay!

View File

@ -1040,38 +1040,37 @@ namespace OpenSim.Region.CoreModules.World.Land
if (currentParcelBlock != null) if (currentParcelBlock != null)
{ {
if (currentParcelBlock.LandData.OwnerID == UUID.Zero) // types
{ if (currentParcelBlock.LandData.OwnerID == remote_client.AgentId)
//Public Flag
tempByte |= (byte)LandChannel.LAND_TYPE_PUBLIC; // this does nothing
}
else if (currentParcelBlock.LandData.OwnerID == remote_client.AgentId)
{ {
//Owner Flag //Owner Flag
tempByte |= (byte)LandChannel.LAND_TYPE_OWNED_BY_REQUESTER; tempByte |= (byte)LandChannel.LAND_TYPE_OWNED_BY_REQUESTER;
} }
else if (currentParcelBlock.LandData.IsGroupOwned && remote_client.IsGroupMember(currentParcelBlock.LandData.GroupID))
{
tempByte |= (byte)LandChannel.LAND_TYPE_OWNED_BY_GROUP;
}
else if (currentParcelBlock.LandData.SalePrice > 0 &&
(currentParcelBlock.LandData.AuthBuyerID == UUID.Zero ||
currentParcelBlock.LandData.AuthBuyerID == remote_client.AgentId))
{
//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 else
{ {
//Other Flag //Other Flag
tempByte |= (byte)LandChannel.LAND_TYPE_OWNED_BY_OTHER; tempByte |= (byte)LandChannel.LAND_TYPE_OWNED_BY_OTHER;
} }
if (currentParcelBlock.LandData.IsGroupOwned && remote_client.IsGroupMember(currentParcelBlock.LandData.GroupID)) // now flags
{ // border control
tempByte |= (byte)LandChannel.LAND_TYPE_OWNED_BY_GROUP;
}
if (currentParcelBlock.LandData.SalePrice > 0 &&
(currentParcelBlock.LandData.AuthBuyerID == UUID.Zero ||
currentParcelBlock.LandData.AuthBuyerID == remote_client.AgentId))
{
//Sale Flag
tempByte |= (byte)LandChannel.LAND_TYPE_IS_FOR_SALE;
}
// LAND_TYPE_IS_BEING_AUCTIONED not suported?
//Now for border control
ILandObject westParcel = null; ILandObject westParcel = null;
ILandObject southParcel = null; ILandObject southParcel = null;
@ -1086,27 +1085,29 @@ namespace OpenSim.Region.CoreModules.World.Land
if (x == 0) 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) 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) 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) 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) 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) // if ((currentParcelBlock.LandData.Flags & (uint)ParcelFlags.???hideavatar) != 0)
// tempByte |= (byte)LandChannel.LAND_TYPE_HIDEAVATARS; // tempByte |= (byte)LandChannel.LAND_FLAG_HIDEAVATARS;
byteArray[byteArrayCount] = tempByte; byteArray[byteArrayCount] = tempByte;