aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World/Land/LandObject.cs
diff options
context:
space:
mode:
authorMelanie2009-10-02 19:03:22 +0100
committerMelanie2009-10-02 19:03:22 +0100
commitce8974539e2de92e0a16a49ae560ecf5aac5e7d3 (patch)
treea8f426b248dd22581c05f786498d6347b62f5825 /OpenSim/Region/CoreModules/World/Land/LandObject.cs
parentMerge branch 'diva-textures-osgrid' into diva-textures (diff)
parentAdded a default for grid services in standalone. (diff)
downloadopensim-SC_OLD-ce8974539e2de92e0a16a49ae560ecf5aac5e7d3.zip
opensim-SC_OLD-ce8974539e2de92e0a16a49ae560ecf5aac5e7d3.tar.gz
opensim-SC_OLD-ce8974539e2de92e0a16a49ae560ecf5aac5e7d3.tar.bz2
opensim-SC_OLD-ce8974539e2de92e0a16a49ae560ecf5aac5e7d3.tar.xz
Merge branch 'master' into diva-textures
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Land/LandObject.cs')
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandObject.cs233
1 files changed, 117 insertions, 116 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
index 3be5f45..b9b7da5 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
@@ -53,7 +53,7 @@ namespace OpenSim.Region.CoreModules.World.Land
53 protected Scene m_scene; 53 protected Scene m_scene;
54 protected List<SceneObjectGroup> primsOverMe = new List<SceneObjectGroup>(); 54 protected List<SceneObjectGroup> primsOverMe = new List<SceneObjectGroup>();
55 55
56 public bool[,] landBitmap 56 public bool[,] LandBitmap
57 { 57 {
58 get { return m_landBitmap; } 58 get { return m_landBitmap; }
59 set { m_landBitmap = value; } 59 set { m_landBitmap = value; }
@@ -63,14 +63,14 @@ namespace OpenSim.Region.CoreModules.World.Land
63 63
64 #region ILandObject Members 64 #region ILandObject Members
65 65
66 public LandData landData 66 public LandData LandData
67 { 67 {
68 get { return m_landData; } 68 get { return m_landData; }
69 69
70 set { m_landData = value; } 70 set { m_landData = value; }
71 } 71 }
72 72
73 public UUID regionUUID 73 public UUID RegionUUID
74 { 74 {
75 get { return m_scene.RegionInfo.RegionID; } 75 get { return m_scene.RegionInfo.RegionID; }
76 } 76 }
@@ -80,8 +80,8 @@ namespace OpenSim.Region.CoreModules.World.Land
80 public LandObject(UUID owner_id, bool is_group_owned, Scene scene) 80 public LandObject(UUID owner_id, bool is_group_owned, Scene scene)
81 { 81 {
82 m_scene = scene; 82 m_scene = scene;
83 landData.OwnerID = owner_id; 83 LandData.OwnerID = owner_id;
84 landData.IsGroupOwned = is_group_owned; 84 LandData.IsGroupOwned = is_group_owned;
85 } 85 }
86 86
87 #endregion 87 #endregion
@@ -96,11 +96,11 @@ namespace OpenSim.Region.CoreModules.World.Land
96 /// <param name="x"></param> 96 /// <param name="x"></param>
97 /// <param name="y"></param> 97 /// <param name="y"></param>
98 /// <returns>Returns true if the piece of land contains the specified point</returns> 98 /// <returns>Returns true if the piece of land contains the specified point</returns>
99 public bool containsPoint(int x, int y) 99 public bool ContainsPoint(int x, int y)
100 { 100 {
101 if (x >= 0 && y >= 0 && x <= Constants.RegionSize && x <= Constants.RegionSize) 101 if (x >= 0 && y >= 0 && x <= Constants.RegionSize && x <= Constants.RegionSize)
102 { 102 {
103 return (landBitmap[x / 4, y / 4] == true); 103 return (LandBitmap[x / 4, y / 4] == true);
104 } 104 }
105 else 105 else
106 { 106 {
@@ -110,11 +110,11 @@ namespace OpenSim.Region.CoreModules.World.Land
110 110
111 public ILandObject Copy() 111 public ILandObject Copy()
112 { 112 {
113 ILandObject newLand = new LandObject(landData.OwnerID, landData.IsGroupOwned, m_scene); 113 ILandObject newLand = new LandObject(LandData.OwnerID, LandData.IsGroupOwned, m_scene);
114 114
115 //Place all new variables here! 115 //Place all new variables here!
116 newLand.landBitmap = (bool[,]) (landBitmap.Clone()); 116 newLand.LandBitmap = (bool[,]) (LandBitmap.Clone());
117 newLand.landData = landData.Copy(); 117 newLand.LandData = LandData.Copy();
118 118
119 return newLand; 119 return newLand;
120 } 120 }
@@ -122,16 +122,16 @@ namespace OpenSim.Region.CoreModules.World.Land
122 static overrideParcelMaxPrimCountDelegate overrideParcelMaxPrimCount; 122 static overrideParcelMaxPrimCountDelegate overrideParcelMaxPrimCount;
123 static overrideSimulatorMaxPrimCountDelegate overrideSimulatorMaxPrimCount; 123 static overrideSimulatorMaxPrimCountDelegate overrideSimulatorMaxPrimCount;
124 124
125 public void setParcelObjectMaxOverride(overrideParcelMaxPrimCountDelegate overrideDel) 125 public void SetParcelObjectMaxOverride(overrideParcelMaxPrimCountDelegate overrideDel)
126 { 126 {
127 overrideParcelMaxPrimCount = overrideDel; 127 overrideParcelMaxPrimCount = overrideDel;
128 } 128 }
129 public void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel) 129 public void SetSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel)
130 { 130 {
131 overrideSimulatorMaxPrimCount = overrideDel; 131 overrideSimulatorMaxPrimCount = overrideDel;
132 } 132 }
133 133
134 public int getParcelMaxPrimCount(ILandObject thisObject) 134 public int GetParcelMaxPrimCount(ILandObject thisObject)
135 { 135 {
136 if (overrideParcelMaxPrimCount != null) 136 if (overrideParcelMaxPrimCount != null)
137 { 137 {
@@ -141,11 +141,11 @@ namespace OpenSim.Region.CoreModules.World.Land
141 { 141 {
142 //Normal Calculations 142 //Normal Calculations
143 return Convert.ToInt32( 143 return Convert.ToInt32(
144 Math.Round((Convert.ToDecimal(landData.Area) / Convert.ToDecimal(65536)) * m_scene.objectCapacity * 144 Math.Round((Convert.ToDecimal(LandData.Area) / Convert.ToDecimal(65536)) * m_scene.objectCapacity *
145 Convert.ToDecimal(m_scene.RegionInfo.RegionSettings.ObjectBonus))); ; 145 Convert.ToDecimal(m_scene.RegionInfo.RegionSettings.ObjectBonus))); ;
146 } 146 }
147 } 147 }
148 public int getSimulatorMaxPrimCount(ILandObject thisObject) 148 public int GetSimulatorMaxPrimCount(ILandObject thisObject)
149 { 149 {
150 if (overrideSimulatorMaxPrimCount != null) 150 if (overrideSimulatorMaxPrimCount != null)
151 { 151 {
@@ -161,7 +161,7 @@ namespace OpenSim.Region.CoreModules.World.Land
161 161
162 #region Packet Request Handling 162 #region Packet Request Handling
163 163
164 public void sendLandProperties(int sequence_id, bool snap_selection, int request_result, IClientAPI remote_client) 164 public void SendLandProperties(int sequence_id, bool snap_selection, int request_result, IClientAPI remote_client)
165 { 165 {
166 IEstateModule estateModule = m_scene.RequestModuleInterface<IEstateModule>(); 166 IEstateModule estateModule = m_scene.RequestModuleInterface<IEstateModule>();
167 uint regionFlags = 336723974 & ~((uint)(RegionFlags.AllowLandmark | RegionFlags.AllowSetHome)); 167 uint regionFlags = 336723974 & ~((uint)(RegionFlags.AllowLandmark | RegionFlags.AllowSetHome));
@@ -175,18 +175,18 @@ namespace OpenSim.Region.CoreModules.World.Land
175// if (landData.OwnerID == remote_client.AgentId) 175// if (landData.OwnerID == remote_client.AgentId)
176// regionFlags |= (uint)RegionFlags.AllowSetHome; 176// regionFlags |= (uint)RegionFlags.AllowSetHome;
177 remote_client.SendLandProperties(sequence_id, 177 remote_client.SendLandProperties(sequence_id,
178 snap_selection, request_result, landData, 178 snap_selection, request_result, LandData,
179 (float)m_scene.RegionInfo.RegionSettings.ObjectBonus, 179 (float)m_scene.RegionInfo.RegionSettings.ObjectBonus,
180 getParcelMaxPrimCount(this), 180 GetParcelMaxPrimCount(this),
181 getSimulatorMaxPrimCount(this), regionFlags); 181 GetSimulatorMaxPrimCount(this), regionFlags);
182 } 182 }
183 183
184 public void updateLandProperties(LandUpdateArgs args, IClientAPI remote_client) 184 public void UpdateLandProperties(LandUpdateArgs args, IClientAPI remote_client)
185 { 185 {
186 if (m_scene.Permissions.CanEditParcel(remote_client.AgentId,this)) 186 if (m_scene.Permissions.CanEditParcel(remote_client.AgentId,this))
187 { 187 {
188 //Needs later group support 188 //Needs later group support
189 LandData newData = landData.Copy(); 189 LandData newData = LandData.Copy();
190 190
191 if (args.AuthBuyerID != newData.AuthBuyerID || args.SalePrice != newData.SalePrice) 191 if (args.AuthBuyerID != newData.AuthBuyerID || args.SalePrice != newData.SalePrice)
192 { 192 {
@@ -212,15 +212,15 @@ namespace OpenSim.Region.CoreModules.World.Land
212 newData.UserLocation = args.UserLocation; 212 newData.UserLocation = args.UserLocation;
213 newData.UserLookAt = args.UserLookAt; 213 newData.UserLookAt = args.UserLookAt;
214 214
215 m_scene.LandChannel.UpdateLandObject(landData.LocalID, newData); 215 m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData);
216 216
217 sendLandUpdateToAvatarsOverMe(); 217 SendLandUpdateToAvatarsOverMe();
218 } 218 }
219 } 219 }
220 220
221 public void updateLandSold(UUID avatarID, UUID groupID, bool groupOwned, uint AuctionID, int claimprice, int area) 221 public void UpdateLandSold(UUID avatarID, UUID groupID, bool groupOwned, uint AuctionID, int claimprice, int area)
222 { 222 {
223 LandData newData = landData.Copy(); 223 LandData newData = LandData.Copy();
224 newData.OwnerID = avatarID; 224 newData.OwnerID = avatarID;
225 newData.GroupID = groupID; 225 newData.GroupID = groupID;
226 newData.IsGroupOwned = groupOwned; 226 newData.IsGroupOwned = groupOwned;
@@ -230,45 +230,45 @@ namespace OpenSim.Region.CoreModules.World.Land
230 newData.SalePrice = 0; 230 newData.SalePrice = 0;
231 newData.AuthBuyerID = UUID.Zero; 231 newData.AuthBuyerID = UUID.Zero;
232 newData.Flags &= ~(uint) (ParcelFlags.ForSale | ParcelFlags.ForSaleObjects | ParcelFlags.SellParcelObjects); 232 newData.Flags &= ~(uint) (ParcelFlags.ForSale | ParcelFlags.ForSaleObjects | ParcelFlags.SellParcelObjects);
233 m_scene.LandChannel.UpdateLandObject(landData.LocalID, newData); 233 m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData);
234 234
235 sendLandUpdateToAvatarsOverMe(); 235 SendLandUpdateToAvatarsOverMe();
236 } 236 }
237 237
238 public void deedToGroup(UUID groupID) 238 public void DeedToGroup(UUID groupID)
239 { 239 {
240 LandData newData = landData.Copy(); 240 LandData newData = LandData.Copy();
241 newData.OwnerID = groupID; 241 newData.OwnerID = groupID;
242 newData.GroupID = groupID; 242 newData.GroupID = groupID;
243 newData.IsGroupOwned = true; 243 newData.IsGroupOwned = true;
244 244
245 m_scene.LandChannel.UpdateLandObject(landData.LocalID, newData); 245 m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData);
246 246
247 sendLandUpdateToAvatarsOverMe(); 247 SendLandUpdateToAvatarsOverMe();
248 } 248 }
249 249
250 public bool isEitherBannedOrRestricted(UUID avatar) 250 public bool IsEitherBannedOrRestricted(UUID avatar)
251 { 251 {
252 if (isBannedFromLand(avatar)) 252 if (IsBannedFromLand(avatar))
253 { 253 {
254 return true; 254 return true;
255 } 255 }
256 else if (isRestrictedFromLand(avatar)) 256 else if (IsRestrictedFromLand(avatar))
257 { 257 {
258 return true; 258 return true;
259 } 259 }
260 return false; 260 return false;
261 } 261 }
262 262
263 public bool isBannedFromLand(UUID avatar) 263 public bool IsBannedFromLand(UUID avatar)
264 { 264 {
265 if ((landData.Flags & (uint) ParcelFlags.UseBanList) > 0) 265 if ((LandData.Flags & (uint) ParcelFlags.UseBanList) > 0)
266 { 266 {
267 ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); 267 ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
268 entry.AgentID = avatar; 268 entry.AgentID = avatar;
269 entry.Flags = AccessList.Ban; 269 entry.Flags = AccessList.Ban;
270 entry.Time = new DateTime(); 270 entry.Time = new DateTime();
271 if (landData.ParcelAccessList.Contains(entry)) 271 if (LandData.ParcelAccessList.Contains(entry))
272 { 272 {
273 //They are banned, so lets send them a notice about this parcel 273 //They are banned, so lets send them a notice about this parcel
274 return true; 274 return true;
@@ -277,15 +277,15 @@ namespace OpenSim.Region.CoreModules.World.Land
277 return false; 277 return false;
278 } 278 }
279 279
280 public bool isRestrictedFromLand(UUID avatar) 280 public bool IsRestrictedFromLand(UUID avatar)
281 { 281 {
282 if ((landData.Flags & (uint) ParcelFlags.UseAccessList) > 0) 282 if ((LandData.Flags & (uint) ParcelFlags.UseAccessList) > 0)
283 { 283 {
284 ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); 284 ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
285 entry.AgentID = avatar; 285 entry.AgentID = avatar;
286 entry.Flags = AccessList.Access; 286 entry.Flags = AccessList.Access;
287 entry.Time = new DateTime(); 287 entry.Time = new DateTime();
288 if (!landData.ParcelAccessList.Contains(entry)) 288 if (!LandData.ParcelAccessList.Contains(entry))
289 { 289 {
290 //They are not allowed in this parcel, but not banned, so lets send them a notice about this parcel 290 //They are not allowed in this parcel, but not banned, so lets send them a notice about this parcel
291 return true; 291 return true;
@@ -294,12 +294,12 @@ namespace OpenSim.Region.CoreModules.World.Land
294 return false; 294 return false;
295 } 295 }
296 296
297 public void sendLandUpdateToClient(IClientAPI remote_client) 297 public void SendLandUpdateToClient(IClientAPI remote_client)
298 { 298 {
299 sendLandProperties(0, false, 0, remote_client); 299 SendLandProperties(0, false, 0, remote_client);
300 } 300 }
301 301
302 public void sendLandUpdateToAvatarsOverMe() 302 public void SendLandUpdateToAvatarsOverMe()
303 { 303 {
304 List<ScenePresence> avatars = m_scene.GetAvatars(); 304 List<ScenePresence> avatars = m_scene.GetAvatars();
305 ILandObject over = null; 305 ILandObject over = null;
@@ -319,14 +319,15 @@ namespace OpenSim.Region.CoreModules.World.Land
319 319
320 if (over != null) 320 if (over != null)
321 { 321 {
322 if (over.landData.LocalID == landData.LocalID) 322 if (over.LandData.LocalID == LandData.LocalID)
323 { 323 {
324 if (((over.landData.Flags & (uint)ParcelFlags.AllowDamage) != 0) && m_scene.RegionInfo.RegionSettings.AllowDamage) 324 if (((over.LandData.Flags & (uint)ParcelFlags.AllowDamage) != 0) &&
325 m_scene.RegionInfo.RegionSettings.AllowDamage)
325 avatars[i].Invulnerable = false; 326 avatars[i].Invulnerable = false;
326 else 327 else
327 avatars[i].Invulnerable = true; 328 avatars[i].Invulnerable = true;
328 329
329 sendLandUpdateToClient(avatars[i].ControllingClient); 330 SendLandUpdateToClient(avatars[i].ControllingClient);
330 } 331 }
331 } 332 }
332 } 333 }
@@ -336,10 +337,10 @@ namespace OpenSim.Region.CoreModules.World.Land
336 337
337 #region AccessList Functions 338 #region AccessList Functions
338 339
339 public List<UUID> createAccessListArrayByFlag(AccessList flag) 340 public List<UUID> CreateAccessListArrayByFlag(AccessList flag)
340 { 341 {
341 List<UUID> list = new List<UUID>(); 342 List<UUID> list = new List<UUID>();
342 foreach (ParcelManager.ParcelAccessEntry entry in landData.ParcelAccessList) 343 foreach (ParcelManager.ParcelAccessEntry entry in LandData.ParcelAccessList)
343 { 344 {
344 if (entry.Flags == flag) 345 if (entry.Flags == flag)
345 { 346 {
@@ -354,26 +355,26 @@ namespace OpenSim.Region.CoreModules.World.Land
354 return list; 355 return list;
355 } 356 }
356 357
357 public void sendAccessList(UUID agentID, UUID sessionID, uint flags, int sequenceID, 358 public void SendAccessList(UUID agentID, UUID sessionID, uint flags, int sequenceID,
358 IClientAPI remote_client) 359 IClientAPI remote_client)
359 { 360 {
360 361
361 if (flags == (uint) AccessList.Access || flags == (uint) AccessList.Both) 362 if (flags == (uint) AccessList.Access || flags == (uint) AccessList.Both)
362 { 363 {
363 List<UUID> avatars = createAccessListArrayByFlag(AccessList.Access); 364 List<UUID> avatars = CreateAccessListArrayByFlag(AccessList.Access);
364 remote_client.SendLandAccessListData(avatars,(uint) AccessList.Access,landData.LocalID); 365 remote_client.SendLandAccessListData(avatars,(uint) AccessList.Access,LandData.LocalID);
365 } 366 }
366 367
367 if (flags == (uint) AccessList.Ban || flags == (uint) AccessList.Both) 368 if (flags == (uint) AccessList.Ban || flags == (uint) AccessList.Both)
368 { 369 {
369 List<UUID> avatars = createAccessListArrayByFlag(AccessList.Ban); 370 List<UUID> avatars = CreateAccessListArrayByFlag(AccessList.Ban);
370 remote_client.SendLandAccessListData(avatars, (uint)AccessList.Ban, landData.LocalID); 371 remote_client.SendLandAccessListData(avatars, (uint)AccessList.Ban, LandData.LocalID);
371 } 372 }
372 } 373 }
373 374
374 public void updateAccessList(uint flags, List<ParcelManager.ParcelAccessEntry> entries, IClientAPI remote_client) 375 public void UpdateAccessList(uint flags, List<ParcelManager.ParcelAccessEntry> entries, IClientAPI remote_client)
375 { 376 {
376 LandData newData = landData.Copy(); 377 LandData newData = LandData.Copy();
377 378
378 if (entries.Count == 1 && entries[0].AgentID == UUID.Zero) 379 if (entries.Count == 1 && entries[0].AgentID == UUID.Zero)
379 { 380 {
@@ -406,36 +407,36 @@ namespace OpenSim.Region.CoreModules.World.Land
406 } 407 }
407 } 408 }
408 409
409 m_scene.LandChannel.UpdateLandObject(landData.LocalID, newData); 410 m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData);
410 } 411 }
411 412
412 #endregion 413 #endregion
413 414
414 #region Update Functions 415 #region Update Functions
415 416
416 public void updateLandBitmapByteArray() 417 public void UpdateLandBitmapByteArray()
417 { 418 {
418 landData.Bitmap = convertLandBitmapToBytes(); 419 LandData.Bitmap = ConvertLandBitmapToBytes();
419 } 420 }
420 421
421 /// <summary> 422 /// <summary>
422 /// Update all settings in land such as area, bitmap byte array, etc 423 /// Update all settings in land such as area, bitmap byte array, etc
423 /// </summary> 424 /// </summary>
424 public void forceUpdateLandInfo() 425 public void ForceUpdateLandInfo()
425 { 426 {
426 updateAABBAndAreaValues(); 427 UpdateAABBAndAreaValues();
427 updateLandBitmapByteArray(); 428 UpdateLandBitmapByteArray();
428 } 429 }
429 430
430 public void setLandBitmapFromByteArray() 431 public void SetLandBitmapFromByteArray()
431 { 432 {
432 landBitmap = convertBytesToLandBitmap(); 433 LandBitmap = ConvertBytesToLandBitmap();
433 } 434 }
434 435
435 /// <summary> 436 /// <summary>
436 /// Updates the AABBMin and AABBMax values after area/shape modification of the land object 437 /// Updates the AABBMin and AABBMax values after area/shape modification of the land object
437 /// </summary> 438 /// </summary>
438 private void updateAABBAndAreaValues() 439 private void UpdateAABBAndAreaValues()
439 { 440 {
440 int min_x = 64; 441 int min_x = 64;
441 int min_y = 64; 442 int min_y = 64;
@@ -447,7 +448,7 @@ namespace OpenSim.Region.CoreModules.World.Land
447 { 448 {
448 for (y = 0; y < 64; y++) 449 for (y = 0; y < 64; y++)
449 { 450 {
450 if (landBitmap[x, y] == true) 451 if (LandBitmap[x, y] == true)
451 { 452 {
452 if (min_x > x) min_x = x; 453 if (min_x > x) min_x = x;
453 if (min_y > y) min_y = y; 454 if (min_y > y) min_y = y;
@@ -463,7 +464,7 @@ namespace OpenSim.Region.CoreModules.World.Land
463 int ty = min_y * 4; 464 int ty = min_y * 4;
464 if (ty > ((int)Constants.RegionSize - 1)) 465 if (ty > ((int)Constants.RegionSize - 1))
465 ty = ((int)Constants.RegionSize - 1); 466 ty = ((int)Constants.RegionSize - 1);
466 landData.AABBMin = 467 LandData.AABBMin =
467 new Vector3((float) (min_x * 4), (float) (min_y * 4), 468 new Vector3((float) (min_x * 4), (float) (min_y * 4),
468 (float) m_scene.Heightmap[tx, ty]); 469 (float) m_scene.Heightmap[tx, ty]);
469 470
@@ -473,10 +474,10 @@ namespace OpenSim.Region.CoreModules.World.Land
473 ty = max_y * 4; 474 ty = max_y * 4;
474 if (ty > ((int)Constants.RegionSize - 1)) 475 if (ty > ((int)Constants.RegionSize - 1))
475 ty = ((int)Constants.RegionSize - 1); 476 ty = ((int)Constants.RegionSize - 1);
476 landData.AABBMax = 477 LandData.AABBMax =
477 new Vector3((float) (max_x * 4), (float) (max_y * 4), 478 new Vector3((float) (max_x * 4), (float) (max_y * 4),
478 (float) m_scene.Heightmap[tx, ty]); 479 (float) m_scene.Heightmap[tx, ty]);
479 landData.Area = tempArea; 480 LandData.Area = tempArea;
480 } 481 }
481 482
482 #endregion 483 #endregion
@@ -487,7 +488,7 @@ namespace OpenSim.Region.CoreModules.World.Land
487 /// Sets the land's bitmap manually 488 /// Sets the land's bitmap manually
488 /// </summary> 489 /// </summary>
489 /// <param name="bitmap">64x64 block representing where this land is on a map</param> 490 /// <param name="bitmap">64x64 block representing where this land is on a map</param>
490 public void setLandBitmap(bool[,] bitmap) 491 public void SetLandBitmap(bool[,] bitmap)
491 { 492 {
492 if (bitmap.GetLength(0) != 64 || bitmap.GetLength(1) != 64 || bitmap.Rank != 2) 493 if (bitmap.GetLength(0) != 64 || bitmap.GetLength(1) != 64 || bitmap.Rank != 2)
493 { 494 {
@@ -497,8 +498,8 @@ namespace OpenSim.Region.CoreModules.World.Land
497 else 498 else
498 { 499 {
499 //Valid: Lets set it 500 //Valid: Lets set it
500 landBitmap = bitmap; 501 LandBitmap = bitmap;
501 forceUpdateLandInfo(); 502 ForceUpdateLandInfo();
502 } 503 }
503 } 504 }
504 505
@@ -506,18 +507,18 @@ namespace OpenSim.Region.CoreModules.World.Land
506 /// Gets the land's bitmap manually 507 /// Gets the land's bitmap manually
507 /// </summary> 508 /// </summary>
508 /// <returns></returns> 509 /// <returns></returns>
509 public bool[,] getLandBitmap() 510 public bool[,] GetLandBitmap()
510 { 511 {
511 return landBitmap; 512 return LandBitmap;
512 } 513 }
513 514
514 /// <summary> 515 /// <summary>
515 /// Full sim land object creation 516 /// Full sim land object creation
516 /// </summary> 517 /// </summary>
517 /// <returns></returns> 518 /// <returns></returns>
518 public bool[,] basicFullRegionLandBitmap() 519 public bool[,] BasicFullRegionLandBitmap()
519 { 520 {
520 return getSquareLandBitmap(0, 0, (int) Constants.RegionSize, (int) Constants.RegionSize); 521 return GetSquareLandBitmap(0, 0, (int) Constants.RegionSize, (int) Constants.RegionSize);
521 } 522 }
522 523
523 /// <summary> 524 /// <summary>
@@ -528,12 +529,12 @@ namespace OpenSim.Region.CoreModules.World.Land
528 /// <param name="end_x"></param> 529 /// <param name="end_x"></param>
529 /// <param name="end_y"></param> 530 /// <param name="end_y"></param>
530 /// <returns></returns> 531 /// <returns></returns>
531 public bool[,] getSquareLandBitmap(int start_x, int start_y, int end_x, int end_y) 532 public bool[,] GetSquareLandBitmap(int start_x, int start_y, int end_x, int end_y)
532 { 533 {
533 bool[,] tempBitmap = new bool[64,64]; 534 bool[,] tempBitmap = new bool[64,64];
534 tempBitmap.Initialize(); 535 tempBitmap.Initialize();
535 536
536 tempBitmap = modifyLandBitmapSquare(tempBitmap, start_x, start_y, end_x, end_y, true); 537 tempBitmap = ModifyLandBitmapSquare(tempBitmap, start_x, start_y, end_x, end_y, true);
537 return tempBitmap; 538 return tempBitmap;
538 } 539 }
539 540
@@ -547,7 +548,7 @@ namespace OpenSim.Region.CoreModules.World.Land
547 /// <param name="end_y"></param> 548 /// <param name="end_y"></param>
548 /// <param name="set_value"></param> 549 /// <param name="set_value"></param>
549 /// <returns></returns> 550 /// <returns></returns>
550 public bool[,] modifyLandBitmapSquare(bool[,] land_bitmap, int start_x, int start_y, int end_x, int end_y, 551 public bool[,] ModifyLandBitmapSquare(bool[,] land_bitmap, int start_x, int start_y, int end_x, int end_y,
551 bool set_value) 552 bool set_value)
552 { 553 {
553 if (land_bitmap.GetLength(0) != 64 || land_bitmap.GetLength(1) != 64 || land_bitmap.Rank != 2) 554 if (land_bitmap.GetLength(0) != 64 || land_bitmap.GetLength(1) != 64 || land_bitmap.Rank != 2)
@@ -577,7 +578,7 @@ namespace OpenSim.Region.CoreModules.World.Land
577 /// <param name="bitmap_base"></param> 578 /// <param name="bitmap_base"></param>
578 /// <param name="bitmap_add"></param> 579 /// <param name="bitmap_add"></param>
579 /// <returns></returns> 580 /// <returns></returns>
580 public bool[,] mergeLandBitmaps(bool[,] bitmap_base, bool[,] bitmap_add) 581 public bool[,] MergeLandBitmaps(bool[,] bitmap_base, bool[,] bitmap_add)
581 { 582 {
582 if (bitmap_base.GetLength(0) != 64 || bitmap_base.GetLength(1) != 64 || bitmap_base.Rank != 2) 583 if (bitmap_base.GetLength(0) != 64 || bitmap_base.GetLength(1) != 64 || bitmap_base.Rank != 2)
583 { 584 {
@@ -608,7 +609,7 @@ namespace OpenSim.Region.CoreModules.World.Land
608 /// Converts the land bitmap to a packet friendly byte array 609 /// Converts the land bitmap to a packet friendly byte array
609 /// </summary> 610 /// </summary>
610 /// <returns></returns> 611 /// <returns></returns>
611 private byte[] convertLandBitmapToBytes() 612 private byte[] ConvertLandBitmapToBytes()
612 { 613 {
613 byte[] tempConvertArr = new byte[512]; 614 byte[] tempConvertArr = new byte[512];
614 byte tempByte = 0; 615 byte tempByte = 0;
@@ -618,7 +619,7 @@ namespace OpenSim.Region.CoreModules.World.Land
618 { 619 {
619 for (x = 0; x < 64; x++) 620 for (x = 0; x < 64; x++)
620 { 621 {
621 tempByte = Convert.ToByte(tempByte | Convert.ToByte(landBitmap[x, y]) << (i++ % 8)); 622 tempByte = Convert.ToByte(tempByte | Convert.ToByte(LandBitmap[x, y]) << (i++ % 8));
622 if (i % 8 == 0) 623 if (i % 8 == 0)
623 { 624 {
624 tempConvertArr[byteNum] = tempByte; 625 tempConvertArr[byteNum] = tempByte;
@@ -631,7 +632,7 @@ namespace OpenSim.Region.CoreModules.World.Land
631 return tempConvertArr; 632 return tempConvertArr;
632 } 633 }
633 634
634 private bool[,] convertBytesToLandBitmap() 635 private bool[,] ConvertBytesToLandBitmap()
635 { 636 {
636 bool[,] tempConvertMap = new bool[landArrayMax, landArrayMax]; 637 bool[,] tempConvertMap = new bool[landArrayMax, landArrayMax];
637 tempConvertMap.Initialize(); 638 tempConvertMap.Initialize();
@@ -639,7 +640,7 @@ namespace OpenSim.Region.CoreModules.World.Land
639 int x = 0, y = 0, i = 0, bitNum = 0; 640 int x = 0, y = 0, i = 0, bitNum = 0;
640 for (i = 0; i < 512; i++) 641 for (i = 0; i < 512; i++)
641 { 642 {
642 tempByte = landData.Bitmap[i]; 643 tempByte = LandData.Bitmap[i];
643 for (bitNum = 0; bitNum < 8; bitNum++) 644 for (bitNum = 0; bitNum < 8; bitNum++)
644 { 645 {
645 bool bit = Convert.ToBoolean(Convert.ToByte(tempByte >> bitNum) & (byte) 1); 646 bool bit = Convert.ToBoolean(Convert.ToByte(tempByte >> bitNum) & (byte) 1);
@@ -659,7 +660,7 @@ namespace OpenSim.Region.CoreModules.World.Land
659 660
660 #region Object Select and Object Owner Listing 661 #region Object Select and Object Owner Listing
661 662
662 public void sendForceObjectSelect(int local_id, int request_type, List<UUID> returnIDs, IClientAPI remote_client) 663 public void SendForceObjectSelect(int local_id, int request_type, List<UUID> returnIDs, IClientAPI remote_client)
663 { 664 {
664 if (m_scene.Permissions.CanEditParcel(remote_client.AgentId, this)) 665 if (m_scene.Permissions.CanEditParcel(remote_client.AgentId, this))
665 { 666 {
@@ -672,11 +673,11 @@ namespace OpenSim.Region.CoreModules.World.Land
672 { 673 {
673 if (obj.LocalId > 0) 674 if (obj.LocalId > 0)
674 { 675 {
675 if (request_type == LandChannel.LAND_SELECT_OBJECTS_OWNER && obj.OwnerID == landData.OwnerID) 676 if (request_type == LandChannel.LAND_SELECT_OBJECTS_OWNER && obj.OwnerID == LandData.OwnerID)
676 { 677 {
677 resultLocalIDs.Add(obj.LocalId); 678 resultLocalIDs.Add(obj.LocalId);
678 } 679 }
679 else if (request_type == LandChannel.LAND_SELECT_OBJECTS_GROUP && obj.GroupID == landData.GroupID && landData.GroupID != UUID.Zero) 680 else if (request_type == LandChannel.LAND_SELECT_OBJECTS_GROUP && obj.GroupID == LandData.GroupID && LandData.GroupID != UUID.Zero)
680 { 681 {
681 resultLocalIDs.Add(obj.LocalId); 682 resultLocalIDs.Add(obj.LocalId);
682 } 683 }
@@ -709,7 +710,7 @@ namespace OpenSim.Region.CoreModules.World.Land
709 /// <param name="remote_client"> 710 /// <param name="remote_client">
710 /// A <see cref="IClientAPI"/> 711 /// A <see cref="IClientAPI"/>
711 /// </param> 712 /// </param>
712 public void sendLandObjectOwners(IClientAPI remote_client) 713 public void SendLandObjectOwners(IClientAPI remote_client)
713 { 714 {
714 if (m_scene.Permissions.CanEditParcel(remote_client.AgentId, this)) 715 if (m_scene.Permissions.CanEditParcel(remote_client.AgentId, this))
715 { 716 {
@@ -752,11 +753,11 @@ namespace OpenSim.Region.CoreModules.World.Land
752 } 753 }
753 } 754 }
754 755
755 remote_client.SendLandObjectOwners(landData, groups, primCount); 756 remote_client.SendLandObjectOwners(LandData, groups, primCount);
756 } 757 }
757 } 758 }
758 759
759 public Dictionary<UUID, int> getLandObjectOwners() 760 public Dictionary<UUID, int> GetLandObjectOwners()
760 { 761 {
761 Dictionary<UUID, int> ownersAndCount = new Dictionary<UUID, int>(); 762 Dictionary<UUID, int> ownersAndCount = new Dictionary<UUID, int>();
762 lock (primsOverMe) 763 lock (primsOverMe)
@@ -786,14 +787,14 @@ namespace OpenSim.Region.CoreModules.World.Land
786 787
787 #region Object Returning 788 #region Object Returning
788 789
789 public void returnObject(SceneObjectGroup obj) 790 public void ReturnObject(SceneObjectGroup obj)
790 { 791 {
791 SceneObjectGroup[] objs = new SceneObjectGroup[1]; 792 SceneObjectGroup[] objs = new SceneObjectGroup[1];
792 objs[0] = obj; 793 objs[0] = obj;
793 m_scene.returnObjects(objs, obj.OwnerID); 794 m_scene.returnObjects(objs, obj.OwnerID);
794 } 795 }
795 796
796 public void returnLandObjects(uint type, UUID[] owners, UUID[] tasks, IClientAPI remote_client) 797 public void ReturnLandObjects(uint type, UUID[] owners, UUID[] tasks, IClientAPI remote_client)
797 { 798 {
798 Dictionary<UUID,List<SceneObjectGroup>> returns = 799 Dictionary<UUID,List<SceneObjectGroup>> returns =
799 new Dictionary<UUID,List<SceneObjectGroup>>(); 800 new Dictionary<UUID,List<SceneObjectGroup>>();
@@ -869,19 +870,19 @@ namespace OpenSim.Region.CoreModules.World.Land
869 870
870 #region Object Adding/Removing from Parcel 871 #region Object Adding/Removing from Parcel
871 872
872 public void resetLandPrimCounts() 873 public void ResetLandPrimCounts()
873 { 874 {
874 landData.GroupPrims = 0; 875 LandData.GroupPrims = 0;
875 landData.OwnerPrims = 0; 876 LandData.OwnerPrims = 0;
876 landData.OtherPrims = 0; 877 LandData.OtherPrims = 0;
877 landData.SelectedPrims = 0; 878 LandData.SelectedPrims = 0;
878 879
879 880
880 lock (primsOverMe) 881 lock (primsOverMe)
881 primsOverMe.Clear(); 882 primsOverMe.Clear();
882 } 883 }
883 884
884 public void addPrimToCount(SceneObjectGroup obj) 885 public void AddPrimToCount(SceneObjectGroup obj)
885 { 886 {
886 887
887 UUID prim_owner = obj.OwnerID; 888 UUID prim_owner = obj.OwnerID;
@@ -889,23 +890,23 @@ namespace OpenSim.Region.CoreModules.World.Land
889 890
890 if (obj.IsSelected) 891 if (obj.IsSelected)
891 { 892 {
892 landData.SelectedPrims += prim_count; 893 LandData.SelectedPrims += prim_count;
893 } 894 }
894 else 895 else
895 { 896 {
896 if (prim_owner == landData.OwnerID) 897 if (prim_owner == LandData.OwnerID)
897 { 898 {
898 landData.OwnerPrims += prim_count; 899 LandData.OwnerPrims += prim_count;
899 } 900 }
900 else if ((obj.GroupID == landData.GroupID || 901 else if ((obj.GroupID == LandData.GroupID ||
901 prim_owner == landData.GroupID) && 902 prim_owner == LandData.GroupID) &&
902 landData.GroupID != UUID.Zero) 903 LandData.GroupID != UUID.Zero)
903 { 904 {
904 landData.GroupPrims += prim_count; 905 LandData.GroupPrims += prim_count;
905 } 906 }
906 else 907 else
907 { 908 {
908 landData.OtherPrims += prim_count; 909 LandData.OtherPrims += prim_count;
909 } 910 }
910 } 911 }
911 912
@@ -913,7 +914,7 @@ namespace OpenSim.Region.CoreModules.World.Land
913 primsOverMe.Add(obj); 914 primsOverMe.Add(obj);
914 } 915 }
915 916
916 public void removePrimFromCount(SceneObjectGroup obj) 917 public void RemovePrimFromCount(SceneObjectGroup obj)
917 { 918 {
918 lock (primsOverMe) 919 lock (primsOverMe)
919 { 920 {
@@ -922,18 +923,18 @@ namespace OpenSim.Region.CoreModules.World.Land
922 UUID prim_owner = obj.OwnerID; 923 UUID prim_owner = obj.OwnerID;
923 int prim_count = obj.PrimCount; 924 int prim_count = obj.PrimCount;
924 925
925 if (prim_owner == landData.OwnerID) 926 if (prim_owner == LandData.OwnerID)
926 { 927 {
927 landData.OwnerPrims -= prim_count; 928 LandData.OwnerPrims -= prim_count;
928 } 929 }
929 else if (obj.GroupID == landData.GroupID || 930 else if (obj.GroupID == LandData.GroupID ||
930 prim_owner == landData.GroupID) 931 prim_owner == LandData.GroupID)
931 { 932 {
932 landData.GroupPrims -= prim_count; 933 LandData.GroupPrims -= prim_count;
933 } 934 }
934 else 935 else
935 { 936 {
936 landData.OtherPrims -= prim_count; 937 LandData.OtherPrims -= prim_count;
937 } 938 }
938 939
939 primsOverMe.Remove(obj); 940 primsOverMe.Remove(obj);
@@ -953,8 +954,8 @@ namespace OpenSim.Region.CoreModules.World.Land
953 /// <param name="url"></param> 954 /// <param name="url"></param>
954 public void SetMediaUrl(string url) 955 public void SetMediaUrl(string url)
955 { 956 {
956 landData.MediaURL = url; 957 LandData.MediaURL = url;
957 sendLandUpdateToAvatarsOverMe(); 958 SendLandUpdateToAvatarsOverMe();
958 } 959 }
959 960
960 /// <summary> 961 /// <summary>
@@ -963,8 +964,8 @@ namespace OpenSim.Region.CoreModules.World.Land
963 /// <param name="url"></param> 964 /// <param name="url"></param>
964 public void SetMusicUrl(string url) 965 public void SetMusicUrl(string url)
965 { 966 {
966 landData.MusicURL = url; 967 LandData.MusicURL = url;
967 sendLandUpdateToAvatarsOverMe(); 968 SendLandUpdateToAvatarsOverMe();
968 } 969 }
969 } 970 }
970} 971}