diff options
author | UbitUmarov | 2015-09-02 19:54:53 +0100 |
---|---|---|
committer | UbitUmarov | 2015-09-02 19:54:53 +0100 |
commit | a11edceb00b5b86f825bd957bdac9edb91f893dd (patch) | |
tree | c192eae26f3aadf365a66f32fc6d9ade2f0a0c61 /OpenSim/Region/CoreModules/World/Land | |
parent | bad merge? (diff) | |
download | opensim-SC-a11edceb00b5b86f825bd957bdac9edb91f893dd.zip opensim-SC-a11edceb00b5b86f825bd957bdac9edb91f893dd.tar.gz opensim-SC-a11edceb00b5b86f825bd957bdac9edb91f893dd.tar.bz2 opensim-SC-a11edceb00b5b86f825bd957bdac9edb91f893dd.tar.xz |
seems to compile ( tests comented out)
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Land')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | 420 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/LandObject.cs | 84 |
2 files changed, 19 insertions, 485 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 8bd46f6..749c2cc 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | |||
@@ -69,11 +69,8 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
69 | /// <summary> | 69 | /// <summary> |
70 | /// Minimum land unit size in region co-ordinates. | 70 | /// Minimum land unit size in region co-ordinates. |
71 | /// </summary> | 71 | /// </summary> |
72 | <<<<<<< HEAD | 72 | |
73 | public const int LandUnit = 4; | 73 | public const int LandUnit = 4; |
74 | ======= | ||
75 | public const int landUnit = 4; | ||
76 | >>>>>>> avn/ubitvar | ||
77 | 74 | ||
78 | private static readonly string remoteParcelRequestPath = "0009/"; | 75 | private static readonly string remoteParcelRequestPath = "0009/"; |
79 | 76 | ||
@@ -106,17 +103,12 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
106 | 103 | ||
107 | // caches ExtendedLandData | 104 | // caches ExtendedLandData |
108 | private Cache parcelInfoCache; | 105 | private Cache parcelInfoCache; |
109 | <<<<<<< HEAD | ||
110 | |||
111 | 106 | ||
112 | /// <summary> | 107 | /// <summary> |
113 | /// Record positions that avatar's are currently being forced to move to due to parcel entry restrictions. | 108 | /// Record positions that avatar's are currently being forced to move to due to parcel entry restrictions. |
114 | /// </summary> | 109 | /// </summary> |
115 | private Dictionary<UUID, Vector3> forcedPosition = new Dictionary<UUID, Vector3>(); | 110 | private Dictionary<UUID, Vector3> forcedPosition = new Dictionary<UUID, Vector3>(); |
116 | ======= | 111 | |
117 | private Dictionary<UUID, Vector3> forcedPosition = | ||
118 | new Dictionary<UUID, Vector3>(); | ||
119 | >>>>>>> avn/ubitvar | ||
120 | 112 | ||
121 | // Enables limiting parcel layer info transmission when doing simple updates | 113 | // Enables limiting parcel layer info transmission when doing simple updates |
122 | private bool shouldLimitParcelLayerInfoToViewDistance { get; set; } | 114 | private bool shouldLimitParcelLayerInfoToViewDistance { get; set; } |
@@ -132,7 +124,6 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
132 | 124 | ||
133 | public void Initialise(IConfigSource source) | 125 | public void Initialise(IConfigSource source) |
134 | { | 126 | { |
135 | <<<<<<< HEAD | ||
136 | shouldLimitParcelLayerInfoToViewDistance = true; | 127 | shouldLimitParcelLayerInfoToViewDistance = true; |
137 | parcelLayerViewDistance = 128; | 128 | parcelLayerViewDistance = 128; |
138 | IConfig landManagementConfig = source.Configs["LandManagement"]; | 129 | IConfig landManagementConfig = source.Configs["LandManagement"]; |
@@ -140,24 +131,16 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
140 | { | 131 | { |
141 | shouldLimitParcelLayerInfoToViewDistance = landManagementConfig.GetBoolean("LimitParcelLayerUpdateDistance", shouldLimitParcelLayerInfoToViewDistance); | 132 | shouldLimitParcelLayerInfoToViewDistance = landManagementConfig.GetBoolean("LimitParcelLayerUpdateDistance", shouldLimitParcelLayerInfoToViewDistance); |
142 | parcelLayerViewDistance = landManagementConfig.GetInt("ParcelLayerViewDistance", parcelLayerViewDistance); | 133 | parcelLayerViewDistance = landManagementConfig.GetInt("ParcelLayerViewDistance", parcelLayerViewDistance); |
143 | ======= | 134 | DefaultGodParcelGroup = new UUID(landManagementConfig.GetString("DefaultAdministratorGroupUUID", UUID.Zero.ToString())); |
144 | IConfig cnf = source.Configs["LandManagement"]; | 135 | DefaultGodParcelName = landManagementConfig.GetString("DefaultAdministratorParcelName", "Default Parcel"); |
145 | if (cnf != null) | ||
146 | { | ||
147 | DefaultGodParcelGroup = new UUID(cnf.GetString("DefaultAdministratorGroupUUID", UUID.Zero.ToString())); | ||
148 | DefaultGodParcelName = cnf.GetString("DefaultAdministratorParcelName", "Default Parcel"); | ||
149 | >>>>>>> avn/ubitvar | ||
150 | } | 136 | } |
151 | } | 137 | } |
152 | 138 | ||
153 | public void AddRegion(Scene scene) | 139 | public void AddRegion(Scene scene) |
154 | { | 140 | { |
155 | m_scene = scene; | 141 | m_scene = scene; |
156 | <<<<<<< HEAD | ||
157 | m_landIDList = new int[m_scene.RegionInfo.RegionSizeX / LandUnit, m_scene.RegionInfo.RegionSizeY / LandUnit]; | 142 | m_landIDList = new int[m_scene.RegionInfo.RegionSizeX / LandUnit, m_scene.RegionInfo.RegionSizeY / LandUnit]; |
158 | ======= | 143 | |
159 | m_landIDList = new int[m_scene.RegionInfo.RegionSizeX / landUnit, m_scene.RegionInfo.RegionSizeY / landUnit]; | ||
160 | >>>>>>> avn/ubitvar | ||
161 | landChannel = new LandChannel(scene, this); | 144 | landChannel = new LandChannel(scene, this); |
162 | 145 | ||
163 | parcelInfoCache = new Cache(); | 146 | parcelInfoCache = new Cache(); |
@@ -299,11 +282,8 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
299 | { | 282 | { |
300 | m_landList.Clear(); | 283 | m_landList.Clear(); |
301 | m_lastLandLocalID = LandChannel.START_LAND_LOCAL_ID - 1; | 284 | m_lastLandLocalID = LandChannel.START_LAND_LOCAL_ID - 1; |
302 | <<<<<<< HEAD | 285 | |
303 | m_landIDList = new int[m_scene.RegionInfo.RegionSizeX / LandUnit, m_scene.RegionInfo.RegionSizeY / LandUnit]; | 286 | m_landIDList = new int[m_scene.RegionInfo.RegionSizeX / LandUnit, m_scene.RegionInfo.RegionSizeY / LandUnit]; |
304 | ======= | ||
305 | m_landIDList = new int[m_scene.RegionInfo.RegionSizeX / landUnit, m_scene.RegionInfo.RegionSizeY / landUnit]; | ||
306 | >>>>>>> avn/ubitvar | ||
307 | } | 287 | } |
308 | } | 288 | } |
309 | 289 | ||
@@ -313,16 +293,10 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
313 | /// <returns>The parcel created.</returns> | 293 | /// <returns>The parcel created.</returns> |
314 | protected ILandObject CreateDefaultParcel() | 294 | protected ILandObject CreateDefaultParcel() |
315 | { | 295 | { |
316 | <<<<<<< HEAD | ||
317 | m_log.DebugFormat( | ||
318 | "[LAND MANAGEMENT MODULE]: Creating default parcel for region {0}", m_scene.RegionInfo.RegionName); | ||
319 | |||
320 | ILandObject fullSimParcel = new LandObject(UUID.Zero, false, m_scene); | ||
321 | ======= | ||
322 | m_log.DebugFormat("{0} Creating default parcel for region {1}", LogHeader, m_scene.RegionInfo.RegionName); | 296 | m_log.DebugFormat("{0} Creating default parcel for region {1}", LogHeader, m_scene.RegionInfo.RegionName); |
323 | 297 | ||
324 | ILandObject fullSimParcel = new LandObject(UUID.Zero, false, m_scene); | 298 | ILandObject fullSimParcel = new LandObject(UUID.Zero, false, m_scene); |
325 | >>>>>>> avn/ubitvar | 299 | |
326 | fullSimParcel.SetLandBitmap(fullSimParcel.GetSquareLandBitmap(0, 0, | 300 | fullSimParcel.SetLandBitmap(fullSimParcel.GetSquareLandBitmap(0, 0, |
327 | (int)m_scene.RegionInfo.RegionSizeX, (int)m_scene.RegionInfo.RegionSizeY)); | 301 | (int)m_scene.RegionInfo.RegionSizeX, (int)m_scene.RegionInfo.RegionSizeY)); |
328 | fullSimParcel.LandData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; | 302 | fullSimParcel.LandData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; |
@@ -456,15 +430,10 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
456 | 430 | ||
457 | public void SendLandUpdate(ScenePresence avatar, bool force) | 431 | public void SendLandUpdate(ScenePresence avatar, bool force) |
458 | { | 432 | { |
459 | <<<<<<< HEAD | ||
460 | ILandObject over = GetLandObject((int)Math.Min(((int)m_scene.RegionInfo.RegionSizeX - 1), Math.Max(0, Math.Round(avatar.AbsolutePosition.X))), | ||
461 | (int)Math.Min(((int)m_scene.RegionInfo.RegionSizeY - 1), Math.Max(0, Math.Round(avatar.AbsolutePosition.Y)))); | ||
462 | ======= | ||
463 | if (avatar.IsChildAgent) | 433 | if (avatar.IsChildAgent) |
464 | return; | 434 | return; |
465 | 435 | ||
466 | ILandObject over = GetLandObjectClipedXY(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); | 436 | ILandObject over = GetLandObjectClipedXY(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); |
467 | >>>>>>> avn/ubitvar | ||
468 | 437 | ||
469 | if (over != null) | 438 | if (over != null) |
470 | { | 439 | { |
@@ -621,28 +590,17 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
621 | new_land.LandData.LocalID = newLandLocalID; | 590 | new_land.LandData.LocalID = newLandLocalID; |
622 | 591 | ||
623 | bool[,] landBitmap = new_land.GetLandBitmap(); | 592 | bool[,] landBitmap = new_land.GetLandBitmap(); |
624 | <<<<<<< HEAD | ||
625 | // m_log.DebugFormat("{0} AddLandObject. new_land.bitmapSize=({1},{2}). newLocalID={3}", | ||
626 | // LogHeader, landBitmap.GetLength(0), landBitmap.GetLength(1), newLandLocalID); | ||
627 | |||
628 | ======= | ||
629 | >>>>>>> avn/ubitvar | ||
630 | if (landBitmap.GetLength(0) != m_landIDList.GetLength(0) || landBitmap.GetLength(1) != m_landIDList.GetLength(1)) | 593 | if (landBitmap.GetLength(0) != m_landIDList.GetLength(0) || landBitmap.GetLength(1) != m_landIDList.GetLength(1)) |
631 | { | 594 | { |
632 | // Going to variable sized regions can cause mismatches | 595 | // Going to variable sized regions can cause mismatches |
633 | m_log.ErrorFormat("{0} AddLandObject. Added land bitmap different size than region ID map. bitmapSize=({1},{2}), landIDSize=({3},{4})", | 596 | m_log.ErrorFormat("{0} AddLandObject. Added land bitmap different size than region ID map. bitmapSize=({1},{2}), landIDSize=({3},{4})", |
634 | <<<<<<< HEAD | ||
635 | LogHeader, landBitmap.GetLength(0), landBitmap.GetLength(1), m_landIDList.GetLength(0), m_landIDList.GetLength(1) ); | ||
636 | ======= | ||
637 | LogHeader, landBitmap.GetLength(0), landBitmap.GetLength(1), m_landIDList.GetLength(0), m_landIDList.GetLength(1)); | 597 | LogHeader, landBitmap.GetLength(0), landBitmap.GetLength(1), m_landIDList.GetLength(0), m_landIDList.GetLength(1)); |
638 | >>>>>>> avn/ubitvar | ||
639 | } | 598 | } |
640 | else | 599 | else |
641 | { | 600 | { |
642 | // If other land objects still believe that they occupy any parts of the same space, | 601 | // If other land objects still believe that they occupy any parts of the same space, |
643 | // then do not allow the add to proceed. | 602 | // then do not allow the add to proceed. |
644 | for (int x = 0; x < landBitmap.GetLength(0); x++) | 603 | for (int x = 0; x < landBitmap.GetLength(0); x++) |
645 | <<<<<<< HEAD | ||
646 | { | 604 | { |
647 | for (int y = 0; y < landBitmap.GetLength(1); y++) | 605 | for (int y = 0; y < landBitmap.GetLength(1); y++) |
648 | { | 606 | { |
@@ -658,40 +616,6 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
658 | { | 616 | { |
659 | m_log.ErrorFormat( | 617 | m_log.ErrorFormat( |
660 | "{0}: Cannot add parcel \"{1}\", local ID {2} at tile {3},{4} because this is still occupied by parcel \"{5}\", local ID {6} in {7}", | 618 | "{0}: Cannot add parcel \"{1}\", local ID {2} at tile {3},{4} because this is still occupied by parcel \"{5}\", local ID {6} in {7}", |
661 | LogHeader, new_land.LandData.Name, new_land.LandData.LocalID, x, y, | ||
662 | lastRecordedLo.LandData.Name, lastRecordedLo.LandData.LocalID, m_scene.Name); | ||
663 | |||
664 | return null; | ||
665 | } | ||
666 | } | ||
667 | } | ||
668 | } | ||
669 | } | ||
670 | |||
671 | for (int x = 0; x < landBitmap.GetLength(0); x++) | ||
672 | ======= | ||
673 | >>>>>>> avn/ubitvar | ||
674 | { | ||
675 | for (int y = 0; y < landBitmap.GetLength(1); y++) | ||
676 | { | ||
677 | if (landBitmap[x, y]) | ||
678 | { | ||
679 | <<<<<<< HEAD | ||
680 | // m_log.DebugFormat( | ||
681 | // "[LAND MANAGEMENT MODULE]: Registering parcel {0} for land co-ord ({1}, {2}) on {3}", | ||
682 | // new_land.LandData.Name, x, y, m_scene.RegionInfo.RegionName); | ||
683 | |||
684 | ======= | ||
685 | int lastRecordedLandId = m_landIDList[x, y]; | ||
686 | |||
687 | if (lastRecordedLandId > 0) | ||
688 | { | ||
689 | ILandObject lastRecordedLo = m_landList[lastRecordedLandId]; | ||
690 | |||
691 | if (lastRecordedLo.LandBitmap[x, y]) | ||
692 | { | ||
693 | m_log.ErrorFormat( | ||
694 | "{0}: Cannot add parcel \"{1}\", local ID {2} at tile {3},{4} because this is still occupied by parcel \"{5}\", local ID {6} in {7}", | ||
695 | LogHeader, new_land.LandData.Name, new_land.LandData.LocalID, x, y, | 619 | LogHeader, new_land.LandData.Name, new_land.LandData.LocalID, x, y, |
696 | lastRecordedLo.LandData.Name, lastRecordedLo.LandData.LocalID, m_scene.Name); | 620 | lastRecordedLo.LandData.Name, lastRecordedLo.LandData.LocalID, m_scene.Name); |
697 | 621 | ||
@@ -712,7 +636,6 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
712 | // "[LAND MANAGEMENT MODULE]: Registering parcel {0} for land co-ord ({1}, {2}) on {3}", | 636 | // "[LAND MANAGEMENT MODULE]: Registering parcel {0} for land co-ord ({1}, {2}) on {3}", |
713 | // new_land.LandData.Name, x, y, m_scene.RegionInfo.RegionName); | 637 | // new_land.LandData.Name, x, y, m_scene.RegionInfo.RegionName); |
714 | 638 | ||
715 | >>>>>>> avn/ubitvar | ||
716 | m_landIDList[x, y] = newLandLocalID; | 639 | m_landIDList[x, y] = newLandLocalID; |
717 | } | 640 | } |
718 | } | 641 | } |
@@ -829,33 +752,6 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
829 | /// <returns>Land object at the point supplied</returns> | 752 | /// <returns>Land object at the point supplied</returns> |
830 | public ILandObject GetLandObject(float x_float, float y_float) | 753 | public ILandObject GetLandObject(float x_float, float y_float) |
831 | { | 754 | { |
832 | <<<<<<< HEAD | ||
833 | return GetLandObject((int)x_float, (int)y_float, true /* returnNullIfLandObjectNotFound */); | ||
834 | /* | ||
835 | int x; | ||
836 | int y; | ||
837 | |||
838 | if (x_float >= m_scene.RegionInfo.RegionSizeX || x_float < 0 || y_float >= m_scene.RegionInfo.RegionSizeX || y_float < 0) | ||
839 | return null; | ||
840 | |||
841 | try | ||
842 | { | ||
843 | x = Convert.ToInt32(Math.Floor(Convert.ToDouble(x_float) / (float)landUnit)); | ||
844 | y = Convert.ToInt32(Math.Floor(Convert.ToDouble(y_float) / (float)landUnit)); | ||
845 | } | ||
846 | catch (OverflowException) | ||
847 | { | ||
848 | return null; | ||
849 | } | ||
850 | |||
851 | if (x >= (m_scene.RegionInfo.RegionSizeX / landUnit) | ||
852 | || y >= (m_scene.RegionInfo.RegionSizeY / landUnit) | ||
853 | || x < 0 | ||
854 | || y < 0) | ||
855 | { | ||
856 | return null; | ||
857 | } | ||
858 | ======= | ||
859 | return GetLandObject((int)x_float, (int)y_float, true); | 755 | return GetLandObject((int)x_float, (int)y_float, true); |
860 | } | 756 | } |
861 | 757 | ||
@@ -875,45 +771,18 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
875 | avy = 0; | 771 | avy = 0; |
876 | else if (avy >= m_scene.RegionInfo.RegionSizeY) | 772 | else if (avy >= m_scene.RegionInfo.RegionSizeY) |
877 | avy = (int)Constants.RegionSize - 1; | 773 | avy = (int)Constants.RegionSize - 1; |
878 | >>>>>>> avn/ubitvar | ||
879 | 774 | ||
880 | lock (m_landIDList) | 775 | lock (m_landIDList) |
881 | { | 776 | { |
882 | <<<<<<< HEAD | ||
883 | // Corner case. If an autoreturn happens during sim startup | ||
884 | // we will come here with the list uninitialized | ||
885 | // | ||
886 | // int landId = m_landIDList[x, y]; | ||
887 | |||
888 | // if (landId == 0) | ||
889 | // m_log.DebugFormat( | ||
890 | // "[LAND MANAGEMENT MODULE]: No land object found at ({0}, {1}) on {2}", | ||
891 | // x, y, m_scene.RegionInfo.RegionName); | ||
892 | |||
893 | try | ||
894 | { | ||
895 | if (m_landList.ContainsKey(m_landIDList[x, y])) | ||
896 | return m_landList[m_landIDList[x, y]]; | ||
897 | } | ||
898 | catch (Exception e) | ||
899 | { | ||
900 | m_log.DebugFormat("{0} GetLandObject exception. x={1}, y={2}, m_landIDList.len=({3},{4})", | ||
901 | LogHeader, x, y, m_landIDList.GetLength(0), m_landIDList.GetLength(1)); | ||
902 | } | ||
903 | |||
904 | return null; | ||
905 | ======= | ||
906 | try | 777 | try |
907 | { | 778 | { |
908 | return m_landList[m_landIDList[avx / landUnit, avy / landUnit]]; | 779 | return m_landList[m_landIDList[avx / LandUnit, avy / LandUnit]]; |
909 | } | 780 | } |
910 | catch (IndexOutOfRangeException) | 781 | catch (IndexOutOfRangeException) |
911 | { | 782 | { |
912 | return null; | 783 | return null; |
913 | } | 784 | } |
914 | >>>>>>> avn/ubitvar | ||
915 | } | 785 | } |
916 | */ | ||
917 | } | 786 | } |
918 | 787 | ||
919 | // Public entry. | 788 | // Public entry. |
@@ -923,38 +792,15 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
923 | return GetLandObject(x, y, false /* returnNullIfLandObjectNotFound */); | 792 | return GetLandObject(x, y, false /* returnNullIfLandObjectNotFound */); |
924 | } | 793 | } |
925 | 794 | ||
926 | <<<<<<< HEAD | ||
927 | /// <summary> | ||
928 | /// Given a region position, return the parcel land object for that location | ||
929 | /// </summary> | ||
930 | /// <returns> | ||
931 | /// The land object. | ||
932 | /// </returns> | ||
933 | /// <param name='x'></param> | ||
934 | /// <param name='y'></param> | ||
935 | /// <param name='returnNullIfLandObjectNotFound'> | ||
936 | /// Return null if the land object requested is not within the region's bounds. | ||
937 | /// </param> | ||
938 | private ILandObject GetLandObject(int x, int y, bool returnNullIfLandObjectOutsideBounds) | ||
939 | { | ||
940 | if (x >= m_scene.RegionInfo.RegionSizeX || y >= m_scene.RegionInfo.RegionSizeY || x < 0 || y < 0) | ||
941 | ======= | ||
942 | public ILandObject GetLandObject(int x, int y, bool returnNullIfLandObjectOutsideBounds) | 795 | public ILandObject GetLandObject(int x, int y, bool returnNullIfLandObjectOutsideBounds) |
943 | { | 796 | { |
944 | if (x >= m_scene.RegionInfo.RegionSizeX || y >= m_scene.RegionInfo.RegionSizeY || x < 0 || y < 0) | 797 | if (x >= m_scene.RegionInfo.RegionSizeX || y >= m_scene.RegionInfo.RegionSizeY || x < 0 || y < 0) |
945 | >>>>>>> avn/ubitvar | ||
946 | { | 798 | { |
947 | // These exceptions here will cause a lot of complaints from the users specifically because | 799 | // These exceptions here will cause a lot of complaints from the users specifically because |
948 | // they happen every time at border crossings | 800 | // they happen every time at border crossings |
949 | if (returnNullIfLandObjectOutsideBounds) | 801 | if (returnNullIfLandObjectOutsideBounds) |
950 | return null; | 802 | return null; |
951 | else | 803 | else |
952 | <<<<<<< HEAD | ||
953 | throw new Exception( | ||
954 | String.Format("{0} GetLandObject for non-existent position. Region={1}, pos=<{2},{3}", | ||
955 | LogHeader, m_scene.RegionInfo.RegionName, x, y) | ||
956 | ); | ||
957 | ======= | ||
958 | throw new Exception("Error: Parcel not found at point " + x + ", " + y); | 804 | throw new Exception("Error: Parcel not found at point " + x + ", " + y); |
959 | } | 805 | } |
960 | 806 | ||
@@ -968,7 +814,6 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
968 | { | 814 | { |
969 | return null; | 815 | return null; |
970 | } | 816 | } |
971 | >>>>>>> avn/ubitvar | ||
972 | } | 817 | } |
973 | 818 | ||
974 | return m_landList[m_landIDList[x / 4, y / 4]]; | 819 | return m_landList[m_landIDList[x / 4, y / 4]]; |
@@ -987,19 +832,6 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
987 | return ret; | 832 | return ret; |
988 | } | 833 | } |
989 | 834 | ||
990 | // Create a 'parcel is here' bitmap for the parcel identified by the passed landID | ||
991 | private bool[,] CreateBitmapForID(int landID) | ||
992 | { | ||
993 | bool[,] ret = new bool[m_landIDList.GetLength(0), m_landIDList.GetLength(1)]; | ||
994 | |||
995 | for (int xx = 0; xx < m_landIDList.GetLength(0); xx++) | ||
996 | for (int yy = 0; yy < m_landIDList.GetLength(0); yy++) | ||
997 | if (m_landIDList[xx, yy] == landID) | ||
998 | ret[xx, yy] = true; | ||
999 | |||
1000 | return ret; | ||
1001 | } | ||
1002 | |||
1003 | #endregion | 835 | #endregion |
1004 | 836 | ||
1005 | #region Parcel Modification | 837 | #region Parcel Modification |
@@ -1169,19 +1001,12 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1169 | 1001 | ||
1170 | //Now add the new land object | 1002 | //Now add the new land object |
1171 | ILandObject result = AddLandObject(newLand); | 1003 | ILandObject result = AddLandObject(newLand); |
1172 | <<<<<<< HEAD | ||
1173 | 1004 | ||
1174 | if (result != null) | ||
1175 | { | ||
1176 | UpdateLandObject(startLandObject.LandData.LocalID, startLandObject.LandData); | ||
1177 | result.SendLandUpdateToAvatarsOverMe(); | ||
1178 | } | ||
1179 | ======= | ||
1180 | UpdateLandObject(startLandObject.LandData.LocalID, startLandObject.LandData); | 1005 | UpdateLandObject(startLandObject.LandData.LocalID, startLandObject.LandData); |
1181 | result.SendLandUpdateToAvatarsOverMe(); | 1006 | result.SendLandUpdateToAvatarsOverMe(); |
1182 | startLandObject.SendLandUpdateToAvatarsOverMe(); | 1007 | startLandObject.SendLandUpdateToAvatarsOverMe(); |
1183 | m_scene.ForEachClient(SendParcelOverlay); | 1008 | m_scene.ForEachClient(SendParcelOverlay); |
1184 | >>>>>>> avn/ubitvar | 1009 | |
1185 | } | 1010 | } |
1186 | 1011 | ||
1187 | /// <summary> | 1012 | /// <summary> |
@@ -1263,15 +1088,6 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1263 | 1088 | ||
1264 | #region Parcel Updating | 1089 | #region Parcel Updating |
1265 | 1090 | ||
1266 | <<<<<<< HEAD | ||
1267 | // Send parcel layer info for the whole region | ||
1268 | public void SendParcelOverlay(IClientAPI remote_client) | ||
1269 | { | ||
1270 | SendParcelOverlay(remote_client, 0, 0, (int)Constants.MaximumRegionSize); | ||
1271 | } | ||
1272 | ======= | ||
1273 | >>>>>>> avn/ubitvar | ||
1274 | |||
1275 | /// <summary> | 1091 | /// <summary> |
1276 | /// Send the parcel overlay blocks to the client. We send the overlay packets | 1092 | /// Send the parcel overlay blocks to the client. We send the overlay packets |
1277 | /// around a location and limited by the 'parcelLayerViewDistance'. This number | 1093 | /// around a location and limited by the 'parcelLayerViewDistance'. This number |
@@ -1285,7 +1101,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1285 | /// <param name="xPlace">X position in the region to send surrounding parcel layer info</param> | 1101 | /// <param name="xPlace">X position in the region to send surrounding parcel layer info</param> |
1286 | /// <param name="yPlace">y position in the region to send surrounding parcel layer info</param> | 1102 | /// <param name="yPlace">y position in the region to send surrounding parcel layer info</param> |
1287 | /// <param name="layerViewDistance">Distance from x,y position to send parcel layer info</param> | 1103 | /// <param name="layerViewDistance">Distance from x,y position to send parcel layer info</param> |
1288 | private void SendParcelOverlay(IClientAPI remote_client, int xPlace, int yPlace, int layerViewDistance) | 1104 | public void SendParcelOverlay(IClientAPI remote_client) |
1289 | { | 1105 | { |
1290 | if (remote_client.SceneAgent.PresenceType == PresenceType.Npc) | 1106 | if (remote_client.SceneAgent.PresenceType == PresenceType.Npc) |
1291 | return; | 1107 | return; |
@@ -1295,149 +1111,18 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1295 | byte[] byteArray = new byte[LAND_BLOCKS_PER_PACKET]; | 1111 | byte[] byteArray = new byte[LAND_BLOCKS_PER_PACKET]; |
1296 | int byteArrayCount = 0; | 1112 | int byteArrayCount = 0; |
1297 | int sequenceID = 0; | 1113 | int sequenceID = 0; |
1298 | <<<<<<< HEAD | ||
1299 | |||
1300 | int xLow = 0; | ||
1301 | int xHigh = (int)m_scene.RegionInfo.RegionSizeX; | ||
1302 | int yLow = 0; | ||
1303 | int yHigh = (int)m_scene.RegionInfo.RegionSizeY; | ||
1304 | |||
1305 | if (shouldLimitParcelLayerInfoToViewDistance) | ||
1306 | { | ||
1307 | // Compute view distance around the given point | ||
1308 | int txLow = xPlace - layerViewDistance; | ||
1309 | int txHigh = xPlace + layerViewDistance; | ||
1310 | // If the distance is outside the region area, move the view distance to ba all in the region | ||
1311 | if (txLow < xLow) | ||
1312 | ======= | ||
1313 | 1114 | ||
1314 | // Layer data is in landUnit (4m) chunks | 1115 | // Layer data is in LandUnit (4m) chunks |
1315 | for (int y = 0; y < m_scene.RegionInfo.RegionSizeY; y += landUnit) | 1116 | for (int y = 0; y < m_scene.RegionInfo.RegionSizeY; y += LandUnit) |
1316 | { | 1117 | { |
1317 | for (int x = 0; x < m_scene.RegionInfo.RegionSizeX; x += landUnit) | 1118 | for (int x = 0; x < m_scene.RegionInfo.RegionSizeX; x += LandUnit) |
1318 | >>>>>>> avn/ubitvar | ||
1319 | { | 1119 | { |
1320 | txLow = xLow; | 1120 | byte tempByte = 0; //This represents the byte for the current 4x4 |
1321 | txHigh = Math.Min(yLow + (layerViewDistance * 2), xHigh); | ||
1322 | } | ||
1323 | if (txHigh > xHigh) | ||
1324 | { | ||
1325 | txLow = Math.Max(xLow, xHigh - (layerViewDistance * 2)); | ||
1326 | txHigh = xHigh; | ||
1327 | } | ||
1328 | xLow = txLow; | ||
1329 | xHigh = txHigh; | ||
1330 | 1121 | ||
1331 | <<<<<<< HEAD | ||
1332 | int tyLow = yPlace - layerViewDistance; | ||
1333 | int tyHigh = yPlace + layerViewDistance; | ||
1334 | if (tyLow < yLow) | ||
1335 | { | ||
1336 | tyLow = yLow; | ||
1337 | tyHigh = Math.Min(yLow + (layerViewDistance * 2), yHigh); | ||
1338 | } | ||
1339 | if (tyHigh > yHigh) | ||
1340 | { | ||
1341 | tyLow = Math.Max(yLow, yHigh - (layerViewDistance * 2)); | ||
1342 | tyHigh = yHigh; | ||
1343 | } | ||
1344 | yLow = tyLow; | ||
1345 | yHigh = tyHigh; | ||
1346 | } | ||
1347 | // m_log.DebugFormat("{0} SendParcelOverlay: place=<{1},{2}>, vDist={3}, xLH=<{4},{5}, yLH=<{6},{7}>", | ||
1348 | // LogHeader, xPlace, yPlace, layerViewDistance, xLow, xHigh, yLow, yHigh); | ||
1349 | ======= | ||
1350 | ILandObject currentParcelBlock = GetLandObject(x, y); | 1122 | ILandObject currentParcelBlock = GetLandObject(x, y); |
1351 | >>>>>>> avn/ubitvar | ||
1352 | 1123 | ||
1353 | // Layer data is in landUnit (4m) chunks | 1124 | if (currentParcelBlock != null) |
1354 | for (int y = yLow; y < yHigh / Constants.TerrainPatchSize * (Constants.TerrainPatchSize / LandUnit); y++) | ||
1355 | { | ||
1356 | for (int x = xLow; x < xHigh / Constants.TerrainPatchSize * (Constants.TerrainPatchSize / LandUnit); x++) | ||
1357 | { | ||
1358 | byteArray[byteArrayCount] = BuildLayerByte(GetLandObject(x * LandUnit, y * LandUnit), x, y, remote_client); | ||
1359 | byteArrayCount++; | ||
1360 | if (byteArrayCount >= LAND_BLOCKS_PER_PACKET) | ||
1361 | { | 1125 | { |
1362 | <<<<<<< HEAD | ||
1363 | // m_log.DebugFormat("{0} SendParcelOverlay, sending packet, bytes={1}", LogHeader, byteArray.Length); | ||
1364 | remote_client.SendLandParcelOverlay(byteArray, sequenceID); | ||
1365 | byteArrayCount = 0; | ||
1366 | sequenceID++; | ||
1367 | byteArray = new byte[LAND_BLOCKS_PER_PACKET]; | ||
1368 | } | ||
1369 | |||
1370 | } | ||
1371 | } | ||
1372 | |||
1373 | if (byteArrayCount != 0) | ||
1374 | { | ||
1375 | remote_client.SendLandParcelOverlay(byteArray, sequenceID); | ||
1376 | // m_log.DebugFormat("{0} SendParcelOverlay, complete sending packet, bytes={1}", LogHeader, byteArray.Length); | ||
1377 | } | ||
1378 | } | ||
1379 | |||
1380 | private byte BuildLayerByte(ILandObject currentParcelBlock, int x, int y, IClientAPI remote_client) | ||
1381 | { | ||
1382 | byte tempByte = 0; //This represents the byte for the current 4x4 | ||
1383 | |||
1384 | if (currentParcelBlock != null) | ||
1385 | { | ||
1386 | if (currentParcelBlock.LandData.OwnerID == remote_client.AgentId) | ||
1387 | { | ||
1388 | //Owner Flag | ||
1389 | tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_OWNED_BY_REQUESTER); | ||
1390 | } | ||
1391 | else if (currentParcelBlock.LandData.SalePrice > 0 && | ||
1392 | (currentParcelBlock.LandData.AuthBuyerID == UUID.Zero || | ||
1393 | currentParcelBlock.LandData.AuthBuyerID == remote_client.AgentId)) | ||
1394 | { | ||
1395 | //Sale Flag | ||
1396 | tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_IS_FOR_SALE); | ||
1397 | } | ||
1398 | else if (currentParcelBlock.LandData.OwnerID == UUID.Zero) | ||
1399 | { | ||
1400 | //Public Flag | ||
1401 | tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_PUBLIC); | ||
1402 | } | ||
1403 | else | ||
1404 | { | ||
1405 | //Other Flag | ||
1406 | tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_OWNED_BY_OTHER); | ||
1407 | } | ||
1408 | |||
1409 | //Now for border control | ||
1410 | |||
1411 | ILandObject westParcel = null; | ||
1412 | ILandObject southParcel = null; | ||
1413 | if (x > 0) | ||
1414 | { | ||
1415 | westParcel = GetLandObject((x - 1) * LandUnit, y * LandUnit); | ||
1416 | } | ||
1417 | if (y > 0) | ||
1418 | { | ||
1419 | southParcel = GetLandObject(x * LandUnit, (y - 1) * LandUnit); | ||
1420 | } | ||
1421 | |||
1422 | if (x == 0) | ||
1423 | { | ||
1424 | tempByte = Convert.ToByte(tempByte | LandChannel.LAND_FLAG_PROPERTY_BORDER_WEST); | ||
1425 | } | ||
1426 | else if (westParcel != null && westParcel != currentParcelBlock) | ||
1427 | { | ||
1428 | tempByte = Convert.ToByte(tempByte | LandChannel.LAND_FLAG_PROPERTY_BORDER_WEST); | ||
1429 | } | ||
1430 | |||
1431 | if (y == 0) | ||
1432 | { | ||
1433 | tempByte = Convert.ToByte(tempByte | LandChannel.LAND_FLAG_PROPERTY_BORDER_SOUTH); | ||
1434 | } | ||
1435 | else if (southParcel != null && southParcel != currentParcelBlock) | ||
1436 | { | ||
1437 | tempByte = Convert.ToByte(tempByte | LandChannel.LAND_FLAG_PROPERTY_BORDER_SOUTH); | ||
1438 | } | ||
1439 | |||
1440 | ======= | ||
1441 | // types | 1126 | // types |
1442 | if (currentParcelBlock.LandData.OwnerID == remote_client.AgentId) | 1127 | if (currentParcelBlock.LandData.OwnerID == remote_client.AgentId) |
1443 | { | 1128 | { |
@@ -1525,10 +1210,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1525 | if (byteArrayCount > 0) | 1210 | if (byteArrayCount > 0) |
1526 | { | 1211 | { |
1527 | remote_client.SendLandParcelOverlay(byteArray, sequenceID); | 1212 | remote_client.SendLandParcelOverlay(byteArray, sequenceID); |
1528 | >>>>>>> avn/ubitvar | ||
1529 | } | 1213 | } |
1530 | |||
1531 | return tempByte; | ||
1532 | } | 1214 | } |
1533 | 1215 | ||
1534 | public void ClientOnParcelPropertiesRequest(int start_x, int start_y, int end_x, int end_y, int sequence_id, | 1216 | public void ClientOnParcelPropertiesRequest(int start_x, int start_y, int end_x, int end_y, int sequence_id, |
@@ -1569,10 +1251,6 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1569 | temp[i].SendLandProperties(sequence_id, snap_selection, requestResult, remote_client); | 1251 | temp[i].SendLandProperties(sequence_id, snap_selection, requestResult, remote_client); |
1570 | } | 1252 | } |
1571 | 1253 | ||
1572 | <<<<<<< HEAD | ||
1573 | // Also send the layer data around the point of interest | ||
1574 | SendParcelOverlay(remote_client, (start_x + end_x) / 2, (start_y + end_y) / 2, parcelLayerViewDistance); | ||
1575 | ======= | ||
1576 | // SendParcelOverlay(remote_client); | 1254 | // SendParcelOverlay(remote_client); |
1577 | } | 1255 | } |
1578 | 1256 | ||
@@ -1612,7 +1290,6 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1612 | avatar.currentParcelUUID = parcelID; // force parcel flags review | 1290 | avatar.currentParcelUUID = parcelID; // force parcel flags review |
1613 | }); | 1291 | }); |
1614 | } | 1292 | } |
1615 | >>>>>>> avn/ubitvar | ||
1616 | } | 1293 | } |
1617 | 1294 | ||
1618 | public void ClientOnParcelPropertiesUpdateRequest(LandUpdateArgs args, int localID, IClientAPI remote_client) | 1295 | public void ClientOnParcelPropertiesUpdateRequest(LandUpdateArgs args, int localID, IClientAPI remote_client) |
@@ -1821,35 +1498,17 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1821 | for (int i = 0; i < data.Count; i++) | 1498 | for (int i = 0; i < data.Count; i++) |
1822 | IncomingLandObjectFromStorage(data[i]); | 1499 | IncomingLandObjectFromStorage(data[i]); |
1823 | 1500 | ||
1824 | <<<<<<< HEAD | 1501 | // Layer data is in LandUnit (4m) chunks |
1825 | // Prevent race conditions from any auto-creation of new parcels for varregions whilst we are still loading | ||
1826 | // the existing parcels. | ||
1827 | lock (m_landList) | ||
1828 | { | ||
1829 | for (int i = 0; i < data.Count; i++) | ||
1830 | IncomingLandObjectFromStorage(data[i]); | ||
1831 | |||
1832 | // Layer data is in landUnit (4m) chunks | ||
1833 | for (int y = 0; y < m_scene.RegionInfo.RegionSizeY / Constants.TerrainPatchSize * (Constants.TerrainPatchSize / LandUnit); y++) | 1502 | for (int y = 0; y < m_scene.RegionInfo.RegionSizeY / Constants.TerrainPatchSize * (Constants.TerrainPatchSize / LandUnit); y++) |
1834 | { | 1503 | { |
1835 | for (int x = 0; x < m_scene.RegionInfo.RegionSizeX / Constants.TerrainPatchSize * (Constants.TerrainPatchSize / LandUnit); x++) | 1504 | for (int x = 0; x < m_scene.RegionInfo.RegionSizeX / Constants.TerrainPatchSize * (Constants.TerrainPatchSize / LandUnit); x++) |
1836 | ======= | ||
1837 | // Layer data is in landUnit (4m) chunks | ||
1838 | for (int y = 0; y < m_scene.RegionInfo.RegionSizeY / Constants.TerrainPatchSize * (Constants.TerrainPatchSize / landUnit); y++) | ||
1839 | { | ||
1840 | for (int x = 0; x < m_scene.RegionInfo.RegionSizeX / Constants.TerrainPatchSize * (Constants.TerrainPatchSize / landUnit); x++) | ||
1841 | >>>>>>> avn/ubitvar | ||
1842 | { | 1505 | { |
1843 | if (m_landIDList[x, y] == 0) | 1506 | if (m_landIDList[x, y] == 0) |
1844 | { | 1507 | { |
1845 | if (m_landList.Count == 1) | 1508 | if (m_landList.Count == 1) |
1846 | { | 1509 | { |
1847 | m_log.DebugFormat( | 1510 | m_log.DebugFormat( |
1848 | <<<<<<< HEAD | ||
1849 | "[{0}]: Auto-extending land parcel as landID at {1},{2} is 0 and only one land parcel is present in {3}", | ||
1850 | ======= | ||
1851 | "[{0}]: Auto-extending land parcel as landID at {1},{2} is 0 and only one land parcel is present in {3}", | 1511 | "[{0}]: Auto-extending land parcel as landID at {1},{2} is 0 and only one land parcel is present in {3}", |
1852 | >>>>>>> avn/ubitvar | ||
1853 | LogHeader, x, y, m_scene.Name); | 1512 | LogHeader, x, y, m_scene.Name); |
1854 | 1513 | ||
1855 | int onlyParcelID = 0; | 1514 | int onlyParcelID = 0; |
@@ -1872,19 +1531,11 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1872 | else if (m_landList.Count > 1) | 1531 | else if (m_landList.Count > 1) |
1873 | { | 1532 | { |
1874 | m_log.DebugFormat( | 1533 | m_log.DebugFormat( |
1875 | <<<<<<< HEAD | ||
1876 | "{0}: Auto-creating land parcel as landID at {1},{2} is 0 and more than one land parcel is present in {3}", | ||
1877 | LogHeader, x, y, m_scene.Name); | ||
1878 | |||
1879 | // There are several other parcels so we must create a new one for the unassigned space | ||
1880 | ILandObject newLand = new LandObject(UUID.Zero, false, m_scene); | ||
1881 | ======= | ||
1882 | "{0}: Auto-creating land parcel as landID at {1},{2} is 0 and more than one land parcel is present in {3}", | 1534 | "{0}: Auto-creating land parcel as landID at {1},{2} is 0 and more than one land parcel is present in {3}", |
1883 | LogHeader, x, y, m_scene.Name); | 1535 | LogHeader, x, y, m_scene.Name); |
1884 | 1536 | ||
1885 | // There are several other parcels so we must create a new one for the unassigned space | 1537 | // There are several other parcels so we must create a new one for the unassigned space |
1886 | ILandObject newLand = new LandObject(UUID.Zero, false, m_scene); | 1538 | ILandObject newLand = new LandObject(UUID.Zero, false, m_scene); |
1887 | >>>>>>> avn/ubitvar | ||
1888 | // Claim all the unclaimed "0" ids | 1539 | // Claim all the unclaimed "0" ids |
1889 | newLand.SetLandBitmap(CreateBitmapForID(0)); | 1540 | newLand.SetLandBitmap(CreateBitmapForID(0)); |
1890 | newLand.LandData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; | 1541 | newLand.LandData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; |
@@ -1895,11 +1546,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1895 | { | 1546 | { |
1896 | // We should never reach this point as the separate code path when no land data exists should have fired instead. | 1547 | // We should never reach this point as the separate code path when no land data exists should have fired instead. |
1897 | m_log.WarnFormat( | 1548 | m_log.WarnFormat( |
1898 | <<<<<<< HEAD | ||
1899 | "{0}: Ignoring request to auto-create parcel in {1} as there are no other parcels present", | ||
1900 | ======= | ||
1901 | "{0}: Ignoring request to auto-create parcel in {1} as there are no other parcels present", | 1549 | "{0}: Ignoring request to auto-create parcel in {1} as there are no other parcels present", |
1902 | >>>>>>> avn/ubitvar | ||
1903 | LogHeader, m_scene.Name); | 1550 | LogHeader, m_scene.Name); |
1904 | } | 1551 | } |
1905 | } | 1552 | } |
@@ -1910,13 +1557,9 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1910 | 1557 | ||
1911 | private void IncomingLandObjectFromStorage(LandData data) | 1558 | private void IncomingLandObjectFromStorage(LandData data) |
1912 | { | 1559 | { |
1913 | <<<<<<< HEAD | ||
1914 | ILandObject new_land = new LandObject(data, m_scene); | ||
1915 | ======= | ||
1916 | |||
1917 | ILandObject new_land = new LandObject(data.OwnerID, data.IsGroupOwned, m_scene); | 1560 | ILandObject new_land = new LandObject(data.OwnerID, data.IsGroupOwned, m_scene); |
1918 | new_land.LandData = data.Copy(); | 1561 | new_land.LandData = data.Copy(); |
1919 | >>>>>>> avn/ubitvar | 1562 | |
1920 | new_land.SetLandBitmapFromByteArray(); | 1563 | new_land.SetLandBitmapFromByteArray(); |
1921 | AddLandObject(new_land); | 1564 | AddLandObject(new_land); |
1922 | // new_land.SendLandUpdateToAvatarsOverMe(); | 1565 | // new_land.SendLandUpdateToAvatarsOverMe(); |
@@ -2568,17 +2211,6 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
2568 | 2211 | ||
2569 | private void AppendParcelsSummaryReport(StringBuilder report) | 2212 | private void AppendParcelsSummaryReport(StringBuilder report) |
2570 | { | 2213 | { |
2571 | <<<<<<< HEAD | ||
2572 | report.AppendFormat("Land information for {0}\n", m_scene.Name); | ||
2573 | |||
2574 | ConsoleDisplayTable cdt = new ConsoleDisplayTable(); | ||
2575 | cdt.AddColumn("Parcel Name", ConsoleDisplayUtil.ParcelNameSize); | ||
2576 | cdt.AddColumn("ID", 3); | ||
2577 | cdt.AddColumn("Area", 6); | ||
2578 | cdt.AddColumn("Starts", ConsoleDisplayUtil.VectorSize); | ||
2579 | cdt.AddColumn("Ends", ConsoleDisplayUtil.VectorSize); | ||
2580 | cdt.AddColumn("Owner", ConsoleDisplayUtil.UserNameSize); | ||
2581 | ======= | ||
2582 | report.AppendFormat("Land information for {0}\n", m_scene.RegionInfo.RegionName); | 2214 | report.AppendFormat("Land information for {0}\n", m_scene.RegionInfo.RegionName); |
2583 | report.AppendFormat( | 2215 | report.AppendFormat( |
2584 | "{0,-20} {1,-10} {2,-9} {3,-18} {4,-18} {5,-20}\n", | 2216 | "{0,-20} {1,-10} {2,-9} {3,-18} {4,-18} {5,-20}\n", |
@@ -2588,27 +2220,12 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
2588 | "AABBMin", | 2220 | "AABBMin", |
2589 | "AABBMax", | 2221 | "AABBMax", |
2590 | "Owner"); | 2222 | "Owner"); |
2591 | >>>>>>> avn/ubitvar | ||
2592 | 2223 | ||
2593 | lock (m_landList) | 2224 | lock (m_landList) |
2594 | { | 2225 | { |
2595 | foreach (ILandObject lo in m_landList.Values) | 2226 | foreach (ILandObject lo in m_landList.Values) |
2596 | { | 2227 | { |
2597 | LandData ld = lo.LandData; | 2228 | LandData ld = lo.LandData; |
2598 | <<<<<<< HEAD | ||
2599 | string ownerName; | ||
2600 | if (ld.IsGroupOwned) | ||
2601 | { | ||
2602 | GroupRecord rec = m_groupManager.GetGroupRecord(ld.GroupID); | ||
2603 | ownerName = (rec != null) ? rec.GroupName : "Unknown Group"; | ||
2604 | } | ||
2605 | else | ||
2606 | { | ||
2607 | ownerName = m_userManager.GetUserName(ld.OwnerID); | ||
2608 | } | ||
2609 | cdt.AddRow( | ||
2610 | ld.Name, ld.LocalID, ld.Area, lo.StartPoint, lo.EndPoint, ownerName); | ||
2611 | ======= | ||
2612 | 2229 | ||
2613 | report.AppendFormat( | 2230 | report.AppendFormat( |
2614 | "{0,-20} {1,-10} {2,-9} {3,-18} {4,-18} {5,-20}\n", | 2231 | "{0,-20} {1,-10} {2,-9} {3,-18} {4,-18} {5,-20}\n", |
@@ -2636,11 +2253,8 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
2636 | else | 2253 | else |
2637 | { | 2254 | { |
2638 | ForceAvatarToPosition(avatar, avatar.lastKnownAllowedPosition); | 2255 | ForceAvatarToPosition(avatar, avatar.lastKnownAllowedPosition); |
2639 | >>>>>>> avn/ubitvar | ||
2640 | } | 2256 | } |
2641 | } | 2257 | } |
2642 | |||
2643 | report.Append(cdt.ToString()); | ||
2644 | } | 2258 | } |
2645 | 2259 | ||
2646 | private void AppendParcelReport(StringBuilder report, ILandObject lo) | 2260 | private void AppendParcelReport(StringBuilder report, ILandObject lo) |
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 | ||