aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs')
-rw-r--r--OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs71
1 files changed, 35 insertions, 36 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs b/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs
index 00994fb..e5bdafc 100644
--- a/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs
@@ -1,4 +1,4 @@
1/* 1/*
2 * Copyright (c) Contributors, http://opensimulator.org/ 2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders. 3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 * 4 *
@@ -29,7 +29,7 @@ using System;
29using System.Collections; 29using System.Collections;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using System.Reflection; 31using System.Reflection;
32using libsecondlife; 32using OpenMetaverse;
33using log4net; 33using log4net;
34using Nini.Config; 34using Nini.Config;
35using OpenSim.Region.Environment.Interfaces; 35using OpenSim.Region.Environment.Interfaces;
@@ -38,7 +38,6 @@ using OpenSim.Framework;
38using OpenSim.Framework.Servers; 38using OpenSim.Framework.Servers;
39using OpenSim.Framework.Communications.Capabilities; 39using OpenSim.Framework.Communications.Capabilities;
40using OpenSim.Region.Physics.Manager; 40using OpenSim.Region.Physics.Manager;
41using Axiom.Math;
42using Caps = OpenSim.Framework.Communications.Capabilities.Caps; 41using Caps = OpenSim.Framework.Communications.Capabilities.Caps;
43 42
44namespace OpenSim.Region.Environment.Modules.World.Land 43namespace OpenSim.Region.Environment.Modules.World.Land
@@ -165,10 +164,10 @@ namespace OpenSim.Region.Environment.Modules.World.Land
165 lastLandLocalID = LandChannel.START_LAND_LOCAL_ID - 1; 164 lastLandLocalID = LandChannel.START_LAND_LOCAL_ID - 1;
166 landIDList.Initialize(); 165 landIDList.Initialize();
167 166
168 ILandObject fullSimParcel = new LandObject(LLUUID.Zero, false, m_scene); 167 ILandObject fullSimParcel = new LandObject(UUID.Zero, false, m_scene);
169 168
170 fullSimParcel.setLandBitmap(fullSimParcel.getSquareLandBitmap(0, 0, (int)Constants.RegionSize, (int)Constants.RegionSize)); 169 fullSimParcel.setLandBitmap(fullSimParcel.getSquareLandBitmap(0, 0, (int)Constants.RegionSize, (int)Constants.RegionSize));
171 if (m_scene.RegionInfo.EstateSettings.EstateOwner != LLUUID.Zero) 170 if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero)
172 fullSimParcel.landData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; 171 fullSimParcel.landData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner;
173 else 172 else
174 fullSimParcel.landData.OwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID; 173 fullSimParcel.landData.OwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID;
@@ -176,7 +175,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
176 AddLandObject(fullSimParcel); 175 AddLandObject(fullSimParcel);
177 } 176 }
178 177
179 public List<ILandObject> ParcelsNearPoint(LLVector3 position) 178 public List<ILandObject> ParcelsNearPoint(Vector3 position)
180 { 179 {
181 List<ILandObject> parcelsNear = new List<ILandObject>(); 180 List<ILandObject> parcelsNear = new List<ILandObject>();
182 for (int x = -4; x <= 4; x += 4) 181 for (int x = -4; x <= 4; x += 4)
@@ -205,8 +204,8 @@ namespace OpenSim.Region.Environment.Modules.World.Land
205 "You are not allowed on this parcel because you are banned. Please go away. <3 OpenSim Developers"); 204 "You are not allowed on this parcel because you are banned. Please go away. <3 OpenSim Developers");
206 205
207 avatar.PhysicsActor.Position = 206 avatar.PhysicsActor.Position =
208 new PhysicsVector(avatar.lastKnownAllowedPosition.x, avatar.lastKnownAllowedPosition.y, 207 new PhysicsVector(avatar.lastKnownAllowedPosition.X, avatar.lastKnownAllowedPosition.Y,
209 avatar.lastKnownAllowedPosition.z); 208 avatar.lastKnownAllowedPosition.Z);
210 avatar.PhysicsActor.Velocity = new PhysicsVector(0, 0, 0); 209 avatar.PhysicsActor.Velocity = new PhysicsVector(0, 0, 0);
211 } 210 }
212 else 211 else
@@ -216,7 +215,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
216 } 215 }
217 } 216 }
218 217
219 public void handleAvatarChangingParcel(ScenePresence avatar, int localLandID, LLUUID regionID) 218 public void handleAvatarChangingParcel(ScenePresence avatar, int localLandID, UUID regionID)
220 { 219 {
221 if (m_scene.RegionInfo.RegionID == regionID) 220 if (m_scene.RegionInfo.RegionID == regionID)
222 { 221 {
@@ -353,7 +352,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
353 } 352 }
354 353
355 354
356 public void handleParcelAccessRequest(LLUUID agentID, LLUUID sessionID, uint flags, int sequenceID, 355 public void handleParcelAccessRequest(UUID agentID, UUID sessionID, uint flags, int sequenceID,
357 int landLocalID, IClientAPI remote_client) 356 int landLocalID, IClientAPI remote_client)
358 { 357 {
359 if (landList.ContainsKey(landLocalID)) 358 if (landList.ContainsKey(landLocalID))
@@ -362,7 +361,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
362 } 361 }
363 } 362 }
364 363
365 public void handleParcelAccessUpdateRequest(LLUUID agentID, LLUUID sessionID, uint flags, int landLocalID, 364 public void handleParcelAccessUpdateRequest(UUID agentID, UUID sessionID, uint flags, int landLocalID,
366 List<ParcelManager.ParcelAccessEntry> entries, 365 List<ParcelManager.ParcelAccessEntry> entries,
367 IClientAPI remote_client) 366 IClientAPI remote_client)
368 { 367 {
@@ -385,7 +384,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
385 /// <returns></returns> 384 /// <returns></returns>
386 public ILandObject CreateBaseLand() 385 public ILandObject CreateBaseLand()
387 { 386 {
388 return new LandObject(LLUUID.Zero, false, m_scene); 387 return new LandObject(UUID.Zero, false, m_scene);
389 } 388 }
390 389
391 /// <summary> 390 /// <summary>
@@ -529,7 +528,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
529 528
530 public void AddPrimToLandPrimCounts(SceneObjectGroup obj) 529 public void AddPrimToLandPrimCounts(SceneObjectGroup obj)
531 { 530 {
532 LLVector3 position = obj.AbsolutePosition; 531 Vector3 position = obj.AbsolutePosition;
533 ILandObject landUnderPrim = GetLandObject(position.X, position.Y); 532 ILandObject landUnderPrim = GetLandObject(position.X, position.Y);
534 if (landUnderPrim != null) 533 if (landUnderPrim != null)
535 { 534 {
@@ -548,7 +547,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
548 public void FinalizeLandPrimCountUpdate() 547 public void FinalizeLandPrimCountUpdate()
549 { 548 {
550 //Get Simwide prim count for owner 549 //Get Simwide prim count for owner
551 Dictionary<LLUUID, List<LandObject>> landOwnersAndParcels = new Dictionary<LLUUID, List<LandObject>>(); 550 Dictionary<UUID, List<LandObject>> landOwnersAndParcels = new Dictionary<UUID, List<LandObject>>();
552 foreach (LandObject p in landList.Values) 551 foreach (LandObject p in landList.Values)
553 { 552 {
554 if (!landOwnersAndParcels.ContainsKey(p.landData.OwnerID)) 553 if (!landOwnersAndParcels.ContainsKey(p.landData.OwnerID))
@@ -563,7 +562,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
563 } 562 }
564 } 563 }
565 564
566 foreach (LLUUID owner in landOwnersAndParcels.Keys) 565 foreach (UUID owner in landOwnersAndParcels.Keys)
567 { 566 {
568 int simArea = 0; 567 int simArea = 0;
569 int simPrims = 0; 568 int simPrims = 0;
@@ -617,9 +616,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land
617 /// <param name="start_y">South Point</param> 616 /// <param name="start_y">South Point</param>
618 /// <param name="end_x">East Point</param> 617 /// <param name="end_x">East Point</param>
619 /// <param name="end_y">North Point</param> 618 /// <param name="end_y">North Point</param>
620 /// <param name="attempting_user_id">LLUUID of user who is trying to subdivide</param> 619 /// <param name="attempting_user_id">UUID of user who is trying to subdivide</param>
621 /// <returns>Returns true if successful</returns> 620 /// <returns>Returns true if successful</returns>
622 private void subdivide(int start_x, int start_y, int end_x, int end_y, LLUUID attempting_user_id) 621 private void subdivide(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id)
623 { 622 {
624 //First, lets loop through the points and make sure they are all in the same peice of land 623 //First, lets loop through the points and make sure they are all in the same peice of land
625 //Get the land object at start 624 //Get the land object at start
@@ -658,7 +657,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
658 //Lets create a new land object with bitmap activated at that point (keeping the old land objects info) 657 //Lets create a new land object with bitmap activated at that point (keeping the old land objects info)
659 ILandObject newLand = startLandObject.Copy(); 658 ILandObject newLand = startLandObject.Copy();
660 newLand.landData.Name = "Subdivision of " + newLand.landData.Name; 659 newLand.landData.Name = "Subdivision of " + newLand.landData.Name;
661 newLand.landData.GlobalID = LLUUID.Random(); 660 newLand.landData.GlobalID = UUID.Random();
662 661
663 newLand.setLandBitmap(newLand.getSquareLandBitmap(start_x, start_y, end_x, end_y)); 662 newLand.setLandBitmap(newLand.getSquareLandBitmap(start_x, start_y, end_x, end_y));
664 663
@@ -683,9 +682,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land
683 /// <param name="start_y">y value in first piece of land</param> 682 /// <param name="start_y">y value in first piece of land</param>
684 /// <param name="end_x">x value in second peice of land</param> 683 /// <param name="end_x">x value in second peice of land</param>
685 /// <param name="end_y">y value in second peice of land</param> 684 /// <param name="end_y">y value in second peice of land</param>
686 /// <param name="attempting_user_id">LLUUID of the avatar trying to join the land objects</param> 685 /// <param name="attempting_user_id">UUID of the avatar trying to join the land objects</param>
687 /// <returns>Returns true if successful</returns> 686 /// <returns>Returns true if successful</returns>
688 private void join(int start_x, int start_y, int end_x, int end_y, LLUUID attempting_user_id) 687 private void join(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id)
689 { 688 {
690 end_x -= 4; 689 end_x -= 4;
691 end_y -= 4; 690 end_y -= 4;
@@ -770,13 +769,13 @@ namespace OpenSim.Region.Environment.Modules.World.Land
770 tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_OWNED_BY_REQUESTER); 769 tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_OWNED_BY_REQUESTER);
771 } 770 }
772 else if (currentParcelBlock.landData.SalePrice > 0 && 771 else if (currentParcelBlock.landData.SalePrice > 0 &&
773 (currentParcelBlock.landData.AuthBuyerID == LLUUID.Zero || 772 (currentParcelBlock.landData.AuthBuyerID == UUID.Zero ||
774 currentParcelBlock.landData.AuthBuyerID == remote_client.AgentId)) 773 currentParcelBlock.landData.AuthBuyerID == remote_client.AgentId))
775 { 774 {
776 //Sale Flag 775 //Sale Flag
777 tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_IS_FOR_SALE); 776 tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_IS_FOR_SALE);
778 } 777 }
779 else if (currentParcelBlock.landData.OwnerID == LLUUID.Zero) 778 else if (currentParcelBlock.landData.OwnerID == UUID.Zero)
780 { 779 {
781 //Public Flag 780 //Public Flag
782 tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_PUBLIC); 781 tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_PUBLIC);
@@ -914,7 +913,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
914 { 913 {
915 if (m_scene.ExternalChecks.ExternalChecksCanAbandonParcel(remote_client.AgentId, landList[local_id])) 914 if (m_scene.ExternalChecks.ExternalChecksCanAbandonParcel(remote_client.AgentId, landList[local_id]))
916 { 915 {
917 if (m_scene.RegionInfo.EstateSettings.EstateOwner != LLUUID.Zero) 916 if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero)
918 landList[local_id].landData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; 917 landList[local_id].landData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner;
919 else 918 else
920 landList[local_id].landData.OwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID; 919 landList[local_id].landData.OwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID;
@@ -930,7 +929,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
930 { 929 {
931 if (m_scene.ExternalChecks.ExternalChecksCanReclaimParcel(remote_client.AgentId, landList[local_id])) 930 if (m_scene.ExternalChecks.ExternalChecksCanReclaimParcel(remote_client.AgentId, landList[local_id]))
932 { 931 {
933 if (m_scene.RegionInfo.EstateSettings.EstateOwner != LLUUID.Zero) 932 if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero)
934 landList[local_id].landData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; 933 landList[local_id].landData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner;
935 else 934 else
936 landList[local_id].landData.OwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID; 935 landList[local_id].landData.OwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID;
@@ -979,13 +978,13 @@ namespace OpenSim.Region.Environment.Modules.World.Land
979 } 978 }
980 if (lob != null) 979 if (lob != null)
981 { 980 {
982 LLUUID AuthorizedID = lob.landData.AuthBuyerID; 981 UUID AuthorizedID = lob.landData.AuthBuyerID;
983 int saleprice = lob.landData.SalePrice; 982 int saleprice = lob.landData.SalePrice;
984 LLUUID pOwnerID = lob.landData.OwnerID; 983 UUID pOwnerID = lob.landData.OwnerID;
985 984
986 bool landforsale = ((lob.landData.Flags & 985 bool landforsale = ((lob.landData.Flags &
987 (uint)(Parcel.ParcelFlags.ForSale | Parcel.ParcelFlags.ForSaleObjects | Parcel.ParcelFlags.SellParcelObjects)) != 0); 986 (uint)(Parcel.ParcelFlags.ForSale | Parcel.ParcelFlags.ForSaleObjects | Parcel.ParcelFlags.SellParcelObjects)) != 0);
988 if ((AuthorizedID == LLUUID.Zero || AuthorizedID == e.agentId) && e.parcelPrice >= saleprice && landforsale) 987 if ((AuthorizedID == UUID.Zero || AuthorizedID == e.agentId) && e.parcelPrice >= saleprice && landforsale)
989 { 988 {
990 lock (e) 989 lock (e)
991 { 990 {
@@ -1027,7 +1026,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
1027 AddLandObject(new_land); 1026 AddLandObject(new_land);
1028 } 1027 }
1029 1028
1030 public void ReturnObjectsInParcel(int localID, uint returnType, LLUUID[] agentIDs, LLUUID[] taskIDs, IClientAPI remoteClient) 1029 public void ReturnObjectsInParcel(int localID, uint returnType, UUID[] agentIDs, UUID[] taskIDs, IClientAPI remoteClient)
1031 { 1030 {
1032 ILandObject selectedParcel = null; 1031 ILandObject selectedParcel = null;
1033 lock (landList) 1032 lock (landList)
@@ -1065,7 +1064,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
1065 1064
1066 #region CAPS handler 1065 #region CAPS handler
1067 1066
1068 private void OnRegisterCaps(LLUUID agentID, Caps caps) 1067 private void OnRegisterCaps(UUID agentID, Caps caps)
1069 { 1068 {
1070 string capsBase = "/CAPS/" + caps.CapsObjectPath; 1069 string capsBase = "/CAPS/" + caps.CapsObjectPath;
1071 caps.RegisterHandler("RemoteParcelRequest", 1070 caps.RegisterHandler("RemoteParcelRequest",
@@ -1080,7 +1079,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
1080 // we cheat here: As we don't have (and want) a grid-global parcel-store, we can't return the 1079 // we cheat here: As we don't have (and want) a grid-global parcel-store, we can't return the
1081 // "real" parcelID, because we wouldn't be able to map that to the region the parcel belongs to. 1080 // "real" parcelID, because we wouldn't be able to map that to the region the parcel belongs to.
1082 // So, we create a "fake" parcelID by using the regionHandle (64 bit), and the local (integer) x 1081 // So, we create a "fake" parcelID by using the regionHandle (64 bit), and the local (integer) x
1083 // and y coordinate (each 8 bit), encoded in a LLUUID (128 bit). 1082 // and y coordinate (each 8 bit), encoded in a UUID (128 bit).
1084 // 1083 //
1085 // Request format: 1084 // Request format:
1086 // <llsd> 1085 // <llsd>
@@ -1095,16 +1094,16 @@ namespace OpenSim.Region.Environment.Modules.World.Land
1095 // <uuid>xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</uuid> 1094 // <uuid>xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</uuid>
1096 // </map> 1095 // </map>
1097 // </llsd> 1096 // </llsd>
1098 private string RemoteParcelRequest(string request, string path, string param, LLUUID agentID, Caps caps) 1097 private string RemoteParcelRequest(string request, string path, string param, UUID agentID, Caps caps)
1099 { 1098 {
1100 LLUUID parcelID = LLUUID.Zero; 1099 UUID parcelID = UUID.Zero;
1101 try 1100 try
1102 { 1101 {
1103 Hashtable hash = new Hashtable(); 1102 Hashtable hash = new Hashtable();
1104 hash = (Hashtable)LLSD.LLSDDeserialize(Helpers.StringToField(request)); 1103 hash = (Hashtable)LLSD.LLSDDeserialize(Utils.StringToBytes(request));
1105 if (hash.ContainsKey("region_id") && hash.ContainsKey("location")) 1104 if (hash.ContainsKey("region_id") && hash.ContainsKey("location"))
1106 { 1105 {
1107 LLUUID regionID = (LLUUID)hash["region_id"]; 1106 UUID regionID = (UUID)hash["region_id"];
1108 ArrayList list = (ArrayList)hash["location"]; 1107 ArrayList list = (ArrayList)hash["location"];
1109 uint x = (uint)(double)list[0]; 1108 uint x = (uint)(double)list[0];
1110 uint y = (uint)(double)list[1]; 1109 uint y = (uint)(double)list[1];
@@ -1148,9 +1147,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land
1148 1147
1149 #endregion 1148 #endregion
1150 1149
1151 private void handleParcelInfo(IClientAPI remoteClient, LLUUID parcelID) 1150 private void handleParcelInfo(IClientAPI remoteClient, UUID parcelID)
1152 { 1151 {
1153 if (parcelID == LLUUID.Zero) 1152 if (parcelID == UUID.Zero)
1154 return; 1153 return;
1155 1154
1156 // assume we've got the parcelID we just computed in RemoteParcelRequest 1155 // assume we've got the parcelID we just computed in RemoteParcelRequest