More work on inventory and opensim library.

Fixed a number of bugs in the AssetCache related to asset downloading.
afrisby
MW 2007-07-26 17:41:31 +00:00
parent 39b64564dc
commit f0dd115a8c
12 changed files with 725 additions and 433 deletions

File diff suppressed because it is too large Load Diff

View File

@ -9,6 +9,7 @@ namespace OpenSim.Framework.Communications.Caches
public class LibraryRootFolder : InventoryFolder
{
private LLUUID libOwner = new LLUUID("11111111-1111-0000-0000-000100bba000");
private InventoryFolder m_textureFolder;
public LibraryRootFolder()
{
@ -19,11 +20,22 @@ namespace OpenSim.Framework.Communications.Caches
this.type = (short)-1;
this.version = (ushort) 1;
InventoryFolder folderInfo = new InventoryFolder();
folderInfo.agentID = libOwner;
folderInfo.folderID = new LLUUID("00000112-000f-0000-0000-000100bba001");
folderInfo.name = "My Inventory";
folderInfo.parentID = this.folderID;
folderInfo.type = -1;
folderInfo.version = 1;
this.SubFolders.Add(folderInfo.folderID, folderInfo);
this.m_textureFolder = folderInfo;
this.CreateLibraryItems();
}
private void CreateLibraryItems()
{
InventoryItemBase item = new InventoryItemBase();
item.avatarID = libOwner;
item.creatorsID = libOwner;
@ -32,12 +44,12 @@ namespace OpenSim.Framework.Communications.Caches
item.inventoryDescription = "Plywood texture";
item.inventoryName = "Plywood";
item.type = 0;
item.parentFolderID = this.folderID;
item.parentFolderID = m_textureFolder.folderID;
item.inventoryBasePermissions = 0x7FFFFFFF;
item.inventoryEveryOnePermissions = 0x7FFFFFFF;
item.inventoryCurrentPermissions = 0x7FFFFFFF;
item.inventoryNextPermissions = 0x7FFFFFFF;
this.Items.Add(item.inventoryID, item);
this.m_textureFolder.Items.Add(item.inventoryID, item);
item = new InventoryItemBase();
item.avatarID = libOwner;
@ -47,12 +59,12 @@ namespace OpenSim.Framework.Communications.Caches
item.inventoryDescription = "Rocks texture";
item.inventoryName = "Rocks";
item.type = 0;
item.parentFolderID = this.folderID;
item.parentFolderID = m_textureFolder.folderID;
item.inventoryBasePermissions = 0x7FFFFFFF;
item.inventoryEveryOnePermissions = 0x7FFFFFFF;
item.inventoryCurrentPermissions = 0x7FFFFFFF;
item.inventoryNextPermissions = 0x7FFFFFFF;
this.Items.Add(item.inventoryID, item);
this.m_textureFolder.Items.Add(item.inventoryID, item);
item = new InventoryItemBase();
item.avatarID = libOwner;
@ -62,12 +74,12 @@ namespace OpenSim.Framework.Communications.Caches
item.inventoryDescription = "Bricks texture";
item.inventoryName = "Bricks";
item.type = 0;
item.parentFolderID = this.folderID;
item.parentFolderID = m_textureFolder.folderID;
item.inventoryBasePermissions = 0x7FFFFFFF;
item.inventoryEveryOnePermissions = 0x7FFFFFFF;
item.inventoryCurrentPermissions = 0x7FFFFFFF;
item.inventoryNextPermissions = 0x7FFFFFFF;
this.Items.Add(item.inventoryID, item);
this.m_textureFolder.Items.Add(item.inventoryID, item);
item = new InventoryItemBase();
item.avatarID = libOwner;
@ -77,12 +89,12 @@ namespace OpenSim.Framework.Communications.Caches
item.inventoryDescription = "Granite texture";
item.inventoryName = "Granite";
item.type = 0;
item.parentFolderID = this.folderID;
item.parentFolderID = m_textureFolder.folderID;
item.inventoryBasePermissions = 0x7FFFFFFF;
item.inventoryEveryOnePermissions = 0x7FFFFFFF;
item.inventoryCurrentPermissions = 0x7FFFFFFF;
item.inventoryNextPermissions = 0x7FFFFFFF;
this.Items.Add(item.inventoryID, item);
this.m_textureFolder.Items.Add(item.inventoryID, item);
item = new InventoryItemBase();
item.avatarID = libOwner;
@ -92,12 +104,12 @@ namespace OpenSim.Framework.Communications.Caches
item.inventoryDescription = "Hardwood texture";
item.inventoryName = "Hardwood";
item.type = 0;
item.parentFolderID = this.folderID;
item.parentFolderID = m_textureFolder.folderID;
item.inventoryBasePermissions = 0x7FFFFFFF;
item.inventoryEveryOnePermissions = 0x7FFFFFFF;
item.inventoryCurrentPermissions = 0x7FFFFFFF;
item.inventoryNextPermissions = 0x7FFFFFFF;
this.Items.Add(item.inventoryID, item);
this.m_textureFolder.Items.Add(item.inventoryID, item);
item = new InventoryItemBase();
item.avatarID = libOwner;
@ -111,6 +123,36 @@ namespace OpenSim.Framework.Communications.Caches
item.inventoryCurrentPermissions = 0;
item.inventoryNextPermissions = 0;
this.Items.Add(item.inventoryID, item);
item = new InventoryItemBase();
item.avatarID = libOwner;
item.creatorsID = libOwner;
item.inventoryID = new LLUUID("77c41e39-38f9-f75a-024e-585989bfabc9");
item.assetID = new LLUUID("77c41e39-38f9-f75a-024e-585989bbabbb");
item.inventoryDescription = "Default Skin";
item.inventoryName = "Default Skin";
item.type = 13;
item.parentFolderID = this.folderID;
item.inventoryCurrentPermissions = 0;
item.inventoryNextPermissions = 0;
this.Items.Add(item.inventoryID, item);
item = new InventoryItemBase();
item.avatarID = libOwner;
item.creatorsID = libOwner;
item.inventoryID = new LLUUID("00000000-0000-2222-4444-000000000001");
item.assetID = new LLUUID("00000000-0000-2222-3333-000000000001");
item.inventoryDescription = "Welcome";
item.inventoryName = "Welcome";
item.type = 7;
item.parentFolderID = this.folderID;
item.inventoryCurrentPermissions = (1 << 15);
item.inventoryNextPermissions = (1 << 15);
item.inventoryEveryOnePermissions = (1 << 15);
item.inventoryBasePermissions = (1 << 15);
this.Items.Add(item.inventoryID, item);
}
}

View File

@ -116,10 +116,15 @@ namespace OpenSim.Framework.Communications.Caches
public void HandleFecthInventoryDescendents(IClientAPI remoteClient, LLUUID folderID, LLUUID ownerID, bool fetchFolders, bool fetchItems, int sortOrder)
{
InventoryFolder fold = null;
if (folderID == libraryRoot.folderID )
{
remoteClient.SendInventoryFolderDetails(libraryRoot.agentID, libraryRoot.folderID, libraryRoot.RequestListOfItems());
}
else if (( fold = libraryRoot.HasSubFolder(folderID)) != null)
{
remoteClient.SendInventoryFolderDetails(libraryRoot.agentID, folderID, fold.RequestListOfItems());
}
else if (this.UserProfiles.ContainsKey(remoteClient.AgentId))
{
CachedUserInfo info = this.UserProfiles[remoteClient.AgentId];

View File

@ -156,6 +156,11 @@ namespace OpenSim.Framework.Interfaces
get;
}
LLUUID SessionId
{
get;
}
string FirstName
{
get;

View File

@ -84,6 +84,11 @@ namespace OpenSim.Framework
get { return m_uuid; }
}
public LLUUID SessionId
{
get { return LLUUID.Zero; }
}
public virtual string FirstName
{
get { return ""; }

View File

@ -50,6 +50,9 @@ namespace OpenSim.Framework.Types
}
defaultWearables[0].AssetID = new LLUUID("66c41e39-38f9-f75a-024e-585989bfab73");
defaultWearables[0].ItemID = new LLUUID("66c41e39-38f9-f75a-024e-585989bfaba9");
//defaultWearables[1].ItemID = new LLUUID("77c41e39-38f9-f75a-024e-585989bfabc9");
//defaultWearables[1].AssetID = new LLUUID("77c41e39-38f9-f75a-024e-585989bbabbb");
return defaultWearables;
}
}

View File

@ -361,6 +361,14 @@ namespace OpenSim.Framework.UserManagement
TempHash["folder_id"] = "00000112-000f-0000-0000-000100bba000";
ArrayList temp = new ArrayList();
temp.Add(TempHash);
TempHash = new Hashtable();
TempHash["name"] = "Texture Library";
TempHash["parent_id"] = "00000112-000f-0000-0000-000100bba000";
TempHash["version"] = "1";
TempHash["type_default"] = "-1";
TempHash["folder_id"] = "00000112-000f-0000-0000-000100bba001";
temp.Add(TempHash);
return temp;
}

View File

@ -123,6 +123,14 @@ namespace OpenSim.Region.ClientStack
}
}
public LLUUID SessionId
{
get
{
return this.SessionID;
}
}
/// <summary>
///
/// </summary>

View File

@ -103,6 +103,11 @@ namespace SimpleApp
get { return myID; }
}
public LLUUID SessionId
{
get { return LLUUID.Zero; }
}
public virtual string FirstName
{
get { return "Annoying"; }

View File

@ -258,9 +258,25 @@ namespace OpenSim.Region.GridInterfaces.Local
db.Set(store);
db.Commit();*/
Image = new AssetBase();
Image.FullID = new LLUUID("77c41e39-38f9-f75a-024e-585989bbabbb");
Image.Name = "Skin";
Image.Type = 13;
Image.InvType = 13;
this.LoadAsset(Image, false, "base_skin.dat");
store = new AssetStorage();
store.Data = Image.Data;
store.Name = Image.Name;
store.UUID = Image.FullID;
db.Set(store);
db.Commit();
Image = new AssetBase();
Image.FullID = new LLUUID("66c41e39-38f9-f75a-024e-585989bfab73");
Image.Name = "Shape";
Image.Type = 13;
Image.InvType = 13;
this.LoadAsset(Image, false, "base_shape.dat");
store = new AssetStorage();
store.Data = Image.Data;
@ -268,6 +284,20 @@ namespace OpenSim.Region.GridInterfaces.Local
store.UUID = Image.FullID;
db.Set(store);
db.Commit();
Image = new AssetBase();
Image.FullID = new LLUUID("00000000-0000-2222-3333-000000000001");
Image.Name = "WelcomeNote";
Image.Type = 7;
Image.InvType = 7;
this.LoadAsset(Image, false, "welcomeNote.dat");
store = new AssetStorage();
store.Data = Image.Data;
store.Name = Image.Name;
store.UUID = Image.FullID;
db.Set(store);
db.Commit();
}
private void LoadAsset(AssetBase info, bool image, string filename)

52
bin/assets/base_skin.dat Normal file
View File

@ -0,0 +1,52 @@
LLWearable version 22
Sexy - Female Skin
permissions 0
{
base_mask 00000000
owner_mask 00000000
group_mask 00000000
everyone_mask 00000000
next_owner_mask 00000000
creator_id 11111111-1111-0000-0000-000100bba000
owner_id 11111111-1111-0000-0000-000100bba000
last_owner_id 11111111-1111-0000-0000-000100bba000
group_id 00000000-0000-0000-0000-000000000000
}
sale_info 0
{
sale_type not
sale_price 10
}
type 1
parameters 26
108 0
110 0
111 0
116 0
117 1
150 0
162 0
163 0
165 0
700 .01
701 .5
702 .26
703 0
704 0
705 .5
706 .6
707 0
708 0
709 0
710 0
711 .5
712 0
713 .7
714 0
715 0
775 0
textures 3
0 00000000-0000-0000-9999-000000000003
5 00000000-0000-0000-9999-000000000004
6 00000000-0000-0000-9999-000000000005

View File

@ -0,0 +1,9 @@
Linden text version 2
{
LLEmbeddedItems version 1
{
count 0
}
Text length 95
Hello and thank you for using opensim. For more infomation visit http://openmv.org/wiki/OpenSim}