change parcel overlay bytes adding LocalSound.. changed others also NEEDS

checking
avinationmerge
UbitUmarov 2014-07-29 00:39:08 +01:00
parent f32bd24a2c
commit 3e1d2df261
3 changed files with 70 additions and 34 deletions

View File

@ -40,23 +40,31 @@ namespace OpenSim.Region.CoreModules.World.Land
//Land types set with flags in ParcelOverlay. //Land types set with flags in ParcelOverlay.
//Only one of these can be used. //Only one of these can be used.
public const float BAN_LINE_SAFETY_HIEGHT = 100; public const float BAN_LINE_SAFETY_HIEGHT = 100;
public const byte LAND_FLAG_PROPERTY_BORDER_SOUTH = 128; //Equals 10000000
public const byte LAND_FLAG_PROPERTY_BORDER_WEST = 64; //Equals 01000000
//RequestResults (I think these are right, they seem to work): //RequestResults (I think these are right, they seem to work):
public const int LAND_RESULT_MULTIPLE = 1; // The request they made contained more than a single peice of land public const int LAND_RESULT_MULTIPLE = 1; // The request they made contained more than a single peice of land
public const int LAND_RESULT_SINGLE = 0; // The request they made contained only a single piece of land public const int LAND_RESULT_SINGLE = 0; // The request they made contained only a single piece of land
//ParcelSelectObjects //ParcelSelectObjects
public const int LAND_SELECT_OBJECTS_OWNER = 2;
public const int LAND_SELECT_OBJECTS_GROUP = 4; public const int LAND_SELECT_OBJECTS_GROUP = 4;
public const int LAND_SELECT_OBJECTS_OTHER = 8; public const int LAND_SELECT_OBJECTS_OTHER = 8;
public const int LAND_SELECT_OBJECTS_OWNER = 2;
public const byte LAND_TYPE_IS_BEING_AUCTIONED = 5; //Equals 00000101
public const byte LAND_TYPE_IS_FOR_SALE = 4; //Equals 00000100
public const byte LAND_TYPE_OWNED_BY_GROUP = 2; //Equals 00000010
public const byte LAND_TYPE_OWNED_BY_OTHER = 1; //Equals 00000001
public const byte LAND_TYPE_OWNED_BY_REQUESTER = 3; //Equals 00000011
public const byte LAND_TYPE_PUBLIC = 0; //Equals 00000000 public const byte LAND_TYPE_PUBLIC = 0; //Equals 00000000
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
public const byte LAND_TYPE_IS_FOR_SALE = 4; //Equals 00000100
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
//These are other constants. Yay! //These are other constants. Yay!
public const int START_LAND_LOCAL_ID = 1; public const int START_LAND_LOCAL_ID = 1;

View File

@ -1040,33 +1040,37 @@ namespace OpenSim.Region.CoreModules.World.Land
if (currentParcelBlock != null) if (currentParcelBlock != null)
{ {
if (currentParcelBlock.LandData.OwnerID == remote_client.AgentId) if (currentParcelBlock.LandData.OwnerID == UUID.Zero)
{
//Owner Flag
tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_OWNED_BY_REQUESTER);
}
else if (currentParcelBlock.LandData.IsGroupOwned && remote_client.IsGroupMember(currentParcelBlock.LandData.GroupID))
{
tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_OWNED_BY_GROUP);
}
else if (currentParcelBlock.LandData.SalePrice > 0 &&
(currentParcelBlock.LandData.AuthBuyerID == UUID.Zero ||
currentParcelBlock.LandData.AuthBuyerID == remote_client.AgentId))
{
//Sale Flag
tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_IS_FOR_SALE);
}
else if (currentParcelBlock.LandData.OwnerID == UUID.Zero)
{ {
//Public Flag //Public Flag
tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_PUBLIC); tempByte |= (byte)LandChannel.LAND_TYPE_PUBLIC; // this does nothing
}
else if (currentParcelBlock.LandData.OwnerID == remote_client.AgentId)
{
//Owner Flag
tempByte |= (byte)LandChannel.LAND_TYPE_OWNED_BY_REQUESTER;
} }
else else
{ {
//Other Flag //Other Flag
tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_OWNED_BY_OTHER); tempByte |= (byte)LandChannel.LAND_TYPE_OWNED_BY_OTHER;
} }
if (currentParcelBlock.LandData.IsGroupOwned && remote_client.IsGroupMember(currentParcelBlock.LandData.GroupID))
{
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 //Now for border control
ILandObject westParcel = null; ILandObject westParcel = null;
@ -1082,22 +1086,29 @@ namespace OpenSim.Region.CoreModules.World.Land
if (x == 0) if (x == 0)
{ {
tempByte = Convert.ToByte(tempByte | LandChannel.LAND_FLAG_PROPERTY_BORDER_WEST); tempByte |= (byte)LandChannel.LAND_TYPE_PROPERTY_BORDER_WEST;
} }
else if (westParcel != null && westParcel != currentParcelBlock) else if (westParcel != null && westParcel != currentParcelBlock)
{ {
tempByte = Convert.ToByte(tempByte | LandChannel.LAND_FLAG_PROPERTY_BORDER_WEST); tempByte |= (byte)LandChannel.LAND_TYPE_PROPERTY_BORDER_WEST;
} }
if (y == 0) if (y == 0)
{ {
tempByte = Convert.ToByte(tempByte | LandChannel.LAND_FLAG_PROPERTY_BORDER_SOUTH); tempByte |= (byte)LandChannel.LAND_TYPE_PROPERTY_BORDER_SOUTH;
} }
else if (southParcel != null && southParcel != currentParcelBlock) else if (southParcel != null && southParcel != currentParcelBlock)
{ {
tempByte = Convert.ToByte(tempByte | LandChannel.LAND_FLAG_PROPERTY_BORDER_SOUTH); tempByte |= (byte)LandChannel.LAND_TYPE_PROPERTY_BORDER_SOUTH;
} }
if ((currentParcelBlock.LandData.Flags & (uint)ParcelFlags.SoundLocal) != 0)
tempByte |= (byte)LandChannel.LAND_TYPE_LOCALSOUND;
// if ((currentParcelBlock.LandData.Flags & (uint)ParcelFlags.???hideavatar) != 0)
// tempByte |= (byte)LandChannel.LAND_TYPE_HIDEAVATARS;
byteArray[byteArrayCount] = tempByte; byteArray[byteArrayCount] = tempByte;
byteArrayCount++; byteArrayCount++;
if (byteArrayCount >= LAND_BLOCKS_PER_PACKET) if (byteArrayCount >= LAND_BLOCKS_PER_PACKET)

View File

@ -895,13 +895,31 @@ namespace OpenSim.Region.CoreModules.World.Land
private byte[] ConvertLandBitmapToBytes() private byte[] ConvertLandBitmapToBytes()
{ {
byte[] tempConvertArr = new byte[512]; byte[] tempConvertArr = new byte[512];
byte tempByte = 0; int tempByte = 0;
int x, y, i, byteNum = 0; int x, y, i, byteNum = 0;
int mask = 1;
i = 0; i = 0;
for (y = 0; y < 64; y++) for (y = 0; y < 64; y++)
{ {
for (x = 0; x < 64; x++) for (x = 0; x < 64; x++)
{ {
if (LandBitmap[x, y])
tempByte |= mask;
mask = mask << 1;
if (mask == 0x100)
{
mask = 1;
tempConvertArr[byteNum++] = (byte)tempByte;
tempByte = 0;
}
}
}
if(tempByte != 0 && byteNum < 512)
tempConvertArr[byteNum] = (byte)tempByte;
/*
tempByte = Convert.ToByte(tempByte | Convert.ToByte(LandBitmap[x, y]) << (i++ % 8)); tempByte = Convert.ToByte(tempByte | Convert.ToByte(LandBitmap[x, y]) << (i++ % 8));
if (i % 8 == 0) if (i % 8 == 0)
{ {
@ -910,8 +928,7 @@ namespace OpenSim.Region.CoreModules.World.Land
i = 0; i = 0;
byteNum++; byteNum++;
} }
} */
}
return tempConvertArr; return tempConvertArr;
} }