From cd8bb316ea1bd0fc039c63ad75500a3b9c2d4248 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Wed, 14 Jul 2010 03:59:26 +0200 Subject: [PATCH 1/5] Remove getting the object capacity from the money module. It is now set directly from the Region Info (and the region ini file) --- .../CoreModules/World/Land/LandObject.cs | 4 ++-- OpenSim/Region/Framework/Scenes/Scene.cs | 18 +----------------- .../World/MoneyModule/SampleMoneyModule.cs | 7 +++---- 3 files changed, 6 insertions(+), 23 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index 39451421c3..2a87da28bb 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs @@ -146,7 +146,7 @@ namespace OpenSim.Region.CoreModules.World.Land else { // Normal Calculations - return (int)Math.Round(((float)LandData.Area / 65536.0f) * (float)m_scene.objectCapacity * (float)m_scene.RegionInfo.RegionSettings.ObjectBonus); + return (int)Math.Round(((float)LandData.Area / 65536.0f) * (float)m_scene.RegionInfo.ObjectCapacity * (float)m_scene.RegionInfo.RegionSettings.ObjectBonus); } } public int GetSimulatorMaxPrimCount(ILandObject thisObject) @@ -158,7 +158,7 @@ namespace OpenSim.Region.CoreModules.World.Land else { //Normal Calculations - return m_scene.objectCapacity; + return m_scene.RegionInfo.ObjectCapacity; } } #endregion diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index f7d2d374be..40176ec7a6 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -478,8 +478,6 @@ namespace OpenSim.Region.Framework.Scenes set { m_sceneGraph.RestorePresences = value; } } - public int objectCapacity = 45000; - #endregion #region BinaryStats @@ -687,7 +685,7 @@ namespace OpenSim.Region.Framework.Scenes StatsReporter.OnSendStatsResult += SendSimStatsPackets; StatsReporter.OnStatsIncorrect += m_sceneGraph.RecalculateStats; - StatsReporter.SetObjectCapacity(objectCapacity); + StatsReporter.SetObjectCapacity(RegionInfo.ObjectCapacity); // Old /* @@ -4119,20 +4117,6 @@ namespace OpenSim.Region.Framework.Scenes #region Other Methods - public void SetObjectCapacity(int objects) - { - // Region specific config overrides global - // - if (RegionInfo.ObjectCapacity != 0) - objects = RegionInfo.ObjectCapacity; - - if (StatsReporter != null) - { - StatsReporter.SetObjectCapacity(objects); - } - objectCapacity = objects; - } - #endregion public void HandleObjectPermissionsUpdate(IClientAPI controller, UUID agentID, UUID sessionID, byte field, uint localId, uint mask, byte set) diff --git a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs index 6f5ef9e9f8..653f856664 100644 --- a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs +++ b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs @@ -138,8 +138,6 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule public void AddRegion(Scene scene) { // Send ObjectCapacity to Scene.. Which sends it to the SimStatsReporter. - scene.SetObjectCapacity(ObjectCapacity); - if (m_enabled) { scene.RegisterModuleInterface(this); @@ -252,7 +250,6 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule if (config == "Economy" && startupConfig != null) { - ObjectCapacity = startupConfig.GetInt("ObjectCapacity", 45000); PriceEnergyUnit = startupConfig.GetInt("PriceEnergyUnit", 100); PriceObjectClaim = startupConfig.GetInt("PriceObjectClaim", 10); PricePublicObjectDecay = startupConfig.GetInt("PricePublicObjectDecay", 4); @@ -701,7 +698,9 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule if (user != null) { - user.SendEconomyData(EnergyEfficiency, ObjectCapacity, ObjectCount, PriceEnergyUnit, PriceGroupCreate, + Scene s = LocateSceneClientIn(user.AgentId); + + user.SendEconomyData(EnergyEfficiency, s.RegionInfo.ObjectCapacity, ObjectCount, PriceEnergyUnit, PriceGroupCreate, PriceObjectClaim, PriceObjectRent, PriceObjectScaleFactor, PriceParcelClaim, PriceParcelClaimFactor, PriceParcelRent, PricePublicObjectDecay, PricePublicObjectDelete, PriceRentLight, PriceUpload, TeleportMinPrice, TeleportPriceExponent); From d64c09160c6281337501f9fd9a218947252d7382 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Wed, 14 Jul 2010 04:18:13 -0700 Subject: [PATCH 2/5] Removed some more debug messages. --- .../Inventory/HGInventoryBroker.cs | 34 +++++++++---------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs index 4ec5253e58..97161fcbd1 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs @@ -253,7 +253,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory public InventoryFolderBase GetRootFolder(UUID userID) { - m_log.DebugFormat("[HG INVENTORY CONNECTOR]: GetRootFolder for {0}", userID); + //m_log.DebugFormat("[HG INVENTORY CONNECTOR]: GetRootFolder for {0}", userID); string invURL = GetInventoryServiceURL(userID); @@ -267,7 +267,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory public InventoryFolderBase GetFolderForType(UUID userID, AssetType type) { - m_log.DebugFormat("[HG INVENTORY CONNECTOR]: GetFolderForType {0} type {1}", userID, type); + //m_log.DebugFormat("[HG INVENTORY CONNECTOR]: GetFolderForType {0} type {1}", userID, type); string invURL = GetInventoryServiceURL(userID); @@ -281,7 +281,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory public InventoryCollection GetFolderContent(UUID userID, UUID folderID) { - m_log.Debug("[HG INVENTORY CONNECTOR]: GetFolderContent " + folderID); + //m_log.Debug("[HG INVENTORY CONNECTOR]: GetFolderContent " + folderID); string invURL = GetInventoryServiceURL(userID); @@ -296,7 +296,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory public List GetFolderItems(UUID userID, UUID folderID) { - m_log.Debug("[HG INVENTORY CONNECTOR]: GetFolderItems " + folderID); + //m_log.Debug("[HG INVENTORY CONNECTOR]: GetFolderItems " + folderID); string invURL = GetInventoryServiceURL(userID); @@ -314,7 +314,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory if (folder == null) return false; - m_log.Debug("[HG INVENTORY CONNECTOR]: AddFolder " + folder.ID); + //m_log.Debug("[HG INVENTORY CONNECTOR]: AddFolder " + folder.ID); string invURL = GetInventoryServiceURL(folder.Owner); @@ -331,7 +331,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory if (folder == null) return false; - m_log.Debug("[HG INVENTORY CONNECTOR]: UpdateFolder " + folder.ID); + //m_log.Debug("[HG INVENTORY CONNECTOR]: UpdateFolder " + folder.ID); string invURL = GetInventoryServiceURL(folder.Owner); @@ -350,7 +350,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory if (folderIDs.Count == 0) return false; - m_log.Debug("[HG INVENTORY CONNECTOR]: DeleteFolders for " + ownerID); + //m_log.Debug("[HG INVENTORY CONNECTOR]: DeleteFolders for " + ownerID); string invURL = GetInventoryServiceURL(ownerID); @@ -367,7 +367,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory if (folder == null) return false; - m_log.Debug("[HG INVENTORY CONNECTOR]: MoveFolder for " + folder.Owner); + //m_log.Debug("[HG INVENTORY CONNECTOR]: MoveFolder for " + folder.Owner); string invURL = GetInventoryServiceURL(folder.Owner); @@ -384,7 +384,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory if (folder == null) return false; - m_log.Debug("[HG INVENTORY CONNECTOR]: PurgeFolder for " + folder.Owner); + //m_log.Debug("[HG INVENTORY CONNECTOR]: PurgeFolder for " + folder.Owner); string invURL = GetInventoryServiceURL(folder.Owner); @@ -401,7 +401,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory if (item == null) return false; - m_log.Debug("[HG INVENTORY CONNECTOR]: AddItem " + item.ID); + //m_log.Debug("[HG INVENTORY CONNECTOR]: AddItem " + item.ID); string invURL = GetInventoryServiceURL(item.Owner); @@ -418,7 +418,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory if (item == null) return false; - m_log.Debug("[HG INVENTORY CONNECTOR]: UpdateItem " + item.ID); + //m_log.Debug("[HG INVENTORY CONNECTOR]: UpdateItem " + item.ID); string invURL = GetInventoryServiceURL(item.Owner); @@ -437,7 +437,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory if (items.Count == 0) return true; - m_log.Debug("[HG INVENTORY CONNECTOR]: MoveItems for " + ownerID); + //m_log.Debug("[HG INVENTORY CONNECTOR]: MoveItems for " + ownerID); string invURL = GetInventoryServiceURL(ownerID); @@ -451,15 +451,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory public bool DeleteItems(UUID ownerID, List itemIDs) { - m_log.DebugFormat("[HG INVENTORY CONNECTOR]: Delete {0} items for user {1}", itemIDs.Count, ownerID); + //m_log.DebugFormat("[HG INVENTORY CONNECTOR]: Delete {0} items for user {1}", itemIDs.Count, ownerID); if (itemIDs == null) return false; if (itemIDs.Count == 0) return true; - m_log.Debug("[HG INVENTORY CONNECTOR]: DeleteItems for " + ownerID); - string invURL = GetInventoryServiceURL(ownerID); if (invURL == null) // not there, forward to local inventory connector to resolve @@ -474,7 +472,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory { if (item == null) return null; - m_log.Debug("[HG INVENTORY CONNECTOR]: GetItem " + item.ID); + //m_log.Debug("[HG INVENTORY CONNECTOR]: GetItem " + item.ID); string invURL = GetInventoryServiceURL(item.Owner); @@ -491,7 +489,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory if (folder == null) return null; - m_log.Debug("[HG INVENTORY CONNECTOR]: GetFolder " + folder.ID); + //m_log.Debug("[HG INVENTORY CONNECTOR]: GetFolder " + folder.ID); string invURL = GetInventoryServiceURL(folder.Owner); @@ -515,7 +513,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory public int GetAssetPermissions(UUID userID, UUID assetID) { - m_log.Debug("[HG INVENTORY CONNECTOR]: GetAssetPermissions " + assetID); + //m_log.Debug("[HG INVENTORY CONNECTOR]: GetAssetPermissions " + assetID); string invURL = GetInventoryServiceURL(userID); From 87fb19162ed0a7a66c576deda25717efa24029b2 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Wed, 14 Jul 2010 06:57:56 -0700 Subject: [PATCH 3/5] More on mantis #4869. This fixes the problem of objects showing up as no copy when they are copy-able. It works, but I have no idea what I'm doing. --- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 34461dc2d3..daacdf0886 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -276,6 +276,7 @@ namespace OpenSim.Region.Framework.Scenes { if (UUID.Zero == transactionID) { + m_log.DebugFormat("[XXX] UUID.Zero = transactionID"); item.Name = itemUpd.Name; item.Description = itemUpd.Description; item.NextPermissions = itemUpd.NextPermissions & item.BasePermissions; @@ -302,6 +303,7 @@ namespace OpenSim.Region.Framework.Scenes } else { + m_log.DebugFormat("[XXX] UUID.Zero != transactionID"); IAgentAssetTransactions agentTransactions = this.RequestModuleInterface(); if (agentTransactions != null) { @@ -386,6 +388,7 @@ namespace OpenSim.Region.Framework.Scenes if (Permissions.PropagatePermissions() && recipient != senderId) { + m_log.Debug("[XXX] Permissions.PropagatePermissions()"); // Trying to do this right this time. This is evil. If // you believe in Good, go elsewhere. Vampires and other // evil creatores only beyond this point. You have been @@ -449,12 +452,18 @@ namespace OpenSim.Region.Framework.Scenes (uint)PermissionMask.Modify) != 0 ? true : false; + bool isRootCopy = (item.CurrentPermissions & + (uint)PermissionMask.Copy) != 0 ? + true : false; + // Mask the owner perms to the folded perms ownerPerms &= foldedPerms; // If the root was mod, let the mask reflect that if (isRootMod) ownerPerms |= (uint)PermissionMask.Modify; + if (isRootCopy) + ownerPerms |= (uint)PermissionMask.Copy; } // These will be applied to the root prim at next rez. From bec1d7cc36bb01beed912b482612a69ff14287c9 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Wed, 14 Jul 2010 07:00:24 -0700 Subject: [PATCH 4/5] Removed left-over debug messages. --- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index daacdf0886..142143b55e 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -276,7 +276,7 @@ namespace OpenSim.Region.Framework.Scenes { if (UUID.Zero == transactionID) { - m_log.DebugFormat("[XXX] UUID.Zero = transactionID"); + item.Name = itemUpd.Name; item.Description = itemUpd.Description; item.NextPermissions = itemUpd.NextPermissions & item.BasePermissions; @@ -303,7 +303,6 @@ namespace OpenSim.Region.Framework.Scenes } else { - m_log.DebugFormat("[XXX] UUID.Zero != transactionID"); IAgentAssetTransactions agentTransactions = this.RequestModuleInterface(); if (agentTransactions != null) { @@ -388,7 +387,6 @@ namespace OpenSim.Region.Framework.Scenes if (Permissions.PropagatePermissions() && recipient != senderId) { - m_log.Debug("[XXX] Permissions.PropagatePermissions()"); // Trying to do this right this time. This is evil. If // you believe in Good, go elsewhere. Vampires and other // evil creatores only beyond this point. You have been From 33aa7ba7dc19a37698d9a799d19a3d2e57b5115b Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 14 Jul 2010 14:59:34 +0100 Subject: [PATCH 5/5] Revert "More on mantis #4869. This fixes the problem of objects showing up as no copy when they are copy-able. It works, but I have no idea what I'm doing." Cuauses a permission escalation. do NOT USE the preceding commit --- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 142143b55e..34461dc2d3 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -276,7 +276,6 @@ namespace OpenSim.Region.Framework.Scenes { if (UUID.Zero == transactionID) { - item.Name = itemUpd.Name; item.Description = itemUpd.Description; item.NextPermissions = itemUpd.NextPermissions & item.BasePermissions; @@ -450,18 +449,12 @@ namespace OpenSim.Region.Framework.Scenes (uint)PermissionMask.Modify) != 0 ? true : false; - bool isRootCopy = (item.CurrentPermissions & - (uint)PermissionMask.Copy) != 0 ? - true : false; - // Mask the owner perms to the folded perms ownerPerms &= foldedPerms; // If the root was mod, let the mask reflect that if (isRootMod) ownerPerms |= (uint)PermissionMask.Modify; - if (isRootCopy) - ownerPerms |= (uint)PermissionMask.Copy; } // These will be applied to the root prim at next rez.