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

@ -64,7 +64,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
return m_UserManagement; return m_UserManagement;
} }
} }
public bool CoalesceMultipleObjectsToInventory { get; set; }
#region INonSharedRegionModule #region INonSharedRegionModule
@ -87,10 +88,28 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
if (name == Name) if (name == Name)
{ {
m_Enabled = true; m_Enabled = true;
m_log.InfoFormat("[INVENTORY ACCESS MODULE]: {0} enabled.", Name);
InitialiseCommon(source);
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,20 +225,30 @@ 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>>();
// The following code groups the SOG's by owner. No objects if (CoalesceMultipleObjectsToInventory)
// belonging to different people can be coalesced, for obvious
// reasons.
Dictionary<UUID, List<SceneObjectGroup>> deletes =
new Dictionary<UUID, List<SceneObjectGroup>>();
foreach (SceneObjectGroup g in objectGroups)
{ {
if (!deletes.ContainsKey(g.OwnerID)) // The following code groups the SOG's by owner. No objects
deletes[g.OwnerID] = new List<SceneObjectGroup>(); // belonging to different people can be coalesced, for obvious
// reasons.
deletes[g.OwnerID].Add(g); foreach (SceneObjectGroup g in objectGroups)
{
if (!deletes.ContainsKey(g.OwnerID))
deletes[g.OwnerID] = new List<SceneObjectGroup>();
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

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