mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 11:57:03 +08:00
refactor: Move Scene.Inventory.UpdateKnownItem() into Attachments module since this appears to relate solely to attachments
This commit is contained in:
@@ -1799,53 +1799,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateKnownItem(IClientAPI remoteClient, SceneObjectGroup grp, UUID itemID, UUID agentID)
|
||||
{
|
||||
SceneObjectGroup objectGroup = grp;
|
||||
if (objectGroup != null)
|
||||
{
|
||||
if (!grp.HasGroupChanged)
|
||||
{
|
||||
m_log.InfoFormat("[ATTACHMENT]: Save request for {0} which is unchanged", grp.UUID);
|
||||
return;
|
||||
}
|
||||
|
||||
m_log.InfoFormat(
|
||||
"[ATTACHMENT]: Updating asset for attachment {0}, attachpoint {1}",
|
||||
grp.UUID, grp.GetAttachmentPoint());
|
||||
|
||||
string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(objectGroup);
|
||||
|
||||
InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
|
||||
item = InventoryService.GetItem(item);
|
||||
|
||||
if (item != null)
|
||||
{
|
||||
AssetBase asset = CreateAsset(
|
||||
objectGroup.GetPartName(objectGroup.LocalId),
|
||||
objectGroup.GetPartDescription(objectGroup.LocalId),
|
||||
(sbyte)AssetType.Object,
|
||||
Utils.StringToBytes(sceneObjectXml),
|
||||
remoteClient.AgentId);
|
||||
AssetService.Store(asset);
|
||||
|
||||
item.AssetID = asset.FullID;
|
||||
item.Description = asset.Description;
|
||||
item.Name = asset.Name;
|
||||
item.AssetType = asset.Type;
|
||||
item.InvType = (int)InventoryType.Object;
|
||||
|
||||
InventoryService.UpdateItem(item);
|
||||
|
||||
// this gets called when the agent loggs off!
|
||||
if (remoteClient != null)
|
||||
{
|
||||
remoteClient.SendInventoryItemCreateUpdate(item, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public UUID attachObjectAssetStore(IClientAPI remoteClient, SceneObjectGroup grp, UUID AgentId, out UUID itemID)
|
||||
{
|
||||
itemID = UUID.Zero;
|
||||
|
||||
Reference in New Issue
Block a user