aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World/Land/LandObject.cs
diff options
context:
space:
mode:
authorUbitUmarov2014-07-30 14:53:56 +0100
committerUbitUmarov2014-07-30 14:53:56 +0100
commit5fe1f878372b5490304a2ad7c0a41293ae36aaa0 (patch)
treeb9c63b3d0f16031492cd614af6a0135d2d2ee5bd /OpenSim/Region/CoreModules/World/Land/LandObject.cs
parentPersist new land fields for access control (diff)
downloadopensim-SC_OLD-5fe1f878372b5490304a2ad7c0a41293ae36aaa0.zip
opensim-SC_OLD-5fe1f878372b5490304a2ad7c0a41293ae36aaa0.tar.gz
opensim-SC_OLD-5fe1f878372b5490304a2ad7c0a41293ae36aaa0.tar.bz2
opensim-SC_OLD-5fe1f878372b5490304a2ad7c0a41293ae36aaa0.tar.xz
changes to parcels code (still more to to)
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Land/LandObject.cs')
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandObject.cs74
1 files changed, 52 insertions, 22 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
index cf37e09..7de6365 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
@@ -267,10 +267,11 @@ namespace OpenSim.Region.CoreModules.World.Land
267 GetSimulatorMaxPrimCount(), regionFlags); 267 GetSimulatorMaxPrimCount(), regionFlags);
268 } 268 }
269 269
270 public void UpdateLandProperties(LandUpdateArgs args, IClientAPI remote_client) 270 public bool UpdateLandProperties(LandUpdateArgs args, IClientAPI remote_client, out bool snap_selection, out bool needOverlay)
271 { 271 {
272 //Needs later group support 272 //Needs later group support
273 bool snap_selection = false; 273 snap_selection = false;
274 needOverlay = false;
274 LandData newData = LandData.Copy(); 275 LandData newData = LandData.Copy();
275 276
276 uint allowedDelta = 0; 277 uint allowedDelta = 0;
@@ -390,9 +391,16 @@ namespace OpenSim.Region.CoreModules.World.Land
390 uint preserve = LandData.Flags & ~allowedDelta; 391 uint preserve = LandData.Flags & ~allowedDelta;
391 newData.Flags = preserve | (args.ParcelFlags & allowedDelta); 392 newData.Flags = preserve | (args.ParcelFlags & allowedDelta);
392 393
394 uint curdelta = LandData.Flags ^ newData.Flags;
395 curdelta &= (uint)(ParcelFlags.SoundLocal);
396
397 if(curdelta != 0 || newData.SeeAVs != LandData.SeeAVs)
398 needOverlay = true;
399
393 m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); 400 m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData);
394 SendLandUpdateToAvatarsOverMe(snap_selection); 401 return true;
395 } 402 }
403 return false;
396 } 404 }
397 405
398 public void UpdateLandSold(UUID avatarID, UUID groupID, bool groupOwned, uint AuctionID, int claimprice, int area) 406 public void UpdateLandSold(UUID avatarID, UUID groupID, bool groupOwned, uint AuctionID, int claimprice, int area)
@@ -408,7 +416,7 @@ namespace OpenSim.Region.CoreModules.World.Land
408 newData.AuthBuyerID = UUID.Zero; 416 newData.AuthBuyerID = UUID.Zero;
409 newData.Flags &= ~(uint) (ParcelFlags.ForSale | ParcelFlags.ForSaleObjects | ParcelFlags.SellParcelObjects | ParcelFlags.ShowDirectory); 417 newData.Flags &= ~(uint) (ParcelFlags.ForSale | ParcelFlags.ForSaleObjects | ParcelFlags.SellParcelObjects | ParcelFlags.ShowDirectory);
410 m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); 418 m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData);
411 m_scene.EventManager.TriggerParcelPrimCountUpdate(); 419// m_scene.EventManager.TriggerParcelPrimCountUpdate();
412 SendLandUpdateToAvatarsOverMe(true); 420 SendLandUpdateToAvatarsOverMe(true);
413 } 421 }
414 422
@@ -579,6 +587,7 @@ namespace OpenSim.Region.CoreModules.World.Land
579 587
580 public void SendLandUpdateToAvatarsOverMe(bool snap_selection) 588 public void SendLandUpdateToAvatarsOverMe(bool snap_selection)
581 { 589 {
590 m_scene.EventManager.TriggerParcelPrimCountUpdate();
582 m_scene.ForEachRootScenePresence(delegate(ScenePresence avatar) 591 m_scene.ForEachRootScenePresence(delegate(ScenePresence avatar)
583 { 592 {
584 ILandObject over = null; 593 ILandObject over = null;
@@ -733,10 +742,10 @@ namespace OpenSim.Region.CoreModules.World.Land
733 /// </summary> 742 /// </summary>
734 private void UpdateAABBAndAreaValues() 743 private void UpdateAABBAndAreaValues()
735 { 744 {
736 int min_x = 64; 745 int min_x = Int32.MaxValue;
737 int min_y = 64; 746 int min_y = Int32.MaxValue;
738 int max_x = 0; 747 int max_x = Int32.MinValue;
739 int max_y = 0; 748 int max_y = Int32.MinValue;
740 int tempArea = 0; 749 int tempArea = 0;
741 int x, y; 750 int x, y;
742 for (x = 0; x < 64; x++) 751 for (x = 0; x < 64; x++)
@@ -745,35 +754,56 @@ namespace OpenSim.Region.CoreModules.World.Land
745 { 754 {
746 if (LandBitmap[x, y] == true) 755 if (LandBitmap[x, y] == true)
747 { 756 {
748 if (min_x > x) min_x = x; 757 if (min_x > x)
749 if (min_y > y) min_y = y; 758 min_x = x;
750 if (max_x < x) max_x = x; 759 if (min_y > y)
751 if (max_y < y) max_y = y; 760 min_y = y;
761 if (max_x < x)
762 max_x = x;
763 if (max_y < y)
764 max_y = y;
752 tempArea += 16; //16sqm peice of land 765 tempArea += 16; //16sqm peice of land
753 } 766 }
754 } 767 }
755 } 768 }
769
756 int tx = min_x * 4; 770 int tx = min_x * 4;
757 if (tx > ((int)Constants.RegionSize - 1)) 771 int htx;
758 tx = ((int)Constants.RegionSize - 1); 772 if (tx == ((int)Constants.RegionSize))
773 htx = tx - 1;
774 else
775 htx = tx;
776
759 int ty = min_y * 4; 777 int ty = min_y * 4;
760 if (ty > ((int)Constants.RegionSize - 1)) 778 int hty;
761 ty = ((int)Constants.RegionSize - 1); 779
780 if (ty == ((int)Constants.RegionSize))
781 hty = ty - 1;
782 else
783 hty = ty;
762 784
763 LandData.AABBMin = 785 LandData.AABBMin =
764 new Vector3( 786 new Vector3(
765 (float)(min_x * 4), (float)(min_y * 4), m_scene != null ? (float)m_scene.Heightmap[tx, ty] : 0); 787 (float)(tx), (float)(ty), m_scene != null ? (float)m_scene.Heightmap[htx, hty] : 0);
766 788
789 max_x++;
767 tx = max_x * 4; 790 tx = max_x * 4;
768 if (tx > ((int)Constants.RegionSize - 1)) 791 if (tx == ((int)Constants.RegionSize))
769 tx = ((int)Constants.RegionSize - 1); 792 htx = tx - 1;
793 else
794 htx = tx;
795
796 max_y++;
770 ty = max_y * 4; 797 ty = max_y * 4;
771 if (ty > ((int)Constants.RegionSize - 1)) 798
772 ty = ((int)Constants.RegionSize - 1); 799 if (ty == ((int)Constants.RegionSize))
800 hty = ty - 1;
801 else
802 hty = ty;
773 803
774 LandData.AABBMax 804 LandData.AABBMax
775 = new Vector3( 805 = new Vector3(
776 (float)(max_x * 4), (float)(max_y * 4), m_scene != null ? (float)m_scene.Heightmap[tx, ty] : 0); 806 (float)(tx), (float)(ty), m_scene != null ? (float)m_scene.Heightmap[htx, hty] : 0);
777 807
778 LandData.Area = tempArea; 808 LandData.Area = tempArea;
779 } 809 }