aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/World/Land/LandChannel.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Modules/World/Land/LandChannel.cs')
-rw-r--r--OpenSim/Region/Environment/Modules/World/Land/LandChannel.cs364
1 files changed, 178 insertions, 186 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandChannel.cs b/OpenSim/Region/Environment/Modules/World/Land/LandChannel.cs
index cbea07a..efc5234 100644
--- a/OpenSim/Region/Environment/Modules/World/Land/LandChannel.cs
+++ b/OpenSim/Region/Environment/Modules/World/Land/LandChannel.cs
@@ -43,61 +43,45 @@ namespace OpenSim.Region.Environment.Modules.World.Land
43 43
44 //Land types set with flags in ParcelOverlay. 44 //Land types set with flags in ParcelOverlay.
45 //Only one of these can be used. 45 //Only one of these can be used.
46 public const byte LAND_TYPE_PUBLIC = (byte)0; //Equals 00000000 46 public const float BAN_LINE_SAFETY_HIEGHT = 100;
47 public const byte LAND_TYPE_OWNED_BY_OTHER = (byte)1; //Equals 00000001 47 public const byte LAND_FLAG_PROPERTY_BORDER_SOUTH = (byte) 128; //Equals 10000000
48 public const byte LAND_TYPE_OWNED_BY_GROUP = (byte)2; //Equals 00000010 48 public const byte LAND_FLAG_PROPERTY_BORDER_WEST = (byte) 64; //Equals 01000000
49 public const byte LAND_TYPE_OWNED_BY_REQUESTER = (byte)3; //Equals 00000011
50 public const byte LAND_TYPE_IS_FOR_SALE = (byte)4; //Equals 00000100
51 public const byte LAND_TYPE_IS_BEING_AUCTIONED = (byte)5; //Equals 00000101
52
53 //Flags that when set, a border on the given side will be placed
54 //NOTE: North and East is assumable by the west and south sides (if land to east has a west border, then I have an east border; etc)
55 //This took forever to figure out -- jeesh. /blame LL for even having to send these
56 public const byte LAND_FLAG_PROPERTY_BORDER_WEST = (byte)64; //Equals 01000000
57 public const byte LAND_FLAG_PROPERTY_BORDER_SOUTH = (byte)128; //Equals 10000000
58 49
59 //RequestResults (I think these are right, they seem to work): 50 //RequestResults (I think these are right, they seem to work):
60 public const int LAND_RESULT_SINGLE = 0; // The request they made contained only a single piece of land
61 public const int LAND_RESULT_MULTIPLE = 1; // The request they made contained more than a single peice of land 51 public const int LAND_RESULT_MULTIPLE = 1; // The request they made contained more than a single peice of land
52 public const int LAND_RESULT_SINGLE = 0; // The request they made contained only a single piece of land
62 53
63 //ParcelSelectObjects 54 //ParcelSelectObjects
64 public const int LAND_SELECT_OBJECTS_OWNER = 2;
65 public const int LAND_SELECT_OBJECTS_GROUP = 4; 55 public const int LAND_SELECT_OBJECTS_GROUP = 4;
66 public const int LAND_SELECT_OBJECTS_OTHER = 8; 56 public const int LAND_SELECT_OBJECTS_OTHER = 8;
57 public const int LAND_SELECT_OBJECTS_OWNER = 2;
58 public const byte LAND_TYPE_IS_BEING_AUCTIONED = (byte) 5; //Equals 00000101
59 public const byte LAND_TYPE_IS_FOR_SALE = (byte) 4; //Equals 00000100
60 public const byte LAND_TYPE_OWNED_BY_GROUP = (byte) 2; //Equals 00000010
61 public const byte LAND_TYPE_OWNED_BY_OTHER = (byte) 1; //Equals 00000001
62 public const byte LAND_TYPE_OWNED_BY_REQUESTER = (byte) 3; //Equals 00000011
63 public const byte LAND_TYPE_PUBLIC = (byte) 0; //Equals 00000000
67 64
68 //These are other constants. Yay! 65 //These are other constants. Yay!
69 public const int START_LAND_LOCAL_ID = 1; 66 public const int START_LAND_LOCAL_ID = 1;
70 67
71 public const float BAN_LINE_SAFETY_HIEGHT = 100;
72
73 #endregion 68 #endregion
74 69
75 private Scene m_scene; 70 private int[,] landIDList = new int[64,64];
76
77 private Dictionary<int, ILandObject> landList = new Dictionary<int, ILandObject>(); 71 private Dictionary<int, ILandObject> landList = new Dictionary<int, ILandObject>();
78 private int lastLandLocalID = START_LAND_LOCAL_ID - 1;
79 private int[,] landIDList = new int[64, 64];
80 72
81 private bool landPrimCountTainted = false; 73 private bool landPrimCountTainted = false;
74 private int lastLandLocalID = START_LAND_LOCAL_ID - 1;
82 75
83 private bool m_allowedForcefulBans = true; 76 private bool m_allowedForcefulBans = true;
84 public bool allowedForcefulBans 77 private Scene m_scene;
85 {
86 get
87 {
88 return m_allowedForcefulBans;
89 }
90 set
91 {
92 m_allowedForcefulBans = value;
93 }
94 }
95 78
96 public LandChannel(Scene scene) 79 public LandChannel(Scene scene)
97 { 80 {
98 m_scene = scene; 81 m_scene = scene;
99 landIDList.Initialize(); 82 landIDList.Initialize();
100 } 83 }
84
101 #region Land Object From Storage Functions 85 #region Land Object From Storage Functions
102 86
103 public void IncomingLandObjectsFromStorage(List<LandData> data) 87 public void IncomingLandObjectsFromStorage(List<LandData> data)
@@ -133,10 +117,64 @@ namespace OpenSim.Region.Environment.Modules.World.Land
133 resetSimLandObjects(); 117 resetSimLandObjects();
134 } 118 }
135 119
136 #endregion 120 #endregion
137 121
138 #region Parcel Add/Remove/Get/Create 122 #region Parcel Add/Remove/Get/Create
139 123
124 public void updateLandObject(int local_id, LandData newData)
125 {
126 if (landList.ContainsKey(local_id))
127 {
128 landList[local_id].landData = newData.Copy();
129 m_scene.EventManager.TriggerLandObjectUpdated((uint) local_id, landList[local_id]);
130 }
131 }
132
133 /// <summary>
134 /// Get the land object at the specified point
135 /// </summary>
136 /// <param name="x">Value between 0 - 256 on the x axis of the point</param>
137 /// <param name="y">Value between 0 - 256 on the y axis of the point</param>
138 /// <returns>Land object at the point supplied</returns>
139 public ILandObject getLandObject(float x_float, float y_float)
140 {
141 int x;
142 int y;
143
144 try
145 {
146 x = Convert.ToInt32(Math.Floor(Convert.ToDouble(x_float) / Convert.ToDouble(4.0)));
147 y = Convert.ToInt32(Math.Floor(Convert.ToDouble(y_float) / Convert.ToDouble(4.0)));
148 }
149 catch (OverflowException)
150 {
151 return null;
152 }
153
154 if (x >= 64 || y >= 64 || x < 0 || y < 0)
155 {
156 return null;
157 }
158 else
159 {
160 return landList[landIDList[x, y]];
161 }
162 }
163
164 public ILandObject getLandObject(int x, int y)
165 {
166 if (x >= Convert.ToInt32(Constants.RegionSize) || y >= Convert.ToInt32(Constants.RegionSize) || x < 0 || y < 0)
167 {
168 // These exceptions here will cause a lot of complaints from the users specifically because
169 // they happen every time at border crossings
170 throw new Exception("Error: Parcel not found at point " + x + ", " + y);
171 }
172 else
173 {
174 return landList[landIDList[x / 4, y / 4]];
175 }
176 }
177
140 /// <summary> 178 /// <summary>
141 /// Creates a basic Parcel object without an owner (a zeroed key) 179 /// Creates a basic Parcel object without an owner (a zeroed key)
142 /// </summary> 180 /// </summary>
@@ -154,7 +192,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
154 { 192 {
155 lastLandLocalID++; 193 lastLandLocalID++;
156 new_land.landData.localID = lastLandLocalID; 194 new_land.landData.localID = lastLandLocalID;
157 landList.Add(lastLandLocalID, (LandObject)new_land.Copy()); 195 landList.Add(lastLandLocalID, (LandObject) new_land.Copy());
158 196
159 197
160 bool[,] landBitmap = new_land.getLandBitmap(); 198 bool[,] landBitmap = new_land.getLandBitmap();
@@ -197,15 +235,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land
197 landList.Remove(local_id); 235 landList.Remove(local_id);
198 } 236 }
199 237
200 public void updateLandObject(int local_id, LandData newData)
201 {
202 if (landList.ContainsKey(local_id))
203 {
204 landList[local_id].landData = newData.Copy();
205 m_scene.EventManager.TriggerLandObjectUpdated((uint)local_id, landList[local_id]);
206 }
207 }
208
209 private void performFinalLandJoin(ILandObject master, ILandObject slave) 238 private void performFinalLandJoin(ILandObject master, ILandObject slave)
210 { 239 {
211 int x, y; 240 int x, y;
@@ -225,66 +254,113 @@ namespace OpenSim.Region.Environment.Modules.World.Land
225 updateLandObject(master.landData.localID, master.landData); 254 updateLandObject(master.landData.localID, master.landData);
226 } 255 }
227 256
228 /// <summary> 257 public ILandObject getLandObject(int parcelLocalID)
229 /// Get the land object at the specified point
230 /// </summary>
231 /// <param name="x">Value between 0 - 256 on the x axis of the point</param>
232 /// <param name="y">Value between 0 - 256 on the y axis of the point</param>
233 /// <returns>Land object at the point supplied</returns>
234 public ILandObject getLandObject(float x_float, float y_float)
235 { 258 {
236 int x; 259 lock (landList)
237 int y;
238
239 try
240 { 260 {
241 x = Convert.ToInt32(Math.Floor(Convert.ToDouble(x_float) / Convert.ToDouble(4.0))); 261 if (landList.ContainsKey(parcelLocalID))
242 y = Convert.ToInt32(Math.Floor(Convert.ToDouble(y_float) / Convert.ToDouble(4.0))); 262 {
263 return landList[parcelLocalID];
264 }
243 } 265 }
244 catch (OverflowException) 266 return null;
267 }
268
269 #endregion
270
271 #region Parcel Modification
272
273 public void resetAllLandPrimCounts()
274 {
275 foreach (LandObject p in landList.Values)
245 { 276 {
246 return null; 277 p.resetLandPrimCounts();
247 } 278 }
279 }
248 280
249 if (x >= 64 || y >= 64 || x < 0 || y < 0) 281 public void setPrimsTainted()
282 {
283 landPrimCountTainted = true;
284 }
285
286 public bool isLandPrimCountTainted()
287 {
288 return landPrimCountTainted;
289 }
290
291 public void addPrimToLandPrimCounts(SceneObjectGroup obj)
292 {
293 LLVector3 position = obj.AbsolutePosition;
294 ILandObject landUnderPrim = getLandObject(position.X, position.Y);
295 if (landUnderPrim != null)
250 { 296 {
251 return null; 297 landUnderPrim.addPrimToCount(obj);
252 } 298 }
253 else 299 }
300
301 public void removePrimFromLandPrimCounts(SceneObjectGroup obj)
302 {
303 foreach (LandObject p in landList.Values)
254 { 304 {
255 return landList[landIDList[x, y]]; 305 p.removePrimFromCount(obj);
256 } 306 }
257 } 307 }
258 308
259 public ILandObject getLandObject(int parcelLocalID) 309 public void finalizeLandPrimCountUpdate()
260 { 310 {
261 lock (landList) 311 //Get Simwide prim count for owner
312 Dictionary<LLUUID, List<LandObject>> landOwnersAndParcels = new Dictionary<LLUUID, List<LandObject>>();
313 foreach (LandObject p in landList.Values)
262 { 314 {
263 if (landList.ContainsKey(parcelLocalID)) 315 if (!landOwnersAndParcels.ContainsKey(p.landData.ownerID))
264 { 316 {
265 return landList[parcelLocalID]; 317 List<LandObject> tempList = new List<LandObject>();
318 tempList.Add(p);
319 landOwnersAndParcels.Add(p.landData.ownerID, tempList);
320 }
321 else
322 {
323 landOwnersAndParcels[p.landData.ownerID].Add(p);
266 } 324 }
267 } 325 }
268 return null;
269 }
270 326
271 public ILandObject getLandObject(int x, int y) 327 foreach (LLUUID owner in landOwnersAndParcels.Keys)
272 {
273 if (x >= Convert.ToInt32(Constants.RegionSize) || y >= Convert.ToInt32(Constants.RegionSize) || x < 0 || y < 0)
274 { 328 {
275 // These exceptions here will cause a lot of complaints from the users specifically because 329 int simArea = 0;
276 // they happen every time at border crossings 330 int simPrims = 0;
277 throw new Exception("Error: Parcel not found at point " + x + ", " + y); 331 foreach (LandObject p in landOwnersAndParcels[owner])
332 {
333 simArea += p.landData.area;
334 simPrims += p.landData.ownerPrims + p.landData.otherPrims + p.landData.groupPrims +
335 p.landData.selectedPrims;
336 }
337
338 foreach (LandObject p in landOwnersAndParcels[owner])
339 {
340 p.landData.simwideArea = simArea;
341 p.landData.simwidePrims = simPrims;
342 }
278 } 343 }
279 else 344 }
345
346 public void updateLandPrimCounts()
347 {
348 foreach (EntityBase obj in m_scene.Entities.Values)
280 { 349 {
281 return landList[landIDList[x / 4, y / 4]]; 350 if (obj is SceneObjectGroup)
351 {
352 m_scene.EventManager.TriggerParcelPrimCountAdd((SceneObjectGroup) obj);
353 }
282 } 354 }
283 } 355 }
284 356
285 #endregion 357 public void performParcelPrimCountUpdate()
286 358 {
287 #region Parcel Modification 359 resetAllLandPrimCounts();
360 m_scene.EventManager.TriggerParcelPrimCountUpdate();
361 finalizeLandPrimCountUpdate();
362 landPrimCountTainted = false;
363 }
288 364
289 /// <summary> 365 /// <summary>
290 /// Subdivides a piece of land 366 /// Subdivides a piece of land
@@ -435,97 +511,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land
435 return true; 511 return true;
436 } 512 }
437 513
438 public void resetAllLandPrimCounts()
439 {
440 foreach (LandObject p in landList.Values)
441 {
442 p.resetLandPrimCounts();
443 }
444 }
445
446 public void setPrimsTainted()
447 {
448 landPrimCountTainted = true;
449 }
450
451 public bool isLandPrimCountTainted()
452 {
453 return landPrimCountTainted;
454 }
455
456 public void addPrimToLandPrimCounts(SceneObjectGroup obj)
457 {
458 LLVector3 position = obj.AbsolutePosition;
459 ILandObject landUnderPrim = getLandObject(position.X, position.Y);
460 if (landUnderPrim != null)
461 {
462 landUnderPrim.addPrimToCount(obj);
463 }
464 }
465
466 public void removePrimFromLandPrimCounts(SceneObjectGroup obj)
467 {
468 foreach (LandObject p in landList.Values)
469 {
470 p.removePrimFromCount(obj);
471 }
472 }
473
474 public void finalizeLandPrimCountUpdate()
475 {
476 //Get Simwide prim count for owner
477 Dictionary<LLUUID, List<LandObject>> landOwnersAndParcels = new Dictionary<LLUUID, List<LandObject>>();
478 foreach (LandObject p in landList.Values)
479 {
480 if (!landOwnersAndParcels.ContainsKey(p.landData.ownerID))
481 {
482 List<LandObject> tempList = new List<LandObject>();
483 tempList.Add(p);
484 landOwnersAndParcels.Add(p.landData.ownerID, tempList);
485 }
486 else
487 {
488 landOwnersAndParcels[p.landData.ownerID].Add(p);
489 }
490 }
491
492 foreach (LLUUID owner in landOwnersAndParcels.Keys)
493 {
494 int simArea = 0;
495 int simPrims = 0;
496 foreach (LandObject p in landOwnersAndParcels[owner])
497 {
498 simArea += p.landData.area;
499 simPrims += p.landData.ownerPrims + p.landData.otherPrims + p.landData.groupPrims +
500 p.landData.selectedPrims;
501 }
502
503 foreach (LandObject p in landOwnersAndParcels[owner])
504 {
505 p.landData.simwideArea = simArea;
506 p.landData.simwidePrims = simPrims;
507 }
508 }
509 }
510
511 public void updateLandPrimCounts()
512 {
513 foreach (EntityBase obj in m_scene.Entities.Values)
514 {
515 if (obj is SceneObjectGroup)
516 {
517 m_scene.EventManager.TriggerParcelPrimCountAdd((SceneObjectGroup)obj);
518 }
519 }
520 }
521
522 public void performParcelPrimCountUpdate()
523 {
524 resetAllLandPrimCounts();
525 m_scene.EventManager.TriggerParcelPrimCountUpdate();
526 finalizeLandPrimCountUpdate();
527 landPrimCountTainted = false;
528 }
529 #endregion 514 #endregion
530 515
531 #region Parcel Updating 516 #region Parcel Updating
@@ -547,7 +532,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
547 { 532 {
548 for (x = 0; x < 64; x++) 533 for (x = 0; x < 64; x++)
549 { 534 {
550 byte tempByte = (byte)0; //This represents the byte for the current 4x4 535 byte tempByte = (byte) 0; //This represents the byte for the current 4x4
551 ILandObject currentParcelBlock = null; 536 ILandObject currentParcelBlock = null;
552 537
553 try 538 try
@@ -623,10 +608,10 @@ namespace OpenSim.Region.Environment.Modules.World.Land
623 if (byteArrayCount >= LAND_BLOCKS_PER_PACKET) 608 if (byteArrayCount >= LAND_BLOCKS_PER_PACKET)
624 { 609 {
625 byteArrayCount = 0; 610 byteArrayCount = 0;
626 packet = (ParcelOverlayPacket)PacketPool.Instance.GetPacket(PacketType.ParcelOverlay); 611 packet = (ParcelOverlayPacket) PacketPool.Instance.GetPacket(PacketType.ParcelOverlay);
627 packet.ParcelData.Data = byteArray; 612 packet.ParcelData.Data = byteArray;
628 packet.ParcelData.SequenceID = sequenceID; 613 packet.ParcelData.SequenceID = sequenceID;
629 remote_client.OutPacket((Packet)packet, ThrottleOutPacketType.Task); 614 remote_client.OutPacket((Packet) packet, ThrottleOutPacketType.Task);
630 sequenceID++; 615 sequenceID++;
631 byteArray = new byte[LAND_BLOCKS_PER_PACKET]; 616 byteArray = new byte[LAND_BLOCKS_PER_PACKET];
632 } 617 }
@@ -652,7 +637,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land
652 { 637 {
653 for (y = 0; y < inc_y; y++) 638 for (y = 0; y < inc_y; y++)
654 { 639 {
655
656 ILandObject currentParcel = null; 640 ILandObject currentParcel = null;
657 try 641 try
658 { 642 {
@@ -693,7 +677,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land
693 if (landList.ContainsKey(packet.ParcelData.LocalID)) 677 if (landList.ContainsKey(packet.ParcelData.LocalID))
694 { 678 {
695 landList[packet.ParcelData.LocalID].updateLandProperties(packet, remote_client); 679 landList[packet.ParcelData.LocalID].updateLandProperties(packet, remote_client);
696
697 } 680 }
698 } 681 }
699 682
@@ -719,6 +702,14 @@ namespace OpenSim.Region.Environment.Modules.World.Land
719 702
720 #endregion 703 #endregion
721 704
705 #region ILandChannel Members
706
707 public bool allowedForcefulBans
708 {
709 get { return m_allowedForcefulBans; }
710 set { m_allowedForcefulBans = value; }
711 }
712
722 /// <summary> 713 /// <summary>
723 /// Resets the sim to the default land object (full sim piece of land owned by the default user) 714 /// Resets the sim to the default land object (full sim piece of land owned by the default user)
724 /// </summary> 715 /// </summary>
@@ -731,7 +722,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
731 722
732 ILandObject fullSimParcel = new LandObject(LLUUID.Zero, false, m_scene); 723 ILandObject fullSimParcel = new LandObject(LLUUID.Zero, false, m_scene);
733 724
734 fullSimParcel.setLandBitmap(fullSimParcel.getSquareLandBitmap(0, 0, (int)Constants.RegionSize, (int)Constants.RegionSize)); 725 fullSimParcel.setLandBitmap(fullSimParcel.getSquareLandBitmap(0, 0, (int) Constants.RegionSize, (int) Constants.RegionSize));
735 fullSimParcel.landData.ownerID = m_scene.RegionInfo.MasterAvatarAssignedUUID; 726 fullSimParcel.landData.ownerID = m_scene.RegionInfo.MasterAvatarAssignedUUID;
736 727
737 addLandObject(fullSimParcel); 728 addLandObject(fullSimParcel);
@@ -816,18 +807,17 @@ namespace OpenSim.Region.Environment.Modules.World.Land
816 { 807 {
817 if (presence.UUID == avatar.AgentId) 808 if (presence.UUID == avatar.AgentId)
818 { 809 {
819
820 List<ILandObject> checkLandParcels = parcelsNearPoint(presence.AbsolutePosition); 810 List<ILandObject> checkLandParcels = parcelsNearPoint(presence.AbsolutePosition);
821 foreach (ILandObject checkBan in checkLandParcels) 811 foreach (ILandObject checkBan in checkLandParcels)
822 { 812 {
823 if (checkBan.isBannedFromLand(avatar.AgentId)) 813 if (checkBan.isBannedFromLand(avatar.AgentId))
824 { 814 {
825 checkBan.sendLandProperties(-30000, false, (int)ParcelManager.ParcelResult.Single, avatar); 815 checkBan.sendLandProperties(-30000, false, (int) ParcelManager.ParcelResult.Single, avatar);
826 return; //Only send one 816 return; //Only send one
827 } 817 }
828 else if (checkBan.isRestrictedFromLand(avatar.AgentId)) 818 else if (checkBan.isRestrictedFromLand(avatar.AgentId))
829 { 819 {
830 checkBan.sendLandProperties(-40000, false, (int)ParcelManager.ParcelResult.Single, avatar); 820 checkBan.sendLandProperties(-40000, false, (int) ParcelManager.ParcelResult.Single, avatar);
831 return; //Only send one 821 return; //Only send one
832 } 822 }
833 } 823 }
@@ -841,8 +831,8 @@ namespace OpenSim.Region.Environment.Modules.World.Land
841 ILandObject over = null; 831 ILandObject over = null;
842 try 832 try
843 { 833 {
844 over = getLandObject((int)Math.Min(255, Math.Max(0, Math.Round(avatar.AbsolutePosition.X))), 834 over = getLandObject((int) Math.Min(255, Math.Max(0, Math.Round(avatar.AbsolutePosition.X))),
845 (int)Math.Min(255, Math.Max(0, Math.Round(avatar.AbsolutePosition.Y)))); 835 (int) Math.Min(255, Math.Max(0, Math.Round(avatar.AbsolutePosition.Y))));
846 } 836 }
847 catch (Exception) 837 catch (Exception)
848 { 838 {
@@ -873,11 +863,12 @@ namespace OpenSim.Region.Environment.Modules.World.Land
873 } 863 }
874 } 864 }
875 } 865 }
866
876 public void sendLandUpdate(ScenePresence avatar) 867 public void sendLandUpdate(ScenePresence avatar)
877 { 868 {
878 sendLandUpdate(avatar, false); 869 sendLandUpdate(avatar, false);
879
880 } 870 }
871
881 public void handleSignificantClientMovement(IClientAPI remote_client) 872 public void handleSignificantClientMovement(IClientAPI remote_client)
882 { 873 {
883 ScenePresence clientAvatar = m_scene.GetScenePresence(remote_client.AgentId); 874 ScenePresence clientAvatar = m_scene.GetScenePresence(remote_client.AgentId);
@@ -949,6 +940,8 @@ namespace OpenSim.Region.Environment.Modules.World.Land
949 } 940 }
950 } 941 }
951 942
943 #endregion
944
952 // If the economy has been validated by the economy module, 945 // If the economy has been validated by the economy module,
953 // and land has been validated as well, this method transfers 946 // and land has been validated as well, this method transfers
954 // the land ownership 947 // the land ownership
@@ -961,7 +954,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
961 { 954 {
962 if (landList.ContainsKey(e.parcelLocalID)) 955 if (landList.ContainsKey(e.parcelLocalID))
963 { 956 {
964 landList[e.parcelLocalID].updateLandSold(e.agentId, e.groupId, e.groupOwned, (uint)e.transactionID, e.parcelPrice, e.parcelArea); 957 landList[e.parcelLocalID].updateLandSold(e.agentId, e.groupId, e.groupOwned, (uint) e.transactionID, e.parcelPrice, e.parcelArea);
965 return; 958 return;
966 } 959 }
967 } 960 }
@@ -989,17 +982,16 @@ namespace OpenSim.Region.Environment.Modules.World.Land
989 LLUUID AuthorizedID = lob.landData.authBuyerID; 982 LLUUID AuthorizedID = lob.landData.authBuyerID;
990 int saleprice = lob.landData.salePrice; 983 int saleprice = lob.landData.salePrice;
991 LLUUID pOwnerID = lob.landData.ownerID; 984 LLUUID pOwnerID = lob.landData.ownerID;
992 985
993 bool landforsale = ((lob.landData.landFlags & (uint)(Parcel.ParcelFlags.ForSale | Parcel.ParcelFlags.ForSaleObjects | Parcel.ParcelFlags.SellParcelObjects)) != 0); 986 bool landforsale = ((lob.landData.landFlags &
987 (uint) (Parcel.ParcelFlags.ForSale | Parcel.ParcelFlags.ForSaleObjects | Parcel.ParcelFlags.SellParcelObjects)) != 0);
994 if ((AuthorizedID == LLUUID.Zero || AuthorizedID == e.agentId) && e.parcelPrice >= saleprice && landforsale) 988 if ((AuthorizedID == LLUUID.Zero || AuthorizedID == e.agentId) && e.parcelPrice >= saleprice && landforsale)
995 { 989 {
996 lock (e) 990 lock (e)
997 { 991 {
998 e.parcelOwnerID = pOwnerID; 992 e.parcelOwnerID = pOwnerID;
999 e.landValidated = true; 993 e.landValidated = true;
1000
1001 } 994 }
1002
1003 } 995 }
1004 } 996 }
1005 } 997 }