diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs | 85 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Modules/World/Land/LandObject.cs | 4 |
2 files changed, 28 insertions, 61 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs b/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs index 9b1b9b5..00994fb 100644 --- a/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs | |||
@@ -47,14 +47,12 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
47 | { | 47 | { |
48 | private static readonly ILog m_log = | 48 | private static readonly ILog m_log = |
49 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 49 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
50 | 50 | ||
51 | private static readonly string remoteParcelRequestPath = "0009/"; | 51 | private static readonly string remoteParcelRequestPath = "0009/"; |
52 | 52 | ||
53 | private LandChannel landChannel; | 53 | private LandChannel landChannel; |
54 | private Scene m_scene; | 54 | private Scene m_scene; |
55 | 55 | ||
56 | |||
57 | |||
58 | private readonly int[,] landIDList = new int[64, 64]; | 56 | private readonly int[,] landIDList = new int[64, 64]; |
59 | private readonly Dictionary<int, ILandObject> landList = new Dictionary<int, ILandObject>(); | 57 | private readonly Dictionary<int, ILandObject> landList = new Dictionary<int, ILandObject>(); |
60 | 58 | ||
@@ -115,8 +113,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
115 | } | 113 | } |
116 | } | 114 | } |
117 | 115 | ||
118 | |||
119 | |||
120 | public void PostInitialise() | 116 | public void PostInitialise() |
121 | { | 117 | { |
122 | } | 118 | } |
@@ -153,8 +149,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
153 | } | 149 | } |
154 | } | 150 | } |
155 | 151 | ||
156 | |||
157 | |||
158 | public bool AllowedForcefulBans | 152 | public bool AllowedForcefulBans |
159 | { | 153 | { |
160 | get { return m_allowedForcefulBans; } | 154 | get { return m_allowedForcefulBans; } |
@@ -185,11 +179,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
185 | public List<ILandObject> ParcelsNearPoint(LLVector3 position) | 179 | public List<ILandObject> ParcelsNearPoint(LLVector3 position) |
186 | { | 180 | { |
187 | List<ILandObject> parcelsNear = new List<ILandObject>(); | 181 | List<ILandObject> parcelsNear = new List<ILandObject>(); |
188 | int x; | 182 | for (int x = -4; x <= 4; x += 4) |
189 | for (x = -4; x <= 4; x += 4) | ||
190 | { | 183 | { |
191 | int y; | 184 | for (int y = -4; y <= 4; y += 4) |
192 | for (y = -4; y <= 4; y += 4) | ||
193 | { | 185 | { |
194 | ILandObject check = GetLandObject(position.X + x, position.Y + y); | 186 | ILandObject check = GetLandObject(position.X + x, position.Y + y); |
195 | if (check != null) | 187 | if (check != null) |
@@ -286,7 +278,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
286 | ILandObject over = GetLandObject((int)Math.Min(255, Math.Max(0, Math.Round(avatar.AbsolutePosition.X))), | 278 | ILandObject over = GetLandObject((int)Math.Min(255, Math.Max(0, Math.Round(avatar.AbsolutePosition.X))), |
287 | (int)Math.Min(255, Math.Max(0, Math.Round(avatar.AbsolutePosition.Y)))); | 279 | (int)Math.Min(255, Math.Max(0, Math.Round(avatar.AbsolutePosition.Y)))); |
288 | 280 | ||
289 | |||
290 | if (over != null) | 281 | if (over != null) |
291 | { | 282 | { |
292 | if (force) | 283 | if (force) |
@@ -387,6 +378,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
387 | Console.WriteLine("INVALID LOCAL LAND ID"); | 378 | Console.WriteLine("INVALID LOCAL LAND ID"); |
388 | } | 379 | } |
389 | } | 380 | } |
381 | |||
390 | /// <summary> | 382 | /// <summary> |
391 | /// Creates a basic Parcel object without an owner (a zeroed key) | 383 | /// Creates a basic Parcel object without an owner (a zeroed key) |
392 | /// </summary> | 384 | /// </summary> |
@@ -406,13 +398,10 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
406 | new_land.landData.LocalID = lastLandLocalID; | 398 | new_land.landData.LocalID = lastLandLocalID; |
407 | landList.Add(lastLandLocalID, new_land.Copy()); | 399 | landList.Add(lastLandLocalID, new_land.Copy()); |
408 | 400 | ||
409 | |||
410 | bool[,] landBitmap = new_land.getLandBitmap(); | 401 | bool[,] landBitmap = new_land.getLandBitmap(); |
411 | int x; | 402 | for (int x = 0; x < 64; x++) |
412 | for (x = 0; x < 64; x++) | ||
413 | { | 403 | { |
414 | int y; | 404 | for (int y = 0; y < 64; y++) |
415 | for (y = 0; y < 64; y++) | ||
416 | { | 405 | { |
417 | if (landBitmap[x, y]) | 406 | if (landBitmap[x, y]) |
418 | { | 407 | { |
@@ -431,11 +420,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
431 | /// <param name="local_id">Land.localID of the peice of land to remove.</param> | 420 | /// <param name="local_id">Land.localID of the peice of land to remove.</param> |
432 | public void removeLandObject(int local_id) | 421 | public void removeLandObject(int local_id) |
433 | { | 422 | { |
434 | int x; | 423 | for (int x = 0; x < 64; x++) |
435 | for (x = 0; x < 64; x++) | ||
436 | { | 424 | { |
437 | int y; | 425 | for (int y = 0; y < 64; y++) |
438 | for (y = 0; y < 64; y++) | ||
439 | { | 426 | { |
440 | if (landIDList[x, y] == local_id) | 427 | if (landIDList[x, y] == local_id) |
441 | { | 428 | { |
@@ -451,12 +438,10 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
451 | 438 | ||
452 | private void performFinalLandJoin(ILandObject master, ILandObject slave) | 439 | private void performFinalLandJoin(ILandObject master, ILandObject slave) |
453 | { | 440 | { |
454 | int x; | ||
455 | bool[,] landBitmapSlave = slave.getLandBitmap(); | 441 | bool[,] landBitmapSlave = slave.getLandBitmap(); |
456 | for (x = 0; x < 64; x++) | 442 | for (int x = 0; x < 64; x++) |
457 | { | 443 | { |
458 | int y; | 444 | for (int y = 0; y < 64; y++) |
459 | for (y = 0; y < 64; y++) | ||
460 | { | 445 | { |
461 | if (landBitmapSlave[x, y]) | 446 | if (landBitmapSlave[x, y]) |
462 | { | 447 | { |
@@ -519,6 +504,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
519 | } | 504 | } |
520 | return landList[landIDList[x / 4, y / 4]]; | 505 | return landList[landIDList[x / 4, y / 4]]; |
521 | } | 506 | } |
507 | |||
522 | #endregion | 508 | #endregion |
523 | 509 | ||
524 | #region Parcel Modification | 510 | #region Parcel Modification |
@@ -601,7 +587,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
601 | ResetAllLandPrimCounts(); | 587 | ResetAllLandPrimCounts(); |
602 | lock (m_scene.Entities) | 588 | lock (m_scene.Entities) |
603 | { | 589 | { |
604 | foreach (EntityBase obj in m_scene.Entities.Values) | 590 | foreach (EntityBase obj in m_scene.Entities.Values) |
605 | { | 591 | { |
606 | if (obj != null) | 592 | if (obj != null) |
607 | { | 593 | { |
@@ -647,11 +633,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
647 | { | 633 | { |
648 | int totalX = end_x - start_x; | 634 | int totalX = end_x - start_x; |
649 | int totalY = end_y - start_y; | 635 | int totalY = end_y - start_y; |
650 | int y; | 636 | for (int y = 0; y < totalY; y++) |
651 | for (y = 0; y < totalY; y++) | ||
652 | { | 637 | { |
653 | int x; | 638 | for (int x = 0; x < totalX; x++) |
654 | for (x = 0; x < totalX; x++) | ||
655 | { | 639 | { |
656 | ILandObject tempLandObject = GetLandObject(start_x + x, start_y + y); | 640 | ILandObject tempLandObject = GetLandObject(start_x + x, start_y + y); |
657 | if (tempLandObject == null) return; | 641 | if (tempLandObject == null) return; |
@@ -690,9 +674,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
690 | ILandObject result = AddLandObject(newLand); | 674 | ILandObject result = AddLandObject(newLand); |
691 | UpdateLandObject(startLandObject.landData.LocalID, startLandObject.landData); | 675 | UpdateLandObject(startLandObject.landData.LocalID, startLandObject.landData); |
692 | result.sendLandUpdateToAvatarsOverMe(); | 676 | result.sendLandUpdateToAvatarsOverMe(); |
693 | |||
694 | |||
695 | return; | ||
696 | } | 677 | } |
697 | 678 | ||
698 | /// <summary> | 679 | /// <summary> |
@@ -730,7 +711,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
730 | ILandObject masterLandObject = selectedLandObjects[0]; | 711 | ILandObject masterLandObject = selectedLandObjects[0]; |
731 | selectedLandObjects.RemoveAt(0); | 712 | selectedLandObjects.RemoveAt(0); |
732 | 713 | ||
733 | |||
734 | if (selectedLandObjects.Count < 1) | 714 | if (selectedLandObjects.Count < 1) |
735 | { | 715 | { |
736 | return; | 716 | return; |
@@ -753,12 +733,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
753 | performFinalLandJoin(masterLandObject, slaveLandObject); | 733 | performFinalLandJoin(masterLandObject, slaveLandObject); |
754 | } | 734 | } |
755 | 735 | ||
756 | |||
757 | SetPrimsTainted(); | 736 | SetPrimsTainted(); |
758 | 737 | ||
759 | masterLandObject.sendLandUpdateToAvatarsOverMe(); | 738 | masterLandObject.sendLandUpdateToAvatarsOverMe(); |
760 | |||
761 | return; | ||
762 | } | 739 | } |
763 | 740 | ||
764 | #endregion | 741 | #endregion |
@@ -777,17 +754,14 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
777 | int byteArrayCount = 0; | 754 | int byteArrayCount = 0; |
778 | int sequenceID = 0; | 755 | int sequenceID = 0; |
779 | 756 | ||
780 | int y; | 757 | for (int y = 0; y < 64; y++) |
781 | for (y = 0; y < 64; y++) | ||
782 | { | 758 | { |
783 | int x; | 759 | for (int x = 0; x < 64; x++) |
784 | for (x = 0; x < 64; x++) | ||
785 | { | 760 | { |
786 | byte tempByte = 0; //This represents the byte for the current 4x4 | 761 | byte tempByte = 0; //This represents the byte for the current 4x4 |
787 | 762 | ||
788 | ILandObject currentParcelBlock = GetLandObject(x * 4, y * 4); | 763 | ILandObject currentParcelBlock = GetLandObject(x * 4, y * 4); |
789 | 764 | ||
790 | |||
791 | if (currentParcelBlock != null) | 765 | if (currentParcelBlock != null) |
792 | { | 766 | { |
793 | if (currentParcelBlock.landData.OwnerID == remote_client.AgentId) | 767 | if (currentParcelBlock.landData.OwnerID == remote_client.AgentId) |
@@ -813,7 +787,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
813 | tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_OWNED_BY_OTHER); | 787 | tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_OWNED_BY_OTHER); |
814 | } | 788 | } |
815 | 789 | ||
816 | |||
817 | //Now for border control | 790 | //Now for border control |
818 | 791 | ||
819 | ILandObject westParcel = null; | 792 | ILandObject westParcel = null; |
@@ -864,14 +837,11 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
864 | { | 837 | { |
865 | //Get the land objects within the bounds | 838 | //Get the land objects within the bounds |
866 | List<ILandObject> temp = new List<ILandObject>(); | 839 | List<ILandObject> temp = new List<ILandObject>(); |
867 | int x; | ||
868 | int i; | ||
869 | int inc_x = end_x - start_x; | 840 | int inc_x = end_x - start_x; |
870 | int inc_y = end_y - start_y; | 841 | int inc_y = end_y - start_y; |
871 | for (x = 0; x < inc_x; x++) | 842 | for (int x = 0; x < inc_x; x++) |
872 | { | 843 | { |
873 | int y; | 844 | for (int y = 0; y < inc_y; y++) |
874 | for (y = 0; y < inc_y; y++) | ||
875 | { | 845 | { |
876 | ILandObject currentParcel = GetLandObject(start_x + x, start_y + y); | 846 | ILandObject currentParcel = GetLandObject(start_x + x, start_y + y); |
877 | 847 | ||
@@ -892,12 +862,11 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
892 | requestResult = LandChannel.LAND_RESULT_MULTIPLE; | 862 | requestResult = LandChannel.LAND_RESULT_MULTIPLE; |
893 | } | 863 | } |
894 | 864 | ||
895 | for (i = 0; i < temp.Count; i++) | 865 | for (int i = 0; i < temp.Count; i++) |
896 | { | 866 | { |
897 | temp[i].sendLandProperties(sequence_id, snap_selection, requestResult, remote_client); | 867 | temp[i].sendLandProperties(sequence_id, snap_selection, requestResult, remote_client); |
898 | } | 868 | } |
899 | 869 | ||
900 | |||
901 | SendParcelOverlay(remote_client); | 870 | SendParcelOverlay(remote_client); |
902 | } | 871 | } |
903 | 872 | ||
@@ -921,7 +890,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
921 | 890 | ||
922 | public void handleParcelSelectObjectsRequest(int local_id, int request_type, IClientAPI remote_client) | 891 | public void handleParcelSelectObjectsRequest(int local_id, int request_type, IClientAPI remote_client) |
923 | { | 892 | { |
924 | |||
925 | landList[local_id].sendForceObjectSelect(local_id, request_type, remote_client); | 893 | landList[local_id].sendForceObjectSelect(local_id, request_type, remote_client); |
926 | } | 894 | } |
927 | 895 | ||
@@ -954,7 +922,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
954 | landList[local_id].sendLandUpdateToClient(remote_client); | 922 | landList[local_id].sendLandUpdateToClient(remote_client); |
955 | } | 923 | } |
956 | } | 924 | } |
957 | |||
958 | } | 925 | } |
959 | 926 | ||
960 | public void handleParcelReclaim(int local_id, IClientAPI remote_client) | 927 | public void handleParcelReclaim(int local_id, IClientAPI remote_client) |
@@ -972,7 +939,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
972 | landList[local_id].sendLandUpdateToClient(remote_client); | 939 | landList[local_id].sendLandUpdateToClient(remote_client); |
973 | } | 940 | } |
974 | } | 941 | } |
975 | |||
976 | } | 942 | } |
977 | #endregion | 943 | #endregion |
978 | 944 | ||
@@ -1076,7 +1042,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
1076 | { | 1042 | { |
1077 | selectedParcel.returnLandObjects(returnType, agentIDs, remoteClient); | 1043 | selectedParcel.returnLandObjects(returnType, agentIDs, remoteClient); |
1078 | } | 1044 | } |
1079 | |||
1080 | } | 1045 | } |
1081 | 1046 | ||
1082 | public void NoLandDataFromStorage() | 1047 | public void NoLandDataFromStorage() |
@@ -1093,11 +1058,13 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
1093 | obj.setParcelObjectMaxOverride(overrideDel); | 1058 | obj.setParcelObjectMaxOverride(overrideDel); |
1094 | } | 1059 | } |
1095 | } | 1060 | } |
1061 | |||
1096 | public void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel) | 1062 | public void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel) |
1097 | { | 1063 | { |
1098 | } | 1064 | } |
1099 | 1065 | ||
1100 | #region CAPS handler | 1066 | #region CAPS handler |
1067 | |||
1101 | private void OnRegisterCaps(LLUUID agentID, Caps caps) | 1068 | private void OnRegisterCaps(LLUUID agentID, Caps caps) |
1102 | { | 1069 | { |
1103 | string capsBase = "/CAPS/" + caps.CapsObjectPath; | 1070 | string capsBase = "/CAPS/" + caps.CapsObjectPath; |
@@ -1109,7 +1076,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
1109 | return RemoteParcelRequest(request, path, param, agentID, caps); | 1076 | return RemoteParcelRequest(request, path, param, agentID, caps); |
1110 | })); | 1077 | })); |
1111 | } | 1078 | } |
1112 | 1079 | ||
1113 | // we cheat here: As we don't have (and want) a grid-global parcel-store, we can't return the | 1080 | // we cheat here: As we don't have (and want) a grid-global parcel-store, we can't return the |
1114 | // "real" parcelID, because we wouldn't be able to map that to the region the parcel belongs to. | 1081 | // "real" parcelID, because we wouldn't be able to map that to the region the parcel belongs to. |
1115 | // So, we create a "fake" parcelID by using the regionHandle (64 bit), and the local (integer) x | 1082 | // So, we create a "fake" parcelID by using the regionHandle (64 bit), and the local (integer) x |
@@ -1171,11 +1138,11 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
1171 | { | 1138 | { |
1172 | m_log.ErrorFormat("[LAND] Wrong type in request {0}", request); | 1139 | m_log.ErrorFormat("[LAND] Wrong type in request {0}", request); |
1173 | } | 1140 | } |
1174 | 1141 | ||
1175 | LLSDRemoteParcelResponse response = new LLSDRemoteParcelResponse(); | 1142 | LLSDRemoteParcelResponse response = new LLSDRemoteParcelResponse(); |
1176 | response.parcel_id = parcelID; | 1143 | response.parcel_id = parcelID; |
1177 | m_log.DebugFormat("[LAND] got parcelID {0}", parcelID); | 1144 | m_log.DebugFormat("[LAND] got parcelID {0}", parcelID); |
1178 | 1145 | ||
1179 | return LLSDHelpers.SerialiseLLSDReply(response); | 1146 | return LLSDHelpers.SerialiseLLSDReply(response); |
1180 | } | 1147 | } |
1181 | 1148 | ||
@@ -1191,7 +1158,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
1191 | uint x, y; | 1158 | uint x, y; |
1192 | Util.ParseFakeParcelID(parcelID, out regionHandle, out x, out y); | 1159 | Util.ParseFakeParcelID(parcelID, out regionHandle, out x, out y); |
1193 | m_log.DebugFormat("[LAND] got parcelinfo request for regionHandle {0}, x/y {1}/{2}", regionHandle, x, y); | 1160 | m_log.DebugFormat("[LAND] got parcelinfo request for regionHandle {0}, x/y {1}/{2}", regionHandle, x, y); |
1194 | 1161 | ||
1195 | LandData landData; | 1162 | LandData landData; |
1196 | if (regionHandle == m_scene.RegionInfo.RegionHandle) | 1163 | if (regionHandle == m_scene.RegionInfo.RegionHandle) |
1197 | landData = this.GetLandObject(x, y).landData; | 1164 | landData = this.GetLandObject(x, y).landData; |
diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs index 305e236..6388a1c 100644 --- a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs +++ b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs | |||
@@ -116,7 +116,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
116 | return newLand; | 116 | return newLand; |
117 | } | 117 | } |
118 | 118 | ||
119 | 119 | ||
120 | static overrideParcelMaxPrimCountDelegate overrideParcelMaxPrimCount; | 120 | static overrideParcelMaxPrimCountDelegate overrideParcelMaxPrimCount; |
121 | static overrideSimulatorMaxPrimCountDelegate overrideSimulatorMaxPrimCount; | 121 | static overrideSimulatorMaxPrimCountDelegate overrideSimulatorMaxPrimCount; |
122 | 122 | ||
@@ -156,7 +156,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
156 | } | 156 | } |
157 | } | 157 | } |
158 | #endregion | 158 | #endregion |
159 | 159 | ||
160 | #region Packet Request Handling | 160 | #region Packet Request Handling |
161 | 161 | ||
162 | public void sendLandProperties(int sequence_id, bool snap_selection, int request_result, IClientAPI remote_client) | 162 | public void sendLandProperties(int sequence_id, bool snap_selection, int request_result, IClientAPI remote_client) |