- move comment about assetID and 'attached' in inventory where it belongs
- objectGroup isn't needed here, just use the passed in argument0.6.0-stable
parent
54d7be8a49
commit
4da1901ed9
|
@ -547,8 +547,6 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
if (group.GetFromAssetID() == UUID.Zero)
|
if (group.GetFromAssetID() == UUID.Zero)
|
||||||
{
|
{
|
||||||
m_parentScene.attachObjectAssetStore(remoteClient, group, remoteClient.AgentId);
|
m_parentScene.attachObjectAssetStore(remoteClient, group, remoteClient.AgentId);
|
||||||
|
|
||||||
// sets assetID so client can show asset as 'attached' in inventory
|
|
||||||
}
|
}
|
||||||
group.AttachToAgent(remoteClient.AgentId, AttachmentPt, attachPos);
|
group.AttachToAgent(remoteClient.AgentId, AttachmentPt, attachPos);
|
||||||
// In case it is later dropped again, don't let
|
// In case it is later dropped again, don't let
|
||||||
|
|
|
@ -1778,24 +1778,23 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
public UUID attachObjectAssetStore(IClientAPI remoteClient, SceneObjectGroup grp, UUID AgentId)
|
public UUID attachObjectAssetStore(IClientAPI remoteClient, SceneObjectGroup grp, UUID AgentId)
|
||||||
{
|
{
|
||||||
SceneObjectGroup objectGroup = grp;
|
if (grp != null)
|
||||||
if (objectGroup != null)
|
|
||||||
{
|
{
|
||||||
string sceneObjectXml = objectGroup.ToXmlString();
|
string sceneObjectXml = grp.ToXmlString();
|
||||||
|
|
||||||
CachedUserInfo userInfo =
|
CachedUserInfo userInfo =
|
||||||
CommsManager.UserProfileCacheService.GetUserDetails(AgentId);
|
CommsManager.UserProfileCacheService.GetUserDetails(AgentId);
|
||||||
if (userInfo != null)
|
if (userInfo != null)
|
||||||
{
|
{
|
||||||
AssetBase asset = CreateAsset(
|
AssetBase asset = CreateAsset(
|
||||||
objectGroup.GetPartName(objectGroup.LocalId),
|
grp.GetPartName(grp.LocalId),
|
||||||
objectGroup.GetPartDescription(objectGroup.LocalId),
|
grp.GetPartDescription(grp.LocalId),
|
||||||
(sbyte)AssetType.Object,
|
(sbyte)AssetType.Object,
|
||||||
Utils.StringToBytes(sceneObjectXml));
|
Utils.StringToBytes(sceneObjectXml));
|
||||||
AssetCache.AddAsset(asset);
|
AssetCache.AddAsset(asset);
|
||||||
|
|
||||||
InventoryItemBase item = new InventoryItemBase();
|
InventoryItemBase item = new InventoryItemBase();
|
||||||
item.Creator = objectGroup.RootPart.CreatorID;
|
item.Creator = grp.RootPart.CreatorID;
|
||||||
item.Owner = remoteClient.AgentId;
|
item.Owner = remoteClient.AgentId;
|
||||||
item.ID = UUID.Random();
|
item.ID = UUID.Random();
|
||||||
item.AssetID = asset.FullID;
|
item.AssetID = asset.FullID;
|
||||||
|
@ -1806,22 +1805,23 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
item.Folder = UUID.Zero; // Objects folder!
|
item.Folder = UUID.Zero; // Objects folder!
|
||||||
|
|
||||||
if ((remoteClient.AgentId != objectGroup.RootPart.OwnerID) && ExternalChecks.ExternalChecksPropagatePermissions())
|
if ((remoteClient.AgentId != grp.RootPart.OwnerID) && ExternalChecks.ExternalChecksPropagatePermissions())
|
||||||
{
|
{
|
||||||
item.BasePermissions = objectGroup.RootPart.NextOwnerMask;
|
item.BasePermissions = grp.RootPart.NextOwnerMask;
|
||||||
item.CurrentPermissions = objectGroup.RootPart.NextOwnerMask;
|
item.CurrentPermissions = grp.RootPart.NextOwnerMask;
|
||||||
item.NextPermissions = objectGroup.RootPart.NextOwnerMask;
|
item.NextPermissions = grp.RootPart.NextOwnerMask;
|
||||||
item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask & objectGroup.RootPart.NextOwnerMask;
|
item.EveryOnePermissions = grp.RootPart.EveryoneMask & grp.RootPart.NextOwnerMask;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
item.BasePermissions = objectGroup.RootPart.BaseMask;
|
item.BasePermissions = grp.RootPart.BaseMask;
|
||||||
item.CurrentPermissions = objectGroup.RootPart.OwnerMask;
|
item.CurrentPermissions = grp.RootPart.OwnerMask;
|
||||||
item.NextPermissions = objectGroup.RootPart.NextOwnerMask;
|
item.NextPermissions = grp.RootPart.NextOwnerMask;
|
||||||
item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask;
|
item.EveryOnePermissions = grp.RootPart.EveryoneMask;
|
||||||
}
|
}
|
||||||
item.CreationDate = Util.UnixTimeSinceEpoch();
|
item.CreationDate = Util.UnixTimeSinceEpoch();
|
||||||
|
|
||||||
|
// sets assetID so client can show asset as 'attached' in inventory
|
||||||
grp.SetFromAssetID(item.ID);
|
grp.SetFromAssetID(item.ID);
|
||||||
|
|
||||||
userInfo.AddItem(item);
|
userInfo.AddItem(item);
|
||||||
|
@ -1832,7 +1832,6 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
return UUID.Zero;
|
return UUID.Zero;
|
||||||
}
|
}
|
||||||
return UUID.Zero;
|
return UUID.Zero;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
Loading…
Reference in New Issue