Provide a configuration setting to control whether multiple taken objects are coalesced to inventory

This is the CoalesceMultipleObjectsToInventory setting in [Inventory] in OpenSimDefaults.ini
Default is true.
bulletsim
Justin Clark-Casey (justincc) 2011-04-18 20:03:53 +01:00
parent 03e725ad87
commit 419fc9427e
3 changed files with 54 additions and 15 deletions

View File

@ -75,6 +75,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
if (name == Name) if (name == Name)
{ {
m_Enabled = true; m_Enabled = true;
InitialiseCommon(source);
m_log.InfoFormat("[HG INVENTORY ACCESS MODULE]: {0} enabled.", Name); m_log.InfoFormat("[HG INVENTORY ACCESS MODULE]: {0} enabled.", Name);
IConfig thisModuleConfig = source.Configs["HGInventoryAccessModule"]; IConfig thisModuleConfig = source.Configs["HGInventoryAccessModule"];

View File

@ -65,6 +65,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
} }
} }
public bool CoalesceMultipleObjectsToInventory { get; set; }
#region INonSharedRegionModule #region INonSharedRegionModule
@ -87,11 +88,29 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
if (name == Name) if (name == Name)
{ {
m_Enabled = true; m_Enabled = true;
InitialiseCommon(source);
m_log.InfoFormat("[INVENTORY ACCESS MODULE]: {0} enabled.", Name); m_log.InfoFormat("[INVENTORY ACCESS MODULE]: {0} enabled.", Name);
} }
} }
} }
/// <summary>
/// Common module config for both this and descendant classes.
/// </summary>
/// <param name="source"></param>
protected virtual void InitialiseCommon(IConfigSource source)
{
IConfig inventoryConfig = source.Configs["Inventory"];
if (inventoryConfig != null)
CoalesceMultipleObjectsToInventory
= inventoryConfig.GetBoolean("CoalesceMultipleObjectsToInventory", true);
else
CoalesceMultipleObjectsToInventory = true;
}
public virtual void PostInitialise() public virtual void PostInitialise()
{ {
} }
@ -206,14 +225,13 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
public virtual UUID DeleteToInventory(DeRezAction action, UUID folderID, public virtual UUID DeleteToInventory(DeRezAction action, UUID folderID,
List<SceneObjectGroup> objectGroups, IClientAPI remoteClient) List<SceneObjectGroup> objectGroups, IClientAPI remoteClient)
{ {
UUID ret = UUID.Zero; Dictionary<UUID, List<SceneObjectGroup>> deletes = new Dictionary<UUID, List<SceneObjectGroup>>();
if (CoalesceMultipleObjectsToInventory)
{
// The following code groups the SOG's by owner. No objects // The following code groups the SOG's by owner. No objects
// belonging to different people can be coalesced, for obvious // belonging to different people can be coalesced, for obvious
// reasons. // reasons.
Dictionary<UUID, List<SceneObjectGroup>> deletes =
new Dictionary<UUID, List<SceneObjectGroup>>();
foreach (SceneObjectGroup g in objectGroups) foreach (SceneObjectGroup g in objectGroups)
{ {
if (!deletes.ContainsKey(g.OwnerID)) if (!deletes.ContainsKey(g.OwnerID))
@ -221,6 +239,17 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
deletes[g.OwnerID].Add(g); deletes[g.OwnerID].Add(g);
} }
}
else
{
// If we don't want to coalesce then put every object in its own bundle.
foreach (SceneObjectGroup g in objectGroups)
{
List<SceneObjectGroup> bundle = new List<SceneObjectGroup>();
bundle.Add(g);
deletes[g.UUID] = bundle;
}
}
// This is method scoped and will be returned. It will be the // This is method scoped and will be returned. It will be the
// last created asset id // last created asset id

View File

@ -453,6 +453,13 @@
; ForwardOfflineGroupMessages = true ; ForwardOfflineGroupMessages = true
[Inventory]
; Control whether multiple objects sent to inventory should be coaleseced into a single item
; There are still some issues with coalescence, including the fact that rotation is not restored
; and some assets may be missing from archive files.
CoalesceMultipleObjectsToInventory = true
[ODEPhysicsSettings] [ODEPhysicsSettings]
;## ;##
;## World Settings ;## World Settings