Move more of IAM.RezObject() into DoPreRezWhenFromItem()

remove-scene-viewer
Justin Clark-Casey (justincc) 2011-09-02 00:41:21 +01:00
parent 15ea82e925
commit 9c0a03731d
2 changed files with 29 additions and 27 deletions

View File

@ -719,26 +719,6 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
} }
SceneObjectGroup group = null; SceneObjectGroup group = null;
UUID itemId = UUID.Zero;
// If we have permission to copy then link the rezzed object back to the user inventory
// item that it came from. This allows us to enable 'save object to inventory'
if (!m_Scene.Permissions.BypassPermissions())
{
if ((item.CurrentPermissions & (uint)PermissionMask.Copy)
== (uint)PermissionMask.Copy && (item.Flags & (uint)InventoryItemFlags.ObjectHasMultipleItems) == 0)
{
itemId = item.ID;
}
}
else
{
if ((item.Flags & (uint)InventoryItemFlags.ObjectHasMultipleItems) == 0)
{
// Brave new fullperm world
itemId = item.ID;
}
}
string xmlData = Utils.BytesToString(rezAsset.Data); string xmlData = Utils.BytesToString(rezAsset.Data);
List<SceneObjectGroup> objlist = List<SceneObjectGroup> objlist =
@ -753,8 +733,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
if (e == null || attachment) // Single if (e == null || attachment) // Single
{ {
SceneObjectGroup g = SceneObjectGroup g =
SceneObjectSerializer.FromOriginalXmlFormat( SceneObjectSerializer.FromOriginalXmlFormat(UUID.Zero, xmlData);
itemId, xmlData);
objlist.Add(g); objlist.Add(g);
veclist.Add(new Vector3(0, 0, 0)); veclist.Add(new Vector3(0, 0, 0));
@ -783,8 +763,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
foreach (XmlNode n in groups) foreach (XmlNode n in groups)
{ {
SceneObjectGroup g = SceneObjectGroup g =
SceneObjectSerializer.FromOriginalXmlFormat( SceneObjectSerializer.FromOriginalXmlFormat(UUID.Zero, n.OuterXml);
itemId, n.OuterXml);
objlist.Add(g); objlist.Add(g);
XmlElement el = (XmlElement)n; XmlElement el = (XmlElement)n;
@ -893,6 +873,27 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
private bool DoPreRezWhenFromItem( private bool DoPreRezWhenFromItem(
IClientAPI remoteClient, InventoryItemBase item, List<SceneObjectGroup> objlist, Vector3 pos, bool isAttachment) IClientAPI remoteClient, InventoryItemBase item, List<SceneObjectGroup> objlist, Vector3 pos, bool isAttachment)
{ {
UUID fromUserInventoryItemId = UUID.Zero;
// If we have permission to copy then link the rezzed object back to the user inventory
// item that it came from. This allows us to enable 'save object to inventory'
if (!m_Scene.Permissions.BypassPermissions())
{
if ((item.CurrentPermissions & (uint)PermissionMask.Copy)
== (uint)PermissionMask.Copy && (item.Flags & (uint)InventoryItemFlags.ObjectHasMultipleItems) == 0)
{
fromUserInventoryItemId = item.ID;
}
}
else
{
if ((item.Flags & (uint)InventoryItemFlags.ObjectHasMultipleItems) == 0)
{
// Brave new fullperm world
fromUserInventoryItemId = item.ID;
}
}
int primcount = 0; int primcount = 0;
foreach (SceneObjectGroup g in objlist) foreach (SceneObjectGroup g in objlist)
primcount += g.PrimCount; primcount += g.PrimCount;
@ -958,6 +959,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
foreach (SceneObjectPart part in so.Parts) foreach (SceneObjectPart part in so.Parts)
{ {
part.FromUserInventoryItemID = fromUserInventoryItemId;
if ((part.OwnerID != item.Owner) || if ((part.OwnerID != item.Owner) ||
(item.CurrentPermissions & 16) != 0) (item.CurrentPermissions & 16) != 0)
{ {

View File

@ -208,13 +208,12 @@ namespace OpenSim.Region.Framework.Scenes
/// </value> /// </value>
private UUID m_fromUserInventoryItemID; private UUID m_fromUserInventoryItemID;
public UUID FromUserInventoryItemID public UUID FromUserInventoryItemID
{ {
get { return m_fromUserInventoryItemID; } get { return m_fromUserInventoryItemID; }
set { m_fromUserInventoryItemID = value; }
} }
public scriptEvents AggregateScriptEvents; public scriptEvents AggregateScriptEvents;