diff options
3 files changed, 66 insertions, 30 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/LandChannel.cs b/OpenSim/Region/CoreModules/World/Land/LandChannel.cs index 73c592d..faaf41c 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandChannel.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandChannel.cs | |||
@@ -40,23 +40,31 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
40 | //Land types set with flags in ParcelOverlay. | 40 | //Land types set with flags in ParcelOverlay. |
41 | //Only one of these can be used. | 41 | //Only one of these can be used. |
42 | public const float BAN_LINE_SAFETY_HIEGHT = 100; | 42 | public const float BAN_LINE_SAFETY_HIEGHT = 100; |
43 | public const byte LAND_FLAG_PROPERTY_BORDER_SOUTH = 128; //Equals 10000000 | ||
44 | public const byte LAND_FLAG_PROPERTY_BORDER_WEST = 64; //Equals 01000000 | ||
45 | 43 | ||
46 | //RequestResults (I think these are right, they seem to work): | 44 | //RequestResults (I think these are right, they seem to work): |
47 | public const int LAND_RESULT_MULTIPLE = 1; // The request they made contained more than a single peice of land | 45 | public const int LAND_RESULT_MULTIPLE = 1; // The request they made contained more than a single peice of land |
48 | public const int LAND_RESULT_SINGLE = 0; // The request they made contained only a single piece of land | 46 | public const int LAND_RESULT_SINGLE = 0; // The request they made contained only a single piece of land |
49 | 47 | ||
50 | //ParcelSelectObjects | 48 | //ParcelSelectObjects |
49 | public const int LAND_SELECT_OBJECTS_OWNER = 2; | ||
51 | public const int LAND_SELECT_OBJECTS_GROUP = 4; | 50 | public const int LAND_SELECT_OBJECTS_GROUP = 4; |
52 | public const int LAND_SELECT_OBJECTS_OTHER = 8; | 51 | public const int LAND_SELECT_OBJECTS_OTHER = 8; |
53 | public const int LAND_SELECT_OBJECTS_OWNER = 2; | 52 | |
54 | public const byte LAND_TYPE_IS_BEING_AUCTIONED = 5; //Equals 00000101 | 53 | |
55 | public const byte LAND_TYPE_IS_FOR_SALE = 4; //Equals 00000100 | 54 | public const byte LAND_TYPE_PUBLIC = 0; //Equals 00000000 |
56 | public const byte LAND_TYPE_OWNED_BY_GROUP = 2; //Equals 00000010 | ||
57 | public const byte LAND_TYPE_OWNED_BY_OTHER = 1; //Equals 00000001 | 55 | public const byte LAND_TYPE_OWNED_BY_OTHER = 1; //Equals 00000001 |
56 | public const byte LAND_TYPE_OWNED_BY_GROUP = 2; //Equals 00000010 | ||
58 | public const byte LAND_TYPE_OWNED_BY_REQUESTER = 3; //Equals 00000011 | 57 | public const byte LAND_TYPE_OWNED_BY_REQUESTER = 3; //Equals 00000011 |
59 | public const byte LAND_TYPE_PUBLIC = 0; //Equals 00000000 | 58 | public const byte LAND_TYPE_IS_FOR_SALE = 4; //Equals 00000100 |
59 | public const byte LAND_TYPE_IS_BEING_AUCTIONED = 5; //Equals 00000101 | ||
60 | public const byte LAND_TYPE_unused6 = 6; | ||
61 | public const byte LAND_TYPE_unused7 = 7; | ||
62 | public const byte LAND_TYPE_unused8 = 8; | ||
63 | public const byte LAND_TYPE_HIDEAVATARS = 0x10; | ||
64 | public const byte LAND_TYPE_LOCALSOUND = 0x20; | ||
65 | public const byte LAND_TYPE_PROPERTY_BORDER_WEST = 0x40; //Equals 01000000 | ||
66 | public const byte LAND_TYPE_PROPERTY_BORDER_SOUTH = 0x80; //Equals 10000000 | ||
67 | |||
60 | 68 | ||
61 | //These are other constants. Yay! | 69 | //These are other constants. Yay! |
62 | public const int START_LAND_LOCAL_ID = 1; | 70 | public const int START_LAND_LOCAL_ID = 1; |
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 0e2aba9..834448c 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | |||
@@ -1040,33 +1040,37 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1040 | 1040 | ||
1041 | if (currentParcelBlock != null) | 1041 | if (currentParcelBlock != null) |
1042 | { | 1042 | { |
1043 | if (currentParcelBlock.LandData.OwnerID == remote_client.AgentId) | 1043 | if (currentParcelBlock.LandData.OwnerID == UUID.Zero) |
1044 | { | 1044 | { |
1045 | //Owner Flag | 1045 | //Public Flag |
1046 | tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_OWNED_BY_REQUESTER); | 1046 | tempByte |= (byte)LandChannel.LAND_TYPE_PUBLIC; // this does nothing |
1047 | } | 1047 | } |
1048 | else if (currentParcelBlock.LandData.IsGroupOwned && remote_client.IsGroupMember(currentParcelBlock.LandData.GroupID)) | 1048 | else if (currentParcelBlock.LandData.OwnerID == remote_client.AgentId) |
1049 | { | 1049 | { |
1050 | tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_OWNED_BY_GROUP); | 1050 | //Owner Flag |
1051 | tempByte |= (byte)LandChannel.LAND_TYPE_OWNED_BY_REQUESTER; | ||
1051 | } | 1052 | } |
1052 | else if (currentParcelBlock.LandData.SalePrice > 0 && | 1053 | else |
1053 | (currentParcelBlock.LandData.AuthBuyerID == UUID.Zero || | ||
1054 | currentParcelBlock.LandData.AuthBuyerID == remote_client.AgentId)) | ||
1055 | { | 1054 | { |
1056 | //Sale Flag | 1055 | //Other Flag |
1057 | tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_IS_FOR_SALE); | 1056 | tempByte |= (byte)LandChannel.LAND_TYPE_OWNED_BY_OTHER; |
1058 | } | 1057 | } |
1059 | else if (currentParcelBlock.LandData.OwnerID == UUID.Zero) | 1058 | |
1059 | if (currentParcelBlock.LandData.IsGroupOwned && remote_client.IsGroupMember(currentParcelBlock.LandData.GroupID)) | ||
1060 | { | 1060 | { |
1061 | //Public Flag | 1061 | tempByte |= (byte)LandChannel.LAND_TYPE_OWNED_BY_GROUP; |
1062 | tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_PUBLIC); | ||
1063 | } | 1062 | } |
1064 | else | 1063 | |
1064 | if (currentParcelBlock.LandData.SalePrice > 0 && | ||
1065 | (currentParcelBlock.LandData.AuthBuyerID == UUID.Zero || | ||
1066 | currentParcelBlock.LandData.AuthBuyerID == remote_client.AgentId)) | ||
1065 | { | 1067 | { |
1066 | //Other Flag | 1068 | //Sale Flag |
1067 | tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_OWNED_BY_OTHER); | 1069 | tempByte |= (byte)LandChannel.LAND_TYPE_IS_FOR_SALE; |
1068 | } | 1070 | } |
1069 | 1071 | ||
1072 | // LAND_TYPE_IS_BEING_AUCTIONED not suported? | ||
1073 | |||
1070 | //Now for border control | 1074 | //Now for border control |
1071 | 1075 | ||
1072 | ILandObject westParcel = null; | 1076 | ILandObject westParcel = null; |
@@ -1082,22 +1086,29 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1082 | 1086 | ||
1083 | if (x == 0) | 1087 | if (x == 0) |
1084 | { | 1088 | { |
1085 | tempByte = Convert.ToByte(tempByte | LandChannel.LAND_FLAG_PROPERTY_BORDER_WEST); | 1089 | tempByte |= (byte)LandChannel.LAND_TYPE_PROPERTY_BORDER_WEST; |
1086 | } | 1090 | } |
1087 | else if (westParcel != null && westParcel != currentParcelBlock) | 1091 | else if (westParcel != null && westParcel != currentParcelBlock) |
1088 | { | 1092 | { |
1089 | tempByte = Convert.ToByte(tempByte | LandChannel.LAND_FLAG_PROPERTY_BORDER_WEST); | 1093 | tempByte |= (byte)LandChannel.LAND_TYPE_PROPERTY_BORDER_WEST; |
1090 | } | 1094 | } |
1091 | 1095 | ||
1092 | if (y == 0) | 1096 | if (y == 0) |
1093 | { | 1097 | { |
1094 | tempByte = Convert.ToByte(tempByte | LandChannel.LAND_FLAG_PROPERTY_BORDER_SOUTH); | 1098 | tempByte |= (byte)LandChannel.LAND_TYPE_PROPERTY_BORDER_SOUTH; |
1095 | } | 1099 | } |
1096 | else if (southParcel != null && southParcel != currentParcelBlock) | 1100 | else if (southParcel != null && southParcel != currentParcelBlock) |
1097 | { | 1101 | { |
1098 | tempByte = Convert.ToByte(tempByte | LandChannel.LAND_FLAG_PROPERTY_BORDER_SOUTH); | 1102 | tempByte |= (byte)LandChannel.LAND_TYPE_PROPERTY_BORDER_SOUTH; |
1099 | } | 1103 | } |
1100 | 1104 | ||
1105 | if ((currentParcelBlock.LandData.Flags & (uint)ParcelFlags.SoundLocal) != 0) | ||
1106 | tempByte |= (byte)LandChannel.LAND_TYPE_LOCALSOUND; | ||
1107 | |||
1108 | // if ((currentParcelBlock.LandData.Flags & (uint)ParcelFlags.???hideavatar) != 0) | ||
1109 | // tempByte |= (byte)LandChannel.LAND_TYPE_HIDEAVATARS; | ||
1110 | |||
1111 | |||
1101 | byteArray[byteArrayCount] = tempByte; | 1112 | byteArray[byteArrayCount] = tempByte; |
1102 | byteArrayCount++; | 1113 | byteArrayCount++; |
1103 | if (byteArrayCount >= LAND_BLOCKS_PER_PACKET) | 1114 | if (byteArrayCount >= LAND_BLOCKS_PER_PACKET) |
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index 74c2144..7321054 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs | |||
@@ -895,13 +895,31 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
895 | private byte[] ConvertLandBitmapToBytes() | 895 | private byte[] ConvertLandBitmapToBytes() |
896 | { | 896 | { |
897 | byte[] tempConvertArr = new byte[512]; | 897 | byte[] tempConvertArr = new byte[512]; |
898 | byte tempByte = 0; | 898 | int tempByte = 0; |
899 | int x, y, i, byteNum = 0; | 899 | int x, y, i, byteNum = 0; |
900 | int mask = 1; | ||
900 | i = 0; | 901 | i = 0; |
901 | for (y = 0; y < 64; y++) | 902 | for (y = 0; y < 64; y++) |
902 | { | 903 | { |
903 | for (x = 0; x < 64; x++) | 904 | for (x = 0; x < 64; x++) |
904 | { | 905 | { |
906 | if (LandBitmap[x, y]) | ||
907 | tempByte |= mask; | ||
908 | mask = mask << 1; | ||
909 | if (mask == 0x100) | ||
910 | { | ||
911 | mask = 1; | ||
912 | tempConvertArr[byteNum++] = (byte)tempByte; | ||
913 | tempByte = 0; | ||
914 | } | ||
915 | } | ||
916 | } | ||
917 | |||
918 | if(tempByte != 0 && byteNum < 512) | ||
919 | tempConvertArr[byteNum] = (byte)tempByte; | ||
920 | |||
921 | |||
922 | /* | ||
905 | tempByte = Convert.ToByte(tempByte | Convert.ToByte(LandBitmap[x, y]) << (i++ % 8)); | 923 | tempByte = Convert.ToByte(tempByte | Convert.ToByte(LandBitmap[x, y]) << (i++ % 8)); |
906 | if (i % 8 == 0) | 924 | if (i % 8 == 0) |
907 | { | 925 | { |
@@ -910,8 +928,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
910 | i = 0; | 928 | i = 0; |
911 | byteNum++; | 929 | byteNum++; |
912 | } | 930 | } |
913 | } | 931 | */ |
914 | } | ||
915 | return tempConvertArr; | 932 | return tempConvertArr; |
916 | } | 933 | } |
917 | 934 | ||