aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorSnoopy Pfeffer2014-04-10 11:47:46 +0200
committerSnoopy Pfeffer2014-04-10 11:47:46 +0200
commit32ad66c2744a4b3491c12835ae0c2124c0385b2e (patch)
tree1c7879c0e4a6efd39637d1a65f3ee054efbf8190
parentFixed: when teleporting between grids, the avatar name wasn't always updated. (diff)
downloadopensim-SC_OLD-32ad66c2744a4b3491c12835ae0c2124c0385b2e.zip
opensim-SC_OLD-32ad66c2744a4b3491c12835ae0c2124c0385b2e.tar.gz
opensim-SC_OLD-32ad66c2744a4b3491c12835ae0c2124c0385b2e.tar.bz2
opensim-SC_OLD-32ad66c2744a4b3491c12835ae0c2124c0385b2e.tar.xz
Allows to sell objects on a parcel of land together with that parcel of land. The objects that are sold together with the parcel of land need to fulfill the following preconditions: owned by the current parcel owner, not set to a group, transferrable. This feature does not work for group owned parcels or land bought by a group.
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandObject.cs44
1 files changed, 44 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
index 920eee8..af19ca3 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
@@ -385,9 +385,16 @@ namespace OpenSim.Region.CoreModules.World.Land
385 newData.SalePrice = 0; 385 newData.SalePrice = 0;
386 newData.AuthBuyerID = UUID.Zero; 386 newData.AuthBuyerID = UUID.Zero;
387 newData.Flags &= ~(uint) (ParcelFlags.ForSale | ParcelFlags.ForSaleObjects | ParcelFlags.SellParcelObjects | ParcelFlags.ShowDirectory); 387 newData.Flags &= ~(uint) (ParcelFlags.ForSale | ParcelFlags.ForSaleObjects | ParcelFlags.SellParcelObjects | ParcelFlags.ShowDirectory);
388
389 bool sellObjects = (LandData.Flags & (uint)(ParcelFlags.SellParcelObjects)) != 0
390 && !LandData.IsGroupOwned && !groupOwned;
391 UUID previousOwner = LandData.OwnerID;
392
388 m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); 393 m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData);
389 m_scene.EventManager.TriggerParcelPrimCountUpdate(); 394 m_scene.EventManager.TriggerParcelPrimCountUpdate();
390 SendLandUpdateToAvatarsOverMe(true); 395 SendLandUpdateToAvatarsOverMe(true);
396
397 if (sellObjects) SellLandObjects(previousOwner);
391 } 398 }
392 399
393 public void DeedToGroup(UUID groupID) 400 public void DeedToGroup(UUID groupID)
@@ -1067,6 +1074,43 @@ namespace OpenSim.Region.CoreModules.World.Land
1067 1074
1068 #endregion 1075 #endregion
1069 1076
1077 #region Object Sales
1078
1079 public void SellLandObjects(UUID previousOwner)
1080 {
1081 // m_log.DebugFormat(
1082 // "[LAND OBJECT]: Request to sell objects in {0} from {1}", LandData.Name, previousOwner);
1083
1084 if (LandData.IsGroupOwned)
1085 return;
1086
1087 IBuySellModule m_BuySellModule = m_scene.RequestModuleInterface<IBuySellModule>();
1088 if (m_BuySellModule == null)
1089 {
1090 m_log.Error("[LAND OBJECT]: BuySellModule not found");
1091 return;
1092 }
1093
1094 ScenePresence sp;
1095 if (!m_scene.TryGetScenePresence(LandData.OwnerID, out sp))
1096 {
1097 m_log.Error("[LAND OBJECT]: New owner is not present in scene");
1098 return;
1099 }
1100
1101 lock (primsOverMe)
1102 {
1103 foreach (SceneObjectGroup obj in primsOverMe)
1104 {
1105 if (obj.OwnerID == previousOwner && obj.GroupID == UUID.Zero &&
1106 (obj.GetEffectivePermissions() & (uint)(OpenSim.Framework.PermissionMask.Transfer)) != 0)
1107 m_BuySellModule.BuyObject(sp.ControllingClient, UUID.Zero, obj.LocalId, 1, 0);
1108 }
1109 }
1110 }
1111
1112 #endregion
1113
1070 #region Object Returning 1114 #region Object Returning
1071 1115
1072 public void ReturnObject(SceneObjectGroup obj) 1116 public void ReturnObject(SceneObjectGroup obj)