Should now be able to create and edit Notecards

This commit is contained in:
MW
2007-03-30 11:09:51 +00:00
parent d14a24d5ca
commit 00579d3581
3 changed files with 30 additions and 2 deletions

View File

@@ -341,6 +341,10 @@ namespace OpenSim
{
this.UploadAssets.CreateInventoryItem(createItem);
}
else
{
this.CreateInventoryItem(createItem);
}
break;
case PacketType.FetchInventory:
//Console.WriteLine("fetch item packet");
@@ -735,5 +739,26 @@ namespace OpenSim
}
return inventory;
}
private void CreateInventoryItem(CreateInventoryItemPacket packet)
{
if (packet.InventoryBlock.Type == 7)
{
Console.WriteLine(packet.ToString());
this.debug = true;
//lets try this out with creating a notecard
AssetBase asset = new AssetBase();
asset.Name = Helpers.FieldToString(packet.InventoryBlock.Name);
asset.Description = Helpers.FieldToString(packet.InventoryBlock.Description);
asset.InvType = packet.InventoryBlock.InvType;
asset.Type = packet.InventoryBlock.Type;
asset.FullID = LLUUID.Random();
asset.Data = new byte[0];
Console.WriteLine("created new notecard with asset : " + asset.FullID.ToStringHyphenated());
m_assetCache.AddAsset(asset);
m_inventoryCache.AddNewInventoryItem(this, packet.InventoryBlock.FolderID, asset);
}
}
}
}