aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World/Land/LandObject.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Land/LandObject.cs')
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandObject.cs84
1 files changed, 2 insertions, 82 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
index 3b81d6b..040c90b 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
@@ -46,20 +46,12 @@ namespace OpenSim.Region.CoreModules.World.Land
46 46
47 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 47 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
48 private static readonly string LogHeader = "[LAND OBJECT]"; 48 private static readonly string LogHeader = "[LAND OBJECT]";
49<<<<<<< HEAD
50
51 private readonly int landUnit = 4;
52
53 private int m_lastSeqId = 0;
54
55=======
56 49
57 private readonly int landUnit = 4; 50 private readonly int landUnit = 4;
58 51
59 private int m_lastSeqId = 0; 52 private int m_lastSeqId = 0;
60 private int m_expiryCounter = 0; 53 private int m_expiryCounter = 0;
61 54
62>>>>>>> avn/ubitvar
63 protected Scene m_scene; 55 protected Scene m_scene;
64 protected List<SceneObjectGroup> primsOverMe = new List<SceneObjectGroup>(); 56 protected List<SceneObjectGroup> primsOverMe = new List<SceneObjectGroup>();
65 protected Dictionary<uint, UUID> m_listTransactions = new Dictionary<uint, UUID>(); 57 protected Dictionary<uint, UUID> m_listTransactions = new Dictionary<uint, UUID>();
@@ -67,16 +59,12 @@ namespace OpenSim.Region.CoreModules.World.Land
67 protected ExpiringCache<UUID, bool> m_groupMemberCache = new ExpiringCache<UUID, bool>(); 59 protected ExpiringCache<UUID, bool> m_groupMemberCache = new ExpiringCache<UUID, bool>();
68 protected TimeSpan m_groupMemberCacheTimeout = TimeSpan.FromSeconds(30); // cache invalidation after 30 seconds 60 protected TimeSpan m_groupMemberCacheTimeout = TimeSpan.FromSeconds(30); // cache invalidation after 30 seconds
69 61
70<<<<<<< HEAD
71 public bool[,] LandBitmap { get; set; }
72=======
73 private bool[,] m_landBitmap; 62 private bool[,] m_landBitmap;
74 public bool[,] LandBitmap 63 public bool[,] LandBitmap
75 { 64 {
76 get { return m_landBitmap; } 65 get { return m_landBitmap; }
77 set { m_landBitmap = value; } 66 set { m_landBitmap = value; }
78 } 67 }
79>>>>>>> avn/ubitvar
80 68
81 #endregion 69 #endregion
82 70
@@ -87,9 +75,6 @@ namespace OpenSim.Region.CoreModules.World.Land
87 return free; 75 return free;
88 } 76 }
89 77
90<<<<<<< HEAD
91 public LandData LandData { get; set; }
92=======
93 protected LandData m_landData; 78 protected LandData m_landData;
94 public LandData LandData 79 public LandData LandData
95 { 80 {
@@ -97,7 +82,6 @@ namespace OpenSim.Region.CoreModules.World.Land
97 82
98 set { m_landData = value; } 83 set { m_landData = value; }
99 } 84 }
100>>>>>>> avn/ubitvar
101 85
102 public IPrimCounts PrimCounts { get; set; } 86 public IPrimCounts PrimCounts { get; set; }
103 87
@@ -225,12 +209,6 @@ namespace OpenSim.Region.CoreModules.World.Land
225 else 209 else
226 { 210 {
227 // Normal Calculations 211 // Normal Calculations
228<<<<<<< HEAD
229 int parcelMax = (int)(((float)LandData.Area / (m_scene.RegionInfo.RegionSizeX * m_scene.RegionInfo.RegionSizeY))
230 * (float)m_scene.RegionInfo.ObjectCapacity
231 * (float)m_scene.RegionInfo.RegionSettings.ObjectBonus);
232 // TODO: The calculation of ObjectBonus should be refactored. It does still not work in the same manner as SL!
233=======
234 int parcelMax = (int)( (long)LandData.Area 212 int parcelMax = (int)( (long)LandData.Area
235 * (long)m_scene.RegionInfo.ObjectCapacity 213 * (long)m_scene.RegionInfo.ObjectCapacity
236 * (long)m_scene.RegionInfo.RegionSettings.ObjectBonus 214 * (long)m_scene.RegionInfo.RegionSettings.ObjectBonus
@@ -252,7 +230,6 @@ namespace OpenSim.Region.CoreModules.World.Land
252 int parcelMax = (int)((long)LandData.Area 230 int parcelMax = (int)((long)LandData.Area
253 * (long)m_scene.RegionInfo.ObjectCapacity 231 * (long)m_scene.RegionInfo.ObjectCapacity
254 / 65536L); 232 / 65536L);
255>>>>>>> avn/ubitvar
256 return parcelMax; 233 return parcelMax;
257 } 234 }
258 } 235 }
@@ -266,15 +243,10 @@ namespace OpenSim.Region.CoreModules.World.Land
266 else 243 else
267 { 244 {
268 //Normal Calculations 245 //Normal Calculations
269<<<<<<< HEAD
270 int simMax = (int)(((float)LandData.SimwideArea / (m_scene.RegionInfo.RegionSizeX * m_scene.RegionInfo.RegionSizeY))
271 * (float)m_scene.RegionInfo.ObjectCapacity);
272=======
273 int simMax = (int)( (long)LandData.SimwideArea 246 int simMax = (int)( (long)LandData.SimwideArea
274 * (long)m_scene.RegionInfo.ObjectCapacity 247 * (long)m_scene.RegionInfo.ObjectCapacity
275 / (long)(m_scene.RegionInfo.RegionSizeX * m_scene.RegionInfo.RegionSizeY) ); 248 / (long)(m_scene.RegionInfo.RegionSizeX * m_scene.RegionInfo.RegionSizeY) );
276 // m_log.DebugFormat("Simwide Area: {0}, Capacity {1}, SimMax {2}", LandData.SimwideArea, m_scene.RegionInfo.ObjectCapacity, simMax); 249 // m_log.DebugFormat("Simwide Area: {0}, Capacity {1}, SimMax {2}", LandData.SimwideArea, m_scene.RegionInfo.ObjectCapacity, simMax);
277>>>>>>> avn/ubitvar
278 return simMax; 250 return simMax;
279 } 251 }
280 } 252 }
@@ -439,12 +411,6 @@ namespace OpenSim.Region.CoreModules.World.Land
439 { 411 {
440 uint preserve = LandData.Flags & ~allowedDelta; 412 uint preserve = LandData.Flags & ~allowedDelta;
441 newData.Flags = preserve | (args.ParcelFlags & allowedDelta); 413 newData.Flags = preserve | (args.ParcelFlags & allowedDelta);
442<<<<<<< HEAD
443
444 m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData);
445 SendLandUpdateToAvatarsOverMe(snap_selection);
446 }
447=======
448 414
449 uint curdelta = LandData.Flags ^ newData.Flags; 415 uint curdelta = LandData.Flags ^ newData.Flags;
450 curdelta &= (uint)(ParcelFlags.SoundLocal); 416 curdelta &= (uint)(ParcelFlags.SoundLocal);
@@ -456,7 +422,6 @@ namespace OpenSim.Region.CoreModules.World.Land
456 return true; 422 return true;
457 } 423 }
458 return false; 424 return false;
459>>>>>>> avn/ubitvar
460 } 425 }
461 426
462 public void UpdateLandSold(UUID avatarID, UUID groupID, bool groupOwned, uint AuctionID, int claimprice, int area) 427 public void UpdateLandSold(UUID avatarID, UUID groupID, bool groupOwned, uint AuctionID, int claimprice, int area)
@@ -806,17 +771,11 @@ namespace OpenSim.Region.CoreModules.World.Land
806 /// </summary> 771 /// </summary>
807 private void UpdateAABBAndAreaValues() 772 private void UpdateAABBAndAreaValues()
808 { 773 {
809<<<<<<< HEAD 774
810 int min_x = 10000;
811 int min_y = 10000;
812 int max_x = 0;
813 int max_y = 0;
814=======
815 int min_x = Int32.MaxValue; 775 int min_x = Int32.MaxValue;
816 int min_y = Int32.MaxValue; 776 int min_y = Int32.MaxValue;
817 int max_x = Int32.MinValue; 777 int max_x = Int32.MinValue;
818 int max_y = Int32.MinValue; 778 int max_y = Int32.MinValue;
819>>>>>>> avn/ubitvar
820 int tempArea = 0; 779 int tempArea = 0;
821 int x, y; 780 int x, y;
822 for (x = 0; x < LandBitmap.GetLength(0); x++) 781 for (x = 0; x < LandBitmap.GetLength(0); x++)
@@ -825,12 +784,6 @@ namespace OpenSim.Region.CoreModules.World.Land
825 { 784 {
826 if (LandBitmap[x, y] == true) 785 if (LandBitmap[x, y] == true)
827 { 786 {
828<<<<<<< HEAD
829 if (min_x > x) min_x = x;
830 if (min_y > y) min_y = y;
831 if (max_x < x) max_x = x;
832 if (max_y < y) max_y = y;
833=======
834 if (min_x > x) 787 if (min_x > x)
835 min_x = x; 788 min_x = x;
836 if (min_y > y) 789 if (min_y > y)
@@ -839,7 +792,6 @@ namespace OpenSim.Region.CoreModules.World.Land
839 max_x = x; 792 max_x = x;
840 if (max_y < y) 793 if (max_y < y)
841 max_y = y; 794 max_y = y;
842>>>>>>> avn/ubitvar
843 tempArea += landUnit * landUnit; //16sqm peice of land 795 tempArea += landUnit * landUnit; //16sqm peice of land
844 } 796 }
845 } 797 }
@@ -847,27 +799,6 @@ namespace OpenSim.Region.CoreModules.World.Land
847 int tx = min_x * landUnit; 799 int tx = min_x * landUnit;
848 if (tx > ((int)m_scene.RegionInfo.RegionSizeX - 1)) 800 if (tx > ((int)m_scene.RegionInfo.RegionSizeX - 1))
849 tx = ((int)m_scene.RegionInfo.RegionSizeX - 1); 801 tx = ((int)m_scene.RegionInfo.RegionSizeX - 1);
850<<<<<<< HEAD
851 int ty = min_y * landUnit;
852 if (ty > ((int)m_scene.RegionInfo.RegionSizeY - 1))
853 ty = ((int)m_scene.RegionInfo.RegionSizeY - 1);
854
855 LandData.AABBMin =
856 new Vector3(
857 (float)(min_x * landUnit), (float)(min_y * landUnit), m_scene != null ? (float)m_scene.Heightmap[tx, ty] : 0);
858
859 tx = max_x * landUnit;
860 if (tx > ((int)m_scene.RegionInfo.RegionSizeX - 1))
861 tx = ((int)m_scene.RegionInfo.RegionSizeX - 1);
862 ty = max_y * landUnit;
863 if (ty > ((int)m_scene.RegionInfo.RegionSizeY - 1))
864 ty = ((int)m_scene.RegionInfo.RegionSizeY - 1);
865
866 LandData.AABBMax
867 = new Vector3(
868 (float)(max_x * landUnit), (float)(max_y * landUnit), m_scene != null ? (float)m_scene.Heightmap[tx, ty] : 0);
869=======
870
871 int htx; 802 int htx;
872 if (tx >= ((int)m_scene.RegionInfo.RegionSizeX)) 803 if (tx >= ((int)m_scene.RegionInfo.RegionSizeX))
873 htx = (int)m_scene.RegionInfo.RegionSizeX - 1; 804 htx = (int)m_scene.RegionInfo.RegionSizeX - 1;
@@ -904,7 +835,6 @@ namespace OpenSim.Region.CoreModules.World.Land
904 LandData.AABBMax 835 LandData.AABBMax
905 = new Vector3( 836 = new Vector3(
906 (float)(tx), (float)(ty), m_scene != null ? (float)m_scene.Heightmap[htx, hty] : 0); 837 (float)(tx), (float)(ty), m_scene != null ? (float)m_scene.Heightmap[htx, hty] : 0);
907>>>>>>> avn/ubitvar
908 838
909 LandData.Area = tempArea; 839 LandData.Area = tempArea;
910 } 840 }
@@ -920,10 +850,6 @@ namespace OpenSim.Region.CoreModules.World.Land
920 public void SetLandBitmap(bool[,] bitmap) 850 public void SetLandBitmap(bool[,] bitmap)
921 { 851 {
922 LandBitmap = bitmap; 852 LandBitmap = bitmap;
923<<<<<<< HEAD
924 // m_log.DebugFormat("{0} SetLandBitmap. BitmapSize=<{1},{2}>", LogHeader, LandBitmap.GetLength(0), LandBitmap.GetLength(1));
925=======
926>>>>>>> avn/ubitvar
927 ForceUpdateLandInfo(); 853 ForceUpdateLandInfo();
928 } 854 }
929 855
@@ -1024,16 +950,11 @@ namespace OpenSim.Region.CoreModules.World.Land
1024 private byte[] ConvertLandBitmapToBytes() 950 private byte[] ConvertLandBitmapToBytes()
1025 { 951 {
1026 byte[] tempConvertArr = new byte[LandBitmap.GetLength(0) * LandBitmap.GetLength(1) / 8]; 952 byte[] tempConvertArr = new byte[LandBitmap.GetLength(0) * LandBitmap.GetLength(1) / 8];
1027<<<<<<< HEAD 953
1028 byte tempByte = 0;
1029 int byteNum = 0;
1030 int i = 0;
1031=======
1032 int tempByte = 0; 954 int tempByte = 0;
1033 int i, byteNum = 0; 955 int i, byteNum = 0;
1034 int mask = 1; 956 int mask = 1;
1035 i = 0; 957 i = 0;
1036>>>>>>> avn/ubitvar
1037 for (int y = 0; y < LandBitmap.GetLength(1); y++) 958 for (int y = 0; y < LandBitmap.GetLength(1); y++)
1038 { 959 {
1039 for (int x = 0; x < LandBitmap.GetLength(0); x++) 960 for (int x = 0; x < LandBitmap.GetLength(0); x++)
@@ -1070,7 +991,6 @@ namespace OpenSim.Region.CoreModules.World.Land
1070 // LogHeader, LandBitmap.GetLength(0), LandBitmap.GetLength(1)); 991 // LogHeader, LandBitmap.GetLength(0), LandBitmap.GetLength(1));
1071======= 992=======
1072 */ 993 */
1073>>>>>>> avn/ubitvar
1074 return tempConvertArr; 994 return tempConvertArr;
1075 } 995 }
1076 996