WARNING: massive refactor to follow libomv's latest changes regarding inventory folders. The newest version of libomv itself is committed here. Basically, everything that was using the AssetType enum has been combed through; many of those uses were changed to the new FolderType enum.

This means that from now on, [new] root folders have code 8 (FolderType.Root), as the viewers expect, as opposed to 9, which was what we had been doing. Normal folders are as they were, -1. Also now sending folder code 100 for Suitcase folders to viewers, with no filter.
All tests pass, but fingers crossed!
0.8.2-post-fixes
Diva Canto 2015-08-08 12:12:50 -07:00
parent 2153a01cc7
commit 959872315f
41 changed files with 238 additions and 225 deletions

View File

@ -2539,8 +2539,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController
try try
{ {
Dictionary<UUID,UUID> inventoryMap = new Dictionary<UUID,UUID>(); Dictionary<UUID,UUID> inventoryMap = new Dictionary<UUID,UUID>();
CopyInventoryFolders(destination, source, AssetType.Clothing, inventoryMap, avatarAppearance); CopyInventoryFolders(destination, source, FolderType.Clothing, inventoryMap, avatarAppearance);
CopyInventoryFolders(destination, source, AssetType.Bodypart, inventoryMap, avatarAppearance); CopyInventoryFolders(destination, source, FolderType.BodyPart, inventoryMap, avatarAppearance);
AvatarWearable[] wearables = avatarAppearance.Wearables; AvatarWearable[] wearables = avatarAppearance.Wearables;
@ -2576,20 +2576,20 @@ namespace OpenSim.ApplicationPlugins.RemoteController
IInventoryService inventoryService = m_application.SceneManager.CurrentOrFirstScene.InventoryService; IInventoryService inventoryService = m_application.SceneManager.CurrentOrFirstScene.InventoryService;
// Get Clothing folder of receiver // Get Clothing folder of receiver
InventoryFolderBase destinationFolder = inventoryService.GetFolderForType(destination, AssetType.Clothing); InventoryFolderBase destinationFolder = inventoryService.GetFolderForType(destination, FolderType.Clothing);
if (destinationFolder == null) if (destinationFolder == null)
throw new Exception("Cannot locate folder(s)"); throw new Exception("Cannot locate folder(s)");
// Missing destination folder? This should *never* be the case // Missing destination folder? This should *never* be the case
if (destinationFolder.Type != (short)AssetType.Clothing) if (destinationFolder.Type != (short)FolderType.Clothing)
{ {
destinationFolder = new InventoryFolderBase(); destinationFolder = new InventoryFolderBase();
destinationFolder.ID = UUID.Random(); destinationFolder.ID = UUID.Random();
destinationFolder.Name = "Clothing"; destinationFolder.Name = "Clothing";
destinationFolder.Owner = destination; destinationFolder.Owner = destination;
destinationFolder.Type = (short)AssetType.Clothing; destinationFolder.Type = (short)FolderType.Clothing;
destinationFolder.ParentID = inventoryService.GetRootFolder(destination).ID; destinationFolder.ParentID = inventoryService.GetRootFolder(destination).ID;
destinationFolder.Version = 1; destinationFolder.Version = 1;
inventoryService.AddFolder(destinationFolder); // store base record inventoryService.AddFolder(destinationFolder); // store base record
@ -2707,7 +2707,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
/// This method is called by establishAppearance to copy inventory folders to make /// This method is called by establishAppearance to copy inventory folders to make
/// copies of Clothing and Bodyparts inventory folders and attaches worn attachments /// copies of Clothing and Bodyparts inventory folders and attaches worn attachments
/// </summary> /// </summary>
private void CopyInventoryFolders(UUID destination, UUID source, AssetType assetType, Dictionary<UUID,UUID> inventoryMap, private void CopyInventoryFolders(UUID destination, UUID source, FolderType assetType, Dictionary<UUID, UUID> inventoryMap,
AvatarAppearance avatarAppearance) AvatarAppearance avatarAppearance)
{ {
IInventoryService inventoryService = m_application.SceneManager.CurrentOrFirstScene.InventoryService; IInventoryService inventoryService = m_application.SceneManager.CurrentOrFirstScene.InventoryService;
@ -2723,9 +2723,12 @@ namespace OpenSim.ApplicationPlugins.RemoteController
{ {
sourceFolder = new InventoryFolderBase(); sourceFolder = new InventoryFolderBase();
sourceFolder.ID = UUID.Random(); sourceFolder.ID = UUID.Random();
if (assetType == AssetType.Clothing) { if (assetType == FolderType.Clothing)
{
sourceFolder.Name = "Clothing"; sourceFolder.Name = "Clothing";
} else { }
else
{
sourceFolder.Name = "Body Parts"; sourceFolder.Name = "Body Parts";
} }
sourceFolder.Owner = source; sourceFolder.Owner = source;
@ -2741,7 +2744,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
{ {
destinationFolder = new InventoryFolderBase(); destinationFolder = new InventoryFolderBase();
destinationFolder.ID = UUID.Random(); destinationFolder.ID = UUID.Random();
if (assetType == AssetType.Clothing) if (assetType == FolderType.Clothing)
{ {
destinationFolder.Name = "Clothing"; destinationFolder.Name = "Clothing";
} }
@ -2980,16 +2983,16 @@ namespace OpenSim.ApplicationPlugins.RemoteController
// m_log.DebugFormat("[RADMIN] {0} folders, {1} items in inventory", // m_log.DebugFormat("[RADMIN] {0} folders, {1} items in inventory",
// uic.folders.Count, uic.items.Count); // uic.folders.Count, uic.items.Count);
InventoryFolderBase clothingFolder = inventoryService.GetFolderForType(ID, AssetType.Clothing); InventoryFolderBase clothingFolder = inventoryService.GetFolderForType(ID, FolderType.Clothing);
// This should *never* be the case // This should *never* be the case
if (clothingFolder == null || clothingFolder.Type != (short)AssetType.Clothing) if (clothingFolder == null || clothingFolder.Type != (short)FolderType.Clothing)
{ {
clothingFolder = new InventoryFolderBase(); clothingFolder = new InventoryFolderBase();
clothingFolder.ID = UUID.Random(); clothingFolder.ID = UUID.Random();
clothingFolder.Name = "Clothing"; clothingFolder.Name = "Clothing";
clothingFolder.Owner = ID; clothingFolder.Owner = ID;
clothingFolder.Type = (short)AssetType.Clothing; clothingFolder.Type = (short)FolderType.Clothing;
clothingFolder.ParentID = inventoryService.GetRootFolder(ID).ID; clothingFolder.ParentID = inventoryService.GetRootFolder(ID).ID;
clothingFolder.Version = 1; clothingFolder.Version = 1;
inventoryService.AddFolder(clothingFolder); // store base record inventoryService.AddFolder(clothingFolder); // store base record
@ -3035,7 +3038,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
extraFolder.ID = UUID.Random(); extraFolder.ID = UUID.Random();
extraFolder.Name = outfitName; extraFolder.Name = outfitName;
extraFolder.Owner = ID; extraFolder.Owner = ID;
extraFolder.Type = (short)AssetType.Clothing; extraFolder.Type = (short)FolderType.Clothing;
extraFolder.Version = 1; extraFolder.Version = 1;
extraFolder.ParentID = clothingFolder.ID; extraFolder.ParentID = clothingFolder.ID;
inventoryService.AddFolder(extraFolder); inventoryService.AddFolder(extraFolder);

View File

@ -75,7 +75,7 @@ namespace OpenSim.Capabilities.Handlers.FetchInventory.Tests
m_rootFolderID = m_scene.InventoryService.GetRootFolder(m_userID).ID; m_rootFolderID = m_scene.InventoryService.GetRootFolder(m_userID).ID;
InventoryFolderBase of = m_scene.InventoryService.GetFolderForType(m_userID, AssetType.Object); InventoryFolderBase of = m_scene.InventoryService.GetFolderForType(m_userID, FolderType.Object);
m_objectsFolder = of.ID; m_objectsFolder = of.ID;
// Add 3 objects // Add 3 objects
@ -90,7 +90,7 @@ namespace OpenSim.Capabilities.Handlers.FetchInventory.Tests
m_scene.InventoryService.AddItem(item); m_scene.InventoryService.AddItem(item);
} }
InventoryFolderBase ncf = m_scene.InventoryService.GetFolderForType(m_userID, AssetType.Notecard); InventoryFolderBase ncf = m_scene.InventoryService.GetFolderForType(m_userID, FolderType.Notecard);
m_notecardsFolder = ncf.ID; m_notecardsFolder = ncf.ID;
// Add 5 notecards // Add 5 notecards

View File

@ -74,7 +74,7 @@ namespace OpenSim.Capabilities.Handlers.FetchInventory.Tests
m_rootFolderID = m_scene.InventoryService.GetRootFolder(m_userID).ID; m_rootFolderID = m_scene.InventoryService.GetRootFolder(m_userID).ID;
InventoryFolderBase of = m_scene.InventoryService.GetFolderForType(m_userID, AssetType.Object); InventoryFolderBase of = m_scene.InventoryService.GetFolderForType(m_userID, FolderType.Object);
m_objectsFolder = of.ID; m_objectsFolder = of.ID;
// Add an object // Add an object
@ -85,7 +85,7 @@ namespace OpenSim.Capabilities.Handlers.FetchInventory.Tests
item.Name = "Some Object"; item.Name = "Some Object";
m_scene.InventoryService.AddItem(item); m_scene.InventoryService.AddItem(item);
InventoryFolderBase ncf = m_scene.InventoryService.GetFolderForType(m_userID, AssetType.Notecard); InventoryFolderBase ncf = m_scene.InventoryService.GetFolderForType(m_userID, FolderType.Notecard);
m_notecardsFolder = ncf.ID; m_notecardsFolder = ncf.ID;
// Add a notecard // Add a notecard
@ -114,7 +114,7 @@ namespace OpenSim.Capabilities.Handlers.FetchInventory.Tests
m_scene.InventoryService.AddItem(item); m_scene.InventoryService.AddItem(item);
// Add a link to the Objects folder in Test Folder // Add a link to the Objects folder in Test Folder
item.AssetID = m_scene.InventoryService.GetFolderForType(m_userID, AssetType.Object).ID; // use item ID of Objects folder item.AssetID = m_scene.InventoryService.GetFolderForType(m_userID, FolderType.Object).ID; // use item ID of Objects folder
item.ID = new UUID("50000000-0000-0000-0000-000000000005"); item.ID = new UUID("50000000-0000-0000-0000-000000000005");
item.AssetType = (int)AssetType.LinkFolder; item.AssetType = (int)AssetType.LinkFolder;
item.Folder = folder.ID; item.Folder = folder.ID;

View File

@ -136,7 +136,7 @@ namespace OpenSim.Framework
get get
{ {
return return
(Type == (sbyte) AssetType.Animation || (Type == (sbyte)AssetType.Animation ||
Type == (sbyte)AssetType.Gesture || Type == (sbyte)AssetType.Gesture ||
Type == (sbyte)AssetType.Simstate || Type == (sbyte)AssetType.Simstate ||
Type == (sbyte)AssetType.Unknown || Type == (sbyte)AssetType.Unknown ||
@ -146,13 +146,9 @@ namespace OpenSim.Framework
Type == (sbyte)AssetType.Texture || Type == (sbyte)AssetType.Texture ||
Type == (sbyte)AssetType.TextureTGA || Type == (sbyte)AssetType.TextureTGA ||
Type == (sbyte)AssetType.Folder || Type == (sbyte)AssetType.Folder ||
Type == (sbyte)AssetType.RootFolder ||
Type == (sbyte)AssetType.LostAndFoundFolder ||
Type == (sbyte)AssetType.SnapshotFolder ||
Type == (sbyte)AssetType.TrashFolder ||
Type == (sbyte)AssetType.ImageJPEG || Type == (sbyte)AssetType.ImageJPEG ||
Type == (sbyte) AssetType.ImageTGA || Type == (sbyte)AssetType.ImageTGA ||
Type == (sbyte) AssetType.LSLBytecode); Type == (sbyte)AssetType.LSLBytecode);
} }
} }

View File

@ -34,6 +34,9 @@ namespace OpenSim.Framework
/// </summary> /// </summary>
public class InventoryFolderBase : InventoryNodeBase public class InventoryFolderBase : InventoryNodeBase
{ {
public static readonly string ROOT_FOLDER_NAME = "My Inventory";
public static readonly string SUITCASE_FOLDER_NAME = "My Suitcase";
/// <summary> /// <summary>
/// The folder this folder is contained in /// The folder this folder is contained in
/// </summary> /// </summary>

View File

@ -34,11 +34,7 @@ namespace OpenSim.Framework
/// Inventory Item - contains all the properties associated with an individual inventory piece. /// Inventory Item - contains all the properties associated with an individual inventory piece.
/// </summary> /// </summary>
public class InventoryItemBase : InventoryNodeBase, ICloneable public class InventoryItemBase : InventoryNodeBase, ICloneable
{ {
public static readonly string SUITCASE_FOLDER_NAME = "My Suitcase";
public static readonly sbyte SUITCASE_FOLDER_TYPE = 100;
public static readonly sbyte SUITCASE_FOLDER_FAKE_TYPE = 8;
/// <value> /// <value>
/// The inventory type of the item. This is slightly different from the asset type in some situations. /// The inventory type of the item. This is slightly different from the asset type in some situations.
/// </value> /// </value>

View File

@ -64,7 +64,7 @@ namespace OpenSim.Framework
private class TypeMapping private class TypeMapping
{ {
private sbyte assetType; private sbyte assetType;
private InventoryType inventoryType; private sbyte inventoryType;
private string contentType; private string contentType;
private string contentType2; private string contentType2;
private string extension; private string extension;
@ -79,7 +79,7 @@ namespace OpenSim.Framework
get { return AssetTypeFromCode(assetType); } get { return AssetTypeFromCode(assetType); }
} }
public InventoryType InventoryType public sbyte InventoryType
{ {
get { return inventoryType; } get { return inventoryType; }
} }
@ -99,7 +99,7 @@ namespace OpenSim.Framework
get { return extension; } get { return extension; }
} }
private TypeMapping(sbyte assetType, InventoryType inventoryType, string contentType, string contentType2, string extension) private TypeMapping(sbyte assetType, sbyte inventoryType, string contentType, string contentType2, string extension)
{ {
this.assetType = assetType; this.assetType = assetType;
this.inventoryType = inventoryType; this.inventoryType = inventoryType;
@ -108,18 +108,28 @@ namespace OpenSim.Framework
this.extension = extension; this.extension = extension;
} }
public TypeMapping(AssetType assetType, InventoryType inventoryType, string contentType, string contentType2, string extension) public TypeMapping(AssetType assetType, sbyte inventoryType, string contentType, string contentType2, string extension)
: this((sbyte)assetType, inventoryType, contentType, contentType2, extension) : this((sbyte)assetType, inventoryType, contentType, contentType2, extension)
{ {
} }
public TypeMapping(AssetType assetType, InventoryType inventoryType, string contentType, string contentType2, string extension)
: this((sbyte)assetType, (sbyte)inventoryType, contentType, contentType2, extension)
{
}
public TypeMapping(AssetType assetType, InventoryType inventoryType, string contentType, string extension) public TypeMapping(AssetType assetType, InventoryType inventoryType, string contentType, string extension)
: this((sbyte)assetType, inventoryType, contentType, null, extension) : this((sbyte)assetType, (sbyte)inventoryType, contentType, null, extension)
{
}
public TypeMapping(AssetType assetType, FolderType inventoryType, string contentType, string extension)
: this((sbyte)assetType, (sbyte)inventoryType, contentType, null, extension)
{ {
} }
public TypeMapping(OpenSimAssetType assetType, InventoryType inventoryType, string contentType, string extension) public TypeMapping(OpenSimAssetType assetType, InventoryType inventoryType, string contentType, string extension)
: this((sbyte)assetType, inventoryType, contentType, null, extension) : this((sbyte)assetType, (sbyte)inventoryType, contentType, null, extension)
{ {
} }
} }
@ -145,53 +155,65 @@ namespace OpenSim.Framework
new TypeMapping(AssetType.Object, InventoryType.Object, "application/vnd.ll.primitive", "application/x-metaverse-primitive", "primitive"), new TypeMapping(AssetType.Object, InventoryType.Object, "application/vnd.ll.primitive", "application/x-metaverse-primitive", "primitive"),
new TypeMapping(AssetType.Object, InventoryType.Attachment, "application/vnd.ll.primitive", "application/x-metaverse-primitive", "primitive"), new TypeMapping(AssetType.Object, InventoryType.Attachment, "application/vnd.ll.primitive", "application/x-metaverse-primitive", "primitive"),
new TypeMapping(AssetType.Notecard, InventoryType.Notecard, "application/vnd.ll.notecard", "application/x-metaverse-notecard", "notecard"), new TypeMapping(AssetType.Notecard, InventoryType.Notecard, "application/vnd.ll.notecard", "application/x-metaverse-notecard", "notecard"),
new TypeMapping(AssetType.Folder, InventoryType.Folder, "application/vnd.ll.folder", "folder"),
new TypeMapping(AssetType.RootFolder, InventoryType.RootCategory, "application/vnd.ll.rootfolder", "rootfolder"),
new TypeMapping(AssetType.LSLText, InventoryType.LSL, "application/vnd.ll.lsltext", "application/x-metaverse-lsl", "lsl"), new TypeMapping(AssetType.LSLText, InventoryType.LSL, "application/vnd.ll.lsltext", "application/x-metaverse-lsl", "lsl"),
new TypeMapping(AssetType.LSLBytecode, InventoryType.LSL, "application/vnd.ll.lslbyte", "application/x-metaverse-lso", "lso"), new TypeMapping(AssetType.LSLBytecode, InventoryType.LSL, "application/vnd.ll.lslbyte", "application/x-metaverse-lso", "lso"),
new TypeMapping(AssetType.Bodypart, InventoryType.Wearable, "application/vnd.ll.bodypart", "application/x-metaverse-bodypart", "bodypart"), new TypeMapping(AssetType.Bodypart, InventoryType.Wearable, "application/vnd.ll.bodypart", "application/x-metaverse-bodypart", "bodypart"),
new TypeMapping(AssetType.TrashFolder, InventoryType.Folder, "application/vnd.ll.trashfolder", "trashfolder"),
new TypeMapping(AssetType.SnapshotFolder, InventoryType.Folder, "application/vnd.ll.snapshotfolder", "snapshotfolder"),
new TypeMapping(AssetType.LostAndFoundFolder, InventoryType.Folder, "application/vnd.ll.lostandfoundfolder", "lostandfoundfolder"),
new TypeMapping(AssetType.Animation, InventoryType.Animation, "application/vnd.ll.animation", "application/x-metaverse-animation", "animation"), new TypeMapping(AssetType.Animation, InventoryType.Animation, "application/vnd.ll.animation", "application/x-metaverse-animation", "animation"),
new TypeMapping(AssetType.Gesture, InventoryType.Gesture, "application/vnd.ll.gesture", "application/x-metaverse-gesture", "gesture"), new TypeMapping(AssetType.Gesture, InventoryType.Gesture, "application/vnd.ll.gesture", "application/x-metaverse-gesture", "gesture"),
new TypeMapping(AssetType.Simstate, InventoryType.Snapshot, "application/x-metaverse-simstate", "simstate"), new TypeMapping(AssetType.Simstate, InventoryType.Snapshot, "application/x-metaverse-simstate", "simstate"),
new TypeMapping(AssetType.FavoriteFolder, InventoryType.Unknown, "application/vnd.ll.favoritefolder", "favoritefolder"),
new TypeMapping(AssetType.Link, InventoryType.Unknown, "application/vnd.ll.link", "link"), new TypeMapping(AssetType.Link, InventoryType.Unknown, "application/vnd.ll.link", "link"),
new TypeMapping(AssetType.LinkFolder, InventoryType.Unknown, "application/vnd.ll.linkfolder", "linkfolder"), new TypeMapping(AssetType.LinkFolder, InventoryType.Unknown, "application/vnd.ll.linkfolder", "linkfolder"),
new TypeMapping(AssetType.CurrentOutfitFolder, InventoryType.Unknown, "application/vnd.ll.currentoutfitfolder", "currentoutfitfolder"),
new TypeMapping(AssetType.OutfitFolder, InventoryType.Unknown, "application/vnd.ll.outfitfolder", "outfitfolder"),
new TypeMapping(AssetType.MyOutfitsFolder, InventoryType.Unknown, "application/vnd.ll.myoutfitsfolder", "myoutfitsfolder"),
new TypeMapping(AssetType.Mesh, InventoryType.Mesh, "application/vnd.ll.mesh", "llm"), new TypeMapping(AssetType.Mesh, InventoryType.Mesh, "application/vnd.ll.mesh", "llm"),
// The next few items are about inventory folders
new TypeMapping(AssetType.Folder, FolderType.None, "application/vnd.ll.folder", "folder"),
new TypeMapping(AssetType.Folder, FolderType.Root, "application/vnd.ll.rootfolder", "rootfolder"),
new TypeMapping(AssetType.Folder, FolderType.Trash, "application/vnd.ll.trashfolder", "trashfolder"),
new TypeMapping(AssetType.Folder, FolderType.Snapshot, "application/vnd.ll.snapshotfolder", "snapshotfolder"),
new TypeMapping(AssetType.Folder, FolderType.LostAndFound, "application/vnd.ll.lostandfoundfolder", "lostandfoundfolder"),
new TypeMapping(AssetType.Folder, FolderType.Favorites, "application/vnd.ll.favoritefolder", "favoritefolder"),
new TypeMapping(AssetType.Folder, FolderType.CurrentOutfit, "application/vnd.ll.currentoutfitfolder", "currentoutfitfolder"),
new TypeMapping(AssetType.Folder, FolderType.Outfit, "application/vnd.ll.outfitfolder", "outfitfolder"),
new TypeMapping(AssetType.Folder, FolderType.MyOutfits, "application/vnd.ll.myoutfitsfolder", "myoutfitsfolder"),
// This next mappping is an asset to inventory item mapping.
// Note: LL stores folders as assets of type Folder = 8, and it has a corresponding InventoryType = 8
// OpenSim doesn't store folders as assets, so this mapping should only be used when parsing things from the viewer to the server
new TypeMapping(AssetType.Folder, InventoryType.Folder, "application/vnd.ll.folder", "folder"),
// OpenSim specific
new TypeMapping(OpenSimAssetType.Material, InventoryType.Unknown, "application/llsd+xml", "material") new TypeMapping(OpenSimAssetType.Material, InventoryType.Unknown, "application/llsd+xml", "material")
}; };
private static Dictionary<sbyte, string> asset2Content; private static Dictionary<sbyte, string> asset2Content;
private static Dictionary<sbyte, string> asset2Extension; private static Dictionary<sbyte, string> asset2Extension;
private static Dictionary<InventoryType, string> inventory2Content; private static Dictionary<sbyte, string> inventory2Content;
private static Dictionary<string, sbyte> content2Asset; private static Dictionary<string, sbyte> content2Asset;
private static Dictionary<string, InventoryType> content2Inventory; private static Dictionary<string, sbyte> content2Inventory;
static SLUtil() static SLUtil()
{ {
asset2Content = new Dictionary<sbyte, string>(); asset2Content = new Dictionary<sbyte, string>();
asset2Extension = new Dictionary<sbyte, string>(); asset2Extension = new Dictionary<sbyte, string>();
inventory2Content = new Dictionary<InventoryType, string>(); inventory2Content = new Dictionary<sbyte, string>();
content2Asset = new Dictionary<string, sbyte>(); content2Asset = new Dictionary<string, sbyte>();
content2Inventory = new Dictionary<string, InventoryType>(); content2Inventory = new Dictionary<string, sbyte>();
foreach (TypeMapping mapping in MAPPINGS) foreach (TypeMapping mapping in MAPPINGS)
{ {
sbyte assetType = mapping.AssetTypeCode; sbyte assetType = mapping.AssetTypeCode;
if (!asset2Content.ContainsKey(assetType)) if (!asset2Content.ContainsKey(assetType))
asset2Content.Add(assetType, mapping.ContentType); asset2Content.Add(assetType, mapping.ContentType);
if (!asset2Extension.ContainsKey(assetType)) if (!asset2Extension.ContainsKey(assetType))
asset2Extension.Add(assetType, mapping.Extension); asset2Extension.Add(assetType, mapping.Extension);
if (!inventory2Content.ContainsKey(mapping.InventoryType)) if (!inventory2Content.ContainsKey(mapping.InventoryType))
inventory2Content.Add(mapping.InventoryType, mapping.ContentType); inventory2Content.Add(mapping.InventoryType, mapping.ContentType);
if (!content2Asset.ContainsKey(mapping.ContentType)) if (!content2Asset.ContainsKey(mapping.ContentType))
content2Asset.Add(mapping.ContentType, assetType); content2Asset.Add(mapping.ContentType, assetType);
if (!content2Inventory.ContainsKey(mapping.ContentType)) if (!content2Inventory.ContainsKey(mapping.ContentType))
content2Inventory.Add(mapping.ContentType, mapping.InventoryType); content2Inventory.Add(mapping.ContentType, mapping.InventoryType);
@ -216,8 +238,8 @@ namespace OpenSim.Framework
public static string SLInvTypeToContentType(int invType) public static string SLInvTypeToContentType(int invType)
{ {
string contentType; string contentType;
if (!inventory2Content.TryGetValue((InventoryType)invType, out contentType)) if (!inventory2Content.TryGetValue((sbyte)invType, out contentType))
contentType = inventory2Content[InventoryType.Unknown]; contentType = inventory2Content[(sbyte)InventoryType.Unknown];
return contentType; return contentType;
} }
@ -231,9 +253,9 @@ namespace OpenSim.Framework
public static sbyte ContentTypeToSLInvType(string contentType) public static sbyte ContentTypeToSLInvType(string contentType)
{ {
InventoryType invType; sbyte invType;
if (!content2Inventory.TryGetValue(contentType, out invType)) if (!content2Inventory.TryGetValue(contentType, out invType))
invType = InventoryType.Unknown; invType = (sbyte)InventoryType.Unknown;
return (sbyte)invType; return (sbyte)invType;
} }

View File

@ -115,20 +115,16 @@ namespace OpenSim.Framework.Serialization
ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.ImageJPEG] = ASSET_EXTENSION_SEPARATOR + "image.jpg"; ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.ImageJPEG] = ASSET_EXTENSION_SEPARATOR + "image.jpg";
ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.ImageTGA] = ASSET_EXTENSION_SEPARATOR + "image.tga"; ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.ImageTGA] = ASSET_EXTENSION_SEPARATOR + "image.tga";
ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Landmark] = ASSET_EXTENSION_SEPARATOR + "landmark.txt"; ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Landmark] = ASSET_EXTENSION_SEPARATOR + "landmark.txt";
ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.LostAndFoundFolder] = ASSET_EXTENSION_SEPARATOR + "lostandfoundfolder.txt"; // Not sure if we'll ever see this
ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.LSLBytecode] = ASSET_EXTENSION_SEPARATOR + "bytecode.lso"; ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.LSLBytecode] = ASSET_EXTENSION_SEPARATOR + "bytecode.lso";
ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.LSLText] = ASSET_EXTENSION_SEPARATOR + "script.lsl"; ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.LSLText] = ASSET_EXTENSION_SEPARATOR + "script.lsl";
ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Mesh] = ASSET_EXTENSION_SEPARATOR + "mesh.llmesh"; ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Mesh] = ASSET_EXTENSION_SEPARATOR + "mesh.llmesh";
ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Notecard] = ASSET_EXTENSION_SEPARATOR + "notecard.txt"; ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Notecard] = ASSET_EXTENSION_SEPARATOR + "notecard.txt";
ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Object] = ASSET_EXTENSION_SEPARATOR + "object.xml"; ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Object] = ASSET_EXTENSION_SEPARATOR + "object.xml";
ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.RootFolder] = ASSET_EXTENSION_SEPARATOR + "rootfolder.txt"; // Not sure if we'll ever see this
ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Simstate] = ASSET_EXTENSION_SEPARATOR + "simstate.bin"; // Not sure if we'll ever see this ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Simstate] = ASSET_EXTENSION_SEPARATOR + "simstate.bin"; // Not sure if we'll ever see this
ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.SnapshotFolder] = ASSET_EXTENSION_SEPARATOR + "snapshotfolder.txt"; // Not sure if we'll ever see this
ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Sound] = ASSET_EXTENSION_SEPARATOR + "sound.ogg"; ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Sound] = ASSET_EXTENSION_SEPARATOR + "sound.ogg";
ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.SoundWAV] = ASSET_EXTENSION_SEPARATOR + "sound.wav"; ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.SoundWAV] = ASSET_EXTENSION_SEPARATOR + "sound.wav";
ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Texture] = ASSET_EXTENSION_SEPARATOR + "texture.jp2"; ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Texture] = ASSET_EXTENSION_SEPARATOR + "texture.jp2";
ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.TextureTGA] = ASSET_EXTENSION_SEPARATOR + "texture.tga"; ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.TextureTGA] = ASSET_EXTENSION_SEPARATOR + "texture.tga";
ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.TrashFolder] = ASSET_EXTENSION_SEPARATOR + "trashfolder.txt"; // Not sure if we'll ever see this
ASSET_TYPE_TO_EXTENSION[(sbyte)OpenSimAssetType.Material] = ASSET_EXTENSION_SEPARATOR + "material.xml"; // Not sure if we'll ever see this ASSET_TYPE_TO_EXTENSION[(sbyte)OpenSimAssetType.Material] = ASSET_EXTENSION_SEPARATOR + "material.xml"; // Not sure if we'll ever see this
EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "animation.bvh"] = (sbyte)AssetType.Animation; EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "animation.bvh"] = (sbyte)AssetType.Animation;
@ -140,21 +136,17 @@ namespace OpenSim.Framework.Serialization
EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "image.jpg"] = (sbyte)AssetType.ImageJPEG; EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "image.jpg"] = (sbyte)AssetType.ImageJPEG;
EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "image.tga"] = (sbyte)AssetType.ImageTGA; EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "image.tga"] = (sbyte)AssetType.ImageTGA;
EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "landmark.txt"] = (sbyte)AssetType.Landmark; EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "landmark.txt"] = (sbyte)AssetType.Landmark;
EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "lostandfoundfolder.txt"] = (sbyte)AssetType.LostAndFoundFolder;
EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "bytecode.lso"] = (sbyte)AssetType.LSLBytecode; EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "bytecode.lso"] = (sbyte)AssetType.LSLBytecode;
EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "script.lsl"] = (sbyte)AssetType.LSLText; EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "script.lsl"] = (sbyte)AssetType.LSLText;
EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "mesh.llmesh"] = (sbyte)AssetType.Mesh; EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "mesh.llmesh"] = (sbyte)AssetType.Mesh;
EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "notecard.txt"] = (sbyte)AssetType.Notecard; EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "notecard.txt"] = (sbyte)AssetType.Notecard;
EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "object.xml"] = (sbyte)AssetType.Object; EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "object.xml"] = (sbyte)AssetType.Object;
EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "rootfolder.txt"] = (sbyte)AssetType.RootFolder;
EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "simstate.bin"] = (sbyte)AssetType.Simstate; EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "simstate.bin"] = (sbyte)AssetType.Simstate;
EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "snapshotfolder.txt"] = (sbyte)AssetType.SnapshotFolder;
EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "sound.ogg"] = (sbyte)AssetType.Sound; EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "sound.ogg"] = (sbyte)AssetType.Sound;
EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "sound.wav"] = (sbyte)AssetType.SoundWAV; EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "sound.wav"] = (sbyte)AssetType.SoundWAV;
EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "texture.jp2"] = (sbyte)AssetType.Texture; EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "texture.jp2"] = (sbyte)AssetType.Texture;
EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "texture.tga"] = (sbyte)AssetType.TextureTGA; EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "texture.tga"] = (sbyte)AssetType.TextureTGA;
EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "trashfolder.txt"] = (sbyte)AssetType.TrashFolder; EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "material.xml"] = (sbyte)OpenSimAssetType.Material;
EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "material.xml"] = (sbyte)OpenSimAssetType.Material;
} }
public static string CreateOarLandDataPath(LandData ld) public static string CreateOarLandDataPath(LandData ld)

View File

@ -50,19 +50,15 @@ namespace OpenSim.Framework.Tests
CheckContainsReferences(AssetType.ImageJPEG , false); CheckContainsReferences(AssetType.ImageJPEG , false);
CheckContainsReferences(AssetType.ImageTGA , false); CheckContainsReferences(AssetType.ImageTGA , false);
CheckContainsReferences(AssetType.Landmark , false); CheckContainsReferences(AssetType.Landmark , false);
CheckContainsReferences(AssetType.LostAndFoundFolder, false);
CheckContainsReferences(AssetType.LSLBytecode, false); CheckContainsReferences(AssetType.LSLBytecode, false);
CheckContainsReferences(AssetType.LSLText, false); CheckContainsReferences(AssetType.LSLText, false);
CheckContainsReferences(AssetType.Notecard, false); CheckContainsReferences(AssetType.Notecard, false);
CheckContainsReferences(AssetType.Object, false); CheckContainsReferences(AssetType.Object, false);
CheckContainsReferences(AssetType.RootFolder, false);
CheckContainsReferences(AssetType.Simstate, false); CheckContainsReferences(AssetType.Simstate, false);
CheckContainsReferences(AssetType.SnapshotFolder, false);
CheckContainsReferences(AssetType.Sound, false); CheckContainsReferences(AssetType.Sound, false);
CheckContainsReferences(AssetType.SoundWAV, false); CheckContainsReferences(AssetType.SoundWAV, false);
CheckContainsReferences(AssetType.Texture, false); CheckContainsReferences(AssetType.Texture, false);
CheckContainsReferences(AssetType.TextureTGA, false); CheckContainsReferences(AssetType.TextureTGA, false);
CheckContainsReferences(AssetType.TrashFolder, false);
CheckContainsReferences(AssetType.Unknown, false); CheckContainsReferences(AssetType.Unknown, false);
} }

View File

@ -554,8 +554,8 @@ namespace OpenSim.Region.ClientStack.Linden
if (core.TryGet<IClientInventory>(out clientInv)) if (core.TryGet<IClientInventory>(out clientInv))
{ {
var systemTextureFolder = m_Scene.InventoryService.GetFolderForType(m_HostCapsObj.AgentID, AssetType.Texture); var systemTextureFolder = m_Scene.InventoryService.GetFolderForType(m_HostCapsObj.AgentID, FolderType.Texture);
textureUploadFolder = new InventoryFolderBase(UUID.Random(), assetName, m_HostCapsObj.AgentID, (short)AssetType.Unknown, systemTextureFolder.ID, 1); textureUploadFolder = new InventoryFolderBase(UUID.Random(), assetName, m_HostCapsObj.AgentID, (short)FolderType.None, systemTextureFolder.ID, 1);
if (m_Scene.InventoryService.AddFolder(textureUploadFolder)) if (m_Scene.InventoryService.AddFolder(textureUploadFolder))
{ {
foldersToUpdate.Add(textureUploadFolder); foldersToUpdate.Add(textureUploadFolder);

View File

@ -116,7 +116,7 @@ namespace OpenSim.Region.ClientStack.Linden.Caps.Tests
PollServiceEventArgs pseArgs; PollServiceEventArgs pseArgs;
userCaps.TryGetPollHandler("FetchInventoryDescendents2", out pseArgs); userCaps.TryGetPollHandler("FetchInventoryDescendents2", out pseArgs);
req.UriPath = pseArgs.Url; req.UriPath = pseArgs.Url;
req.Uri = new Uri(req.UriPath); req.Uri = new Uri("file://" + req.UriPath);
// Retrieve root folder details directly so that we can request // Retrieve root folder details directly so that we can request
InventoryFolderBase folder = scene.InventoryService.GetRootFolder(ua.PrincipalID); InventoryFolderBase folder = scene.InventoryService.GetRootFolder(ua.PrincipalID);
@ -137,6 +137,8 @@ namespace OpenSim.Region.ClientStack.Linden.Caps.Tests
req.Body = new MemoryStream(OSDParser.SerializeLLSDXmlBytes(osdReqMap)); req.Body = new MemoryStream(OSDParser.SerializeLLSDXmlBytes(osdReqMap));
TestHttpClientContext context = new TestHttpClientContext(false); TestHttpClientContext context = new TestHttpClientContext(false);
// WARNING: This results in a caught exception, because queryString is null
MainServer.Instance.OnRequest(context, new RequestEventArgs(req)); MainServer.Instance.OnRequest(context, new RequestEventArgs(req));
// Drive processing of the queued inventory request synchronously. // Drive processing of the queued inventory request synchronously.

View File

@ -1866,8 +1866,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
newBlock.Name = Util.StringToBytes256(folder.Name); newBlock.Name = Util.StringToBytes256(folder.Name);
newBlock.ParentID = folder.ParentID; newBlock.ParentID = folder.ParentID;
newBlock.Type = (sbyte)folder.Type; newBlock.Type = (sbyte)folder.Type;
if (newBlock.Type == InventoryItemBase.SUITCASE_FOLDER_TYPE) //if (newBlock.Type == InventoryItemBase.SUITCASE_FOLDER_TYPE)
newBlock.Type = InventoryItemBase.SUITCASE_FOLDER_FAKE_TYPE; // newBlock.Type = InventoryItemBase.SUITCASE_FOLDER_FAKE_TYPE;
return newBlock; return newBlock;
} }
@ -2118,8 +2118,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
folderBlock.FolderID = folder.ID; folderBlock.FolderID = folder.ID;
folderBlock.ParentID = folder.ParentID; folderBlock.ParentID = folder.ParentID;
folderBlock.Type = (sbyte)folder.Type; folderBlock.Type = (sbyte)folder.Type;
if (folderBlock.Type == InventoryItemBase.SUITCASE_FOLDER_TYPE) // Leaving this here for now, just in case we need to do this for a while
folderBlock.Type = InventoryItemBase.SUITCASE_FOLDER_FAKE_TYPE; //if (folderBlock.Type == InventoryItemBase.SUITCASE_FOLDER_TYPE)
// folderBlock.Type = InventoryItemBase.SUITCASE_FOLDER_FAKE_TYPE;
folderBlock.Name = Util.StringToBytes256(folder.Name); folderBlock.Name = Util.StringToBytes256(folder.Name);
return folderBlock; return folderBlock;

View File

@ -908,7 +908,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
InventoryItemBase newItem InventoryItemBase newItem
= m_invAccessModule.CopyToInventory( = m_invAccessModule.CopyToInventory(
DeRezAction.TakeCopy, DeRezAction.TakeCopy,
m_scene.InventoryService.GetFolderForType(sp.UUID, AssetType.Object).ID, m_scene.InventoryService.GetFolderForType(sp.UUID, FolderType.Object).ID,
new List<SceneObjectGroup> { grp }, new List<SceneObjectGroup> { grp },
sp.ControllingClient, true)[0]; sp.ControllingClient, true)[0];

View File

@ -224,7 +224,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
Assert.That(attachmentItem, Is.Not.Null); Assert.That(attachmentItem, Is.Not.Null);
Assert.That(attachmentItem.Name, Is.EqualTo(attName)); Assert.That(attachmentItem.Name, Is.EqualTo(attName));
InventoryFolderBase targetFolder = scene.InventoryService.GetFolderForType(sp.UUID, AssetType.Object); InventoryFolderBase targetFolder = scene.InventoryService.GetFolderForType(sp.UUID, FolderType.Object);
Assert.That(attachmentItem.Folder, Is.EqualTo(targetFolder.ID)); Assert.That(attachmentItem.Folder, Is.EqualTo(targetFolder.ID));
Assert.That(scene.GetSceneObjectGroups().Count, Is.EqualTo(1)); Assert.That(scene.GetSceneObjectGroups().Count, Is.EqualTo(1));
@ -271,7 +271,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
Assert.That(attachmentItem, Is.Not.Null); Assert.That(attachmentItem, Is.Not.Null);
Assert.That(attachmentItem.Name, Is.EqualTo(so.Name)); Assert.That(attachmentItem.Name, Is.EqualTo(so.Name));
InventoryFolderBase targetFolder = scene.InventoryService.GetFolderForType(sp.UUID, AssetType.Object); InventoryFolderBase targetFolder = scene.InventoryService.GetFolderForType(sp.UUID, FolderType.Object);
Assert.That(attachmentItem.Folder, Is.EqualTo(targetFolder.ID)); Assert.That(attachmentItem.Folder, Is.EqualTo(targetFolder.ID));
Assert.That(scene.GetSceneObjectGroups().Count, Is.EqualTo(2)); Assert.That(scene.GetSceneObjectGroups().Count, Is.EqualTo(2));
@ -304,7 +304,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
Assert.That(attachmentItem, Is.Not.Null); Assert.That(attachmentItem, Is.Not.Null);
Assert.That(attachmentItem.Name, Is.EqualTo(so2.Name)); Assert.That(attachmentItem.Name, Is.EqualTo(so2.Name));
InventoryFolderBase targetFolder = scene.InventoryService.GetFolderForType(sp.UUID, AssetType.Object); InventoryFolderBase targetFolder = scene.InventoryService.GetFolderForType(sp.UUID, FolderType.Object);
Assert.That(attachmentItem.Folder, Is.EqualTo(targetFolder.ID)); Assert.That(attachmentItem.Folder, Is.EqualTo(targetFolder.ID));
Assert.That(scene.GetSceneObjectGroups().Count, Is.EqualTo(1)); Assert.That(scene.GetSceneObjectGroups().Count, Is.EqualTo(1));
@ -337,7 +337,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
Assert.That(attachmentItem, Is.Not.Null); Assert.That(attachmentItem, Is.Not.Null);
Assert.That(attachmentItem.Name, Is.EqualTo(so2.Name)); Assert.That(attachmentItem.Name, Is.EqualTo(so2.Name));
InventoryFolderBase targetFolder = scene.InventoryService.GetFolderForType(sp.UUID, AssetType.Object); InventoryFolderBase targetFolder = scene.InventoryService.GetFolderForType(sp.UUID, FolderType.Object);
Assert.That(attachmentItem.Folder, Is.EqualTo(targetFolder.ID)); Assert.That(attachmentItem.Folder, Is.EqualTo(targetFolder.ID));
Assert.That(scene.GetSceneObjectGroups().Count, Is.EqualTo(1)); Assert.That(scene.GetSceneObjectGroups().Count, Is.EqualTo(1));

View File

@ -908,8 +908,8 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
AssetType AssetType
= =
(int) (int)
AssetType FolderType
.Bodypart, .BodyPart,
CreatorId CreatorId
= =
userID userID
@ -924,8 +924,8 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
invService invService
.GetFolderForType .GetFolderForType
(userID, (userID,
AssetType FolderType
.Bodypart) .BodyPart)
.ID, .ID,
Flags = (uint) type, Flags = (uint) type,
Name = Enum.GetName(typeof (WearableType), type), Name = Enum.GetName(typeof (WearableType), type),
@ -960,8 +960,8 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
invService invService
.GetFolderForType .GetFolderForType
(userID, (userID,
AssetType FolderType
.CurrentOutfitFolder) .CurrentOutfit)
.ID, .ID,
Flags = (uint) type, Flags = (uint) type,
Name = Enum.GetName(typeof (WearableType), type), Name = Enum.GetName(typeof (WearableType), type),
@ -978,8 +978,8 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
{ {
m_scene.SendInventoryUpdate(presence.ControllingClient, m_scene.SendInventoryUpdate(presence.ControllingClient,
invService.GetFolderForType(userID, invService.GetFolderForType(userID,
AssetType FolderType
.CurrentOutfitFolder), .CurrentOutfit),
false, true); false, true);
} }
} }

View File

@ -181,7 +181,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
if (folderID == UUID.Zero) if (folderID == UUID.Zero)
{ {
InventoryFolderBase folder = inv.GetFolderForType(userID, InventoryFolderBase folder = inv.GetFolderForType(userID,
AssetType.CallingCard); FolderType.CallingCard);
if (folder == null) // Nowhere to put it if (folder == null) // Nowhere to put it
return UUID.Zero; return UUID.Zero;
@ -237,7 +237,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
IInventoryService invService = m_Scenes[0].InventoryService; IInventoryService invService = m_Scenes[0].InventoryService;
InventoryFolderBase trashFolder = InventoryFolderBase trashFolder =
invService.GetFolderForType(client.AgentId, AssetType.TrashFolder); invService.GetFolderForType(client.AgentId, FolderType.Trash);
InventoryItemBase item = new InventoryItemBase(transactionID, client.AgentId); InventoryItemBase item = new InventoryItemBase(transactionID, client.AgentId);
item = invService.GetItem(item); item = invService.GetItem(item);

View File

@ -412,14 +412,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
newFolderName = InventoryArchiveUtils.UnescapeArchivePath(newFolderName); newFolderName = InventoryArchiveUtils.UnescapeArchivePath(newFolderName);
UUID newFolderId = UUID.Random(); UUID newFolderId = UUID.Random();
// Asset type has to be Unknown here rather than Folder, otherwise the created folder can't be
// deleted once the client has relogged.
// The root folder appears to be labelled AssetType.Folder (shows up as "Category" in the client)
// even though there is a AssetType.RootCategory
destFolder destFolder
= new InventoryFolderBase( = new InventoryFolderBase(
newFolderId, newFolderName, m_userInfo.PrincipalID, newFolderId, newFolderName, m_userInfo.PrincipalID,
(short)AssetType.Unknown, destFolder.ID, 1); (short)FolderType.None, destFolder.ID, 1);
m_InventoryService.AddFolder(destFolder); m_InventoryService.AddFolder(destFolder);
// Record that we have now created this folder // Record that we have now created this folder

View File

@ -372,7 +372,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
IInventoryService invService = scene.InventoryService; IInventoryService invService = scene.InventoryService;
InventoryFolderBase trashFolder = InventoryFolderBase trashFolder =
invService.GetFolderForType(client.AgentId, AssetType.TrashFolder); invService.GetFolderForType(client.AgentId, FolderType.Trash);
UUID inventoryID = new UUID(im.imSessionID); // The inventory item/folder, back from it's trip UUID inventoryID = new UUID(im.imSessionID); // The inventory item/folder, back from it's trip

View File

@ -236,8 +236,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests
InventoryItemBase receivedItem InventoryItemBase receivedItem
= UserInventoryHelpers.GetInventoryItem(m_scene.InventoryService, receiverSp.UUID, "Trash/givenObj"); = UserInventoryHelpers.GetInventoryItem(m_scene.InventoryService, receiverSp.UUID, "Trash/givenObj");
InventoryFolderBase trashFolder InventoryFolderBase trashFolder
= m_scene.InventoryService.GetFolderForType(receiverSp.UUID, AssetType.TrashFolder); = m_scene.InventoryService.GetFolderForType(receiverSp.UUID, FolderType.Trash);
Assert.That(receivedItem, Is.Not.Null); Assert.That(receivedItem, Is.Not.Null);
Assert.That(receivedItem.ID, Is.Not.EqualTo(originalItem.ID)); Assert.That(receivedItem.ID, Is.Not.EqualTo(originalItem.ID));
@ -429,8 +429,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests
InventoryFolderBase receivedFolder InventoryFolderBase receivedFolder
= UserInventoryHelpers.GetInventoryFolder(m_scene.InventoryService, receiverSp.UUID, "Trash/f1"); = UserInventoryHelpers.GetInventoryFolder(m_scene.InventoryService, receiverSp.UUID, "Trash/f1");
InventoryFolderBase trashFolder InventoryFolderBase trashFolder
= m_scene.InventoryService.GetFolderForType(receiverSp.UUID, AssetType.TrashFolder); = m_scene.InventoryService.GetFolderForType(receiverSp.UUID, FolderType.Trash);
Assert.That(receivedFolder, Is.Not.Null); Assert.That(receivedFolder, Is.Not.Null);
Assert.That(receivedFolder.ID, Is.Not.EqualTo(originalFolder.ID)); Assert.That(receivedFolder.ID, Is.Not.EqualTo(originalFolder.ID));

View File

@ -695,18 +695,18 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
if (remoteClient == null || if (remoteClient == null ||
so.OwnerID != remoteClient.AgentId) so.OwnerID != remoteClient.AgentId)
{ {
folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.LostAndFoundFolder); folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.LostAndFound);
} }
else else
{ {
folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.TrashFolder); folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.Trash);
} }
} }
else if (action == DeRezAction.Return) else if (action == DeRezAction.Return)
{ {
// Dump to lost + found unconditionally // Dump to lost + found unconditionally
// //
folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.LostAndFoundFolder); folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.LostAndFound);
} }
if (folderID == UUID.Zero && folder == null) if (folderID == UUID.Zero && folder == null)
@ -715,7 +715,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
{ {
// Deletes go to trash by default // Deletes go to trash by default
// //
folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.TrashFolder); folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.Trash);
} }
else else
{ {
@ -723,14 +723,14 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
{ {
// Taking copy of another person's item. Take to // Taking copy of another person's item. Take to
// Objects folder. // Objects folder.
folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.Object); folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.Object);
so.FromFolderID = UUID.Zero; so.FromFolderID = UUID.Zero;
} }
else else
{ {
// Catch all. Use lost & found // Catch all. Use lost & found
// //
folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.LostAndFoundFolder); folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.LostAndFound);
} }
} }
} }
@ -748,7 +748,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
if(folder.Type == 14 || folder.Type == 16) if(folder.Type == 14 || folder.Type == 16)
{ {
// folder.Type = 6; // folder.Type = 6;
folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.Object); folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.Object);
} }
} }
} }

View File

@ -175,7 +175,7 @@ namespace OpenSim.Region.CoreModules.Framework.Library
/// <param name="userID"></param> /// <param name="userID"></param>
/// <param name="type"></param> /// <param name="type"></param>
/// <returns></returns> /// <returns></returns>
public InventoryFolderBase GetFolderForType(UUID userID, AssetType type) { return null; } public InventoryFolderBase GetFolderForType(UUID userID, FolderType type) { return null; }
/// <summary> /// <summary>

View File

@ -345,7 +345,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
return root; return root;
} }
public InventoryFolderBase GetFolderForType(UUID userID, AssetType type) public InventoryFolderBase GetFolderForType(UUID userID, FolderType type)
{ {
//m_log.DebugFormat("[HG INVENTORY CONNECTOR]: GetFolderForType {0} type {1}", userID, type); //m_log.DebugFormat("[HG INVENTORY CONNECTOR]: GetFolderForType {0} type {1}", userID, type);
InventoryFolderBase f = m_Cache.GetFolderForType(userID, type); InventoryFolderBase f = m_Cache.GetFolderForType(userID, type);

View File

@ -41,7 +41,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
private const double CACHE_EXPIRATION_SECONDS = 3600.0; // 1 hour private const double CACHE_EXPIRATION_SECONDS = 3600.0; // 1 hour
private static ExpiringCache<UUID, InventoryFolderBase> m_RootFolders = new ExpiringCache<UUID, InventoryFolderBase>(); private static ExpiringCache<UUID, InventoryFolderBase> m_RootFolders = new ExpiringCache<UUID, InventoryFolderBase>();
private static ExpiringCache<UUID, Dictionary<AssetType, InventoryFolderBase>> m_FolderTypes = new ExpiringCache<UUID, Dictionary<AssetType, InventoryFolderBase>>(); private static ExpiringCache<UUID, Dictionary<FolderType, InventoryFolderBase>> m_FolderTypes = new ExpiringCache<UUID, Dictionary<FolderType, InventoryFolderBase>>();
private static ExpiringCache<UUID, InventoryCollection> m_Inventories = new ExpiringCache<UUID, InventoryCollection>(); private static ExpiringCache<UUID, InventoryCollection> m_Inventories = new ExpiringCache<UUID, InventoryCollection>();
public void Cache(UUID userID, InventoryFolderBase root) public void Cache(UUID userID, InventoryFolderBase root)
@ -58,12 +58,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
return null; return null;
} }
public void Cache(UUID userID, AssetType type, InventoryFolderBase folder) public void Cache(UUID userID, FolderType type, InventoryFolderBase folder)
{ {
Dictionary<AssetType, InventoryFolderBase> ff = null; Dictionary<FolderType, InventoryFolderBase> ff = null;
if (!m_FolderTypes.TryGetValue(userID, out ff)) if (!m_FolderTypes.TryGetValue(userID, out ff))
{ {
ff = new Dictionary<AssetType, InventoryFolderBase>(); ff = new Dictionary<FolderType, InventoryFolderBase>();
m_FolderTypes.Add(userID, ff, CACHE_EXPIRATION_SECONDS); m_FolderTypes.Add(userID, ff, CACHE_EXPIRATION_SECONDS);
} }
@ -77,9 +77,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
} }
} }
public InventoryFolderBase GetFolderForType(UUID userID, AssetType type) public InventoryFolderBase GetFolderForType(UUID userID, FolderType type)
{ {
Dictionary<AssetType, InventoryFolderBase> ff = null; Dictionary<FolderType, InventoryFolderBase> ff = null;
if (m_FolderTypes.TryGetValue(userID, out ff)) if (m_FolderTypes.TryGetValue(userID, out ff))
{ {
InventoryFolderBase f = null; InventoryFolderBase f = null;

View File

@ -170,7 +170,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
return m_InventoryService.GetRootFolder(userID); return m_InventoryService.GetRootFolder(userID);
} }
public InventoryFolderBase GetFolderForType(UUID userID, AssetType type) public InventoryFolderBase GetFolderForType(UUID userID, FolderType type)
{ {
return m_InventoryService.GetFolderForType(userID, type); return m_InventoryService.GetFolderForType(userID, type);
} }

View File

@ -177,7 +177,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
return m_RemoteConnector.GetRootFolder(userID); return m_RemoteConnector.GetRootFolder(userID);
} }
public InventoryFolderBase GetFolderForType(UUID userID, AssetType type) public InventoryFolderBase GetFolderForType(UUID userID, FolderType type)
{ {
return m_RemoteConnector.GetFolderForType(userID, type); return m_RemoteConnector.GetFolderForType(userID, type);
} }

View File

@ -156,7 +156,9 @@ namespace OpenSim.Region.Framework.Scenes
// OK so either the viewer didn't send a folderID or AddItem failed // OK so either the viewer didn't send a folderID or AddItem failed
UUID originalFolder = item.Folder; UUID originalFolder = item.Folder;
InventoryFolderBase f = InventoryService.GetFolderForType(item.Owner, (AssetType)item.AssetType); InventoryFolderBase f = null;
if (Enum.IsDefined(typeof(FolderType), (sbyte)item.AssetType))
f = InventoryService.GetFolderForType(item.Owner, (FolderType)item.AssetType);
if (f != null) if (f != null)
{ {
m_log.DebugFormat( m_log.DebugFormat(
@ -743,7 +745,9 @@ namespace OpenSim.Region.Framework.Scenes
if (itemCopy.Folder == UUID.Zero) if (itemCopy.Folder == UUID.Zero)
{ {
InventoryFolderBase folder = InventoryService.GetFolderForType(recipient, (AssetType)itemCopy.AssetType); InventoryFolderBase folder = null;
if (Enum.IsDefined(typeof(FolderType), (sbyte)item.AssetType))
folder = InventoryService.GetFolderForType(recipient, (FolderType)itemCopy.AssetType);
if (folder != null) if (folder != null)
{ {
@ -1155,7 +1159,7 @@ namespace OpenSim.Region.Framework.Scenes
if (item == null) if (item == null)
return; return;
InventoryFolderBase destFolder = InventoryService.GetFolderForType(remoteClient.AgentId, AssetType.TrashFolder); InventoryFolderBase destFolder = InventoryService.GetFolderForType(remoteClient.AgentId, FolderType.Trash);
// Move the item to trash. If this is a copyable item, only // Move the item to trash. If this is a copyable item, only
// a copy will be moved and we will still need to delete // a copy will be moved and we will still need to delete

View File

@ -269,7 +269,7 @@ namespace OpenSim.Server.Handlers.Inventory
UUID.TryParse(request["PRINCIPAL"].ToString(), out principal); UUID.TryParse(request["PRINCIPAL"].ToString(), out principal);
int type = 0; int type = 0;
Int32.TryParse(request["TYPE"].ToString(), out type); Int32.TryParse(request["TYPE"].ToString(), out type);
InventoryFolderBase folder = m_InventoryService.GetFolderForType(principal, (AssetType)type); InventoryFolderBase folder = m_InventoryService.GetFolderForType(principal, (FolderType)type);
if (folder != null) if (folder != null)
result["folder"] = EncodeFolder(folder); result["folder"] = EncodeFolder(folder);

View File

@ -189,7 +189,7 @@ namespace OpenSim.Services.Connectors
return BuildFolder((Dictionary<string, object>)ret["folder"]); return BuildFolder((Dictionary<string, object>)ret["folder"]);
} }
public InventoryFolderBase GetFolderForType(UUID principalID, AssetType type) public InventoryFolderBase GetFolderForType(UUID principalID, FolderType type)
{ {
Dictionary<string,object> ret = MakeRequest("GETFOLDERFORTYPE", Dictionary<string,object> ret = MakeRequest("GETFOLDERFORTYPE",
new Dictionary<string,object> { new Dictionary<string,object> {

View File

@ -240,7 +240,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
/// <param name="userID"></param> /// <param name="userID"></param>
/// <param name="type"></param> /// <param name="type"></param>
/// <returns></returns> /// <returns></returns>
public InventoryFolderBase GetFolderForType(UUID userID, AssetType type) public InventoryFolderBase GetFolderForType(UUID userID, FolderType type)
{ {
string contentType = SLUtil.SLAssetTypeToContentType((int)type); string contentType = SLUtil.SLAssetTypeToContentType((int)type);
@ -580,7 +580,9 @@ namespace OpenSim.Services.Connectors.SimianGrid
// A folder of UUID.Zero means we need to find the most appropriate home for this item // A folder of UUID.Zero means we need to find the most appropriate home for this item
if (item.Folder == UUID.Zero) if (item.Folder == UUID.Zero)
{ {
InventoryFolderBase folder = GetFolderForType(item.Owner, (AssetType)item.AssetType); InventoryFolderBase folder = null;
if (Enum.IsDefined(typeof(FolderType), (sbyte)item.AssetType))
folder = GetFolderForType(item.Owner, (FolderType)item.AssetType);
if (folder != null && folder.ID != UUID.Zero) if (folder != null && folder.ID != UUID.Zero)
item.Folder = folder.ID; item.Folder = folder.ID;
else else

View File

@ -115,7 +115,7 @@ namespace OpenSim.Services.HypergridService
return ConvertToOpenSim(folders[0]); return ConvertToOpenSim(folders[0]);
// make one // make one
XInventoryFolder suitcase = CreateFolder(principalID, UUID.Zero, (int)AssetType.Folder, "My Suitcase"); XInventoryFolder suitcase = CreateFolder(principalID, UUID.Zero, (int)FolderType.Suitcase, "My Suitcase");
return ConvertToOpenSim(suitcase); return ConvertToOpenSim(suitcase);
} }
@ -141,7 +141,7 @@ namespace OpenSim.Services.HypergridService
//} //}
public override InventoryFolderBase GetFolderForType(UUID principalID, AssetType type) public override InventoryFolderBase GetFolderForType(UUID principalID, FolderType type)
{ {
//m_log.DebugFormat("[HG INVENTORY SERVICE]: GetFolderForType for {0} {0}", principalID, type); //m_log.DebugFormat("[HG INVENTORY SERVICE]: GetFolderForType for {0} {0}", principalID, type);
return GetRootFolder(principalID); return GetRootFolder(principalID);

View File

@ -158,7 +158,7 @@ namespace OpenSim.Services.HypergridService
m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: User {0} does not have a Suitcase folder. Creating it...", principalID); m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: User {0} does not have a Suitcase folder. Creating it...", principalID);
// Create the My Suitcase folder under the user's root folder. // Create the My Suitcase folder under the user's root folder.
// In the DB we tag it as type 100, but we use type 8 (Folder) outside, as this affects the sort order. // In the DB we tag it as type 100, but we use type 8 (Folder) outside, as this affects the sort order.
suitcase = CreateFolder(principalID, root.folderID, InventoryItemBase.SUITCASE_FOLDER_TYPE, InventoryItemBase.SUITCASE_FOLDER_NAME); suitcase = CreateFolder(principalID, root.folderID, (int)FolderType.Suitcase, InventoryFolderBase.SUITCASE_FOLDER_NAME);
if (suitcase == null) if (suitcase == null)
{ {
m_log.ErrorFormat("[HG SUITCASE INVENTORY SERVICE]: Unable to create suitcase folder"); m_log.ErrorFormat("[HG SUITCASE INVENTORY SERVICE]: Unable to create suitcase folder");
@ -178,41 +178,41 @@ namespace OpenSim.Services.HypergridService
m_log.Debug("[HG SUITCASE INVENTORY SERVICE]: Creating System folders under Suitcase..."); m_log.Debug("[HG SUITCASE INVENTORY SERVICE]: Creating System folders under Suitcase...");
XInventoryFolder[] sysFolders = GetSystemFolders(principalID, rootID); XInventoryFolder[] sysFolders = GetSystemFolders(principalID, rootID);
if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)AssetType.Animation) return true; return false; })) if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Animation) return true; return false; }))
CreateFolder(principalID, rootID, (int)AssetType.Animation, "Animations"); CreateFolder(principalID, rootID, (int)FolderType.Animation, "Animations");
if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)AssetType.Bodypart) return true; return false; })) if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.BodyPart) return true; return false; }))
CreateFolder(principalID, rootID, (int)AssetType.Bodypart, "Body Parts"); CreateFolder(principalID, rootID, (int)FolderType.BodyPart, "Body Parts");
if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)AssetType.CallingCard) return true; return false; })) if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.CallingCard) return true; return false; }))
CreateFolder(principalID, rootID, (int)AssetType.CallingCard, "Calling Cards"); CreateFolder(principalID, rootID, (int)FolderType.CallingCard, "Calling Cards");
if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)AssetType.Clothing) return true; return false; })) if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Clothing) return true; return false; }))
CreateFolder(principalID, rootID, (int)AssetType.Clothing, "Clothing"); CreateFolder(principalID, rootID, (int)FolderType.Clothing, "Clothing");
if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)AssetType.CurrentOutfitFolder) return true; return false; })) if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.CurrentOutfit) return true; return false; }))
CreateFolder(principalID, rootID, (int)AssetType.CurrentOutfitFolder, "Current Outfit"); CreateFolder(principalID, rootID, (int)FolderType.CurrentOutfit, "Current Outfit");
if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)AssetType.FavoriteFolder) return true; return false; })) if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Favorites) return true; return false; }))
CreateFolder(principalID, rootID, (int)AssetType.FavoriteFolder, "Favorites"); CreateFolder(principalID, rootID, (int)FolderType.Favorites, "Favorites");
if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)AssetType.Gesture) return true; return false; })) if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Gesture) return true; return false; }))
CreateFolder(principalID, rootID, (int)AssetType.Gesture, "Gestures"); CreateFolder(principalID, rootID, (int)FolderType.Gesture, "Gestures");
if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)AssetType.Landmark) return true; return false; })) if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Landmark) return true; return false; }))
CreateFolder(principalID, rootID, (int)AssetType.Landmark, "Landmarks"); CreateFolder(principalID, rootID, (int)FolderType.Landmark, "Landmarks");
if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)AssetType.LostAndFoundFolder) return true; return false; })) if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.LostAndFound) return true; return false; }))
CreateFolder(principalID, rootID, (int)AssetType.LostAndFoundFolder, "Lost And Found"); CreateFolder(principalID, rootID, (int)FolderType.LostAndFound, "Lost And Found");
if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)AssetType.Notecard) return true; return false; })) if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Notecard) return true; return false; }))
CreateFolder(principalID, rootID, (int)AssetType.Notecard, "Notecards"); CreateFolder(principalID, rootID, (int)FolderType.Notecard, "Notecards");
if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)AssetType.Object) return true; return false; })) if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Object) return true; return false; }))
CreateFolder(principalID, rootID, (int)AssetType.Object, "Objects"); CreateFolder(principalID, rootID, (int)FolderType.Object, "Objects");
if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)AssetType.SnapshotFolder) return true; return false; })) if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Snapshot) return true; return false; }))
CreateFolder(principalID, rootID, (int)AssetType.SnapshotFolder, "Photo Album"); CreateFolder(principalID, rootID, (int)FolderType.Snapshot, "Photo Album");
if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)AssetType.LSLText) return true; return false; })) if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.LSLText) return true; return false; }))
CreateFolder(principalID, rootID, (int)AssetType.LSLText, "Scripts"); CreateFolder(principalID, rootID, (int)FolderType.LSLText, "Scripts");
if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)AssetType.Sound) return true; return false; })) if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Sound) return true; return false; }))
CreateFolder(principalID, rootID, (int)AssetType.Sound, "Sounds"); CreateFolder(principalID, rootID, (int)FolderType.Sound, "Sounds");
if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)AssetType.Texture) return true; return false; })) if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Texture) return true; return false; }))
CreateFolder(principalID, rootID, (int)AssetType.Texture, "Textures"); CreateFolder(principalID, rootID, (int)FolderType.Texture, "Textures");
if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)AssetType.TrashFolder) return true; return false; })) if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Trash) return true; return false; }))
CreateFolder(principalID, rootID, (int)AssetType.TrashFolder, "Trash"); CreateFolder(principalID, rootID, (int)FolderType.Trash, "Trash");
} }
public override InventoryFolderBase GetFolderForType(UUID principalID, AssetType type) public override InventoryFolderBase GetFolderForType(UUID principalID, FolderType type)
{ {
//m_log.DebugFormat("[HG INVENTORY SERVICE]: GetFolderForType for {0} {0}", principalID, type); //m_log.DebugFormat("[HG INVENTORY SERVICE]: GetFolderForType for {0} {0}", principalID, type);
XInventoryFolder suitcase = GetSuitcaseXFolder(principalID); XInventoryFolder suitcase = GetSuitcaseXFolder(principalID);
@ -468,7 +468,7 @@ namespace OpenSim.Services.HypergridService
{ {
XInventoryFolder[] folders = m_Database.GetFolders( XInventoryFolder[] folders = m_Database.GetFolders(
new string[] { "agentID", "folderName", "type" }, new string[] { "agentID", "folderName", "type" },
new string[] { principalID.ToString(), "My Inventory", ((int)AssetType.RootFolder).ToString() }); new string[] { principalID.ToString(), InventoryFolderBase.ROOT_FOLDER_NAME, ((int)FolderType.Root).ToString() });
if (folders != null && folders.Length > 0) if (folders != null && folders.Length > 0)
return folders[0]; return folders[0];
@ -476,7 +476,7 @@ namespace OpenSim.Services.HypergridService
// OK, so the RootFolder type didn't work. Let's look for any type with parent UUID.Zero. // OK, so the RootFolder type didn't work. Let's look for any type with parent UUID.Zero.
folders = m_Database.GetFolders( folders = m_Database.GetFolders(
new string[] { "agentID", "folderName", "parentFolderID" }, new string[] { "agentID", "folderName", "parentFolderID" },
new string[] { principalID.ToString(), "My Inventory", UUID.Zero.ToString() }); new string[] { principalID.ToString(), InventoryFolderBase.ROOT_FOLDER_NAME, UUID.Zero.ToString() });
if (folders != null && folders.Length > 0) if (folders != null && folders.Length > 0)
return folders[0]; return folders[0];
@ -492,7 +492,7 @@ namespace OpenSim.Services.HypergridService
XInventoryFolder[] folders = m_Database.GetFolders( XInventoryFolder[] folders = m_Database.GetFolders(
new string[] { "agentID", "type", "parentFolderID" }, new string[] { "agentID", "type", "parentFolderID" },
new string[] { userID.ToString(), ((int)AssetType.CurrentOutfitFolder).ToString(), root.folderID.ToString() }); new string[] { userID.ToString(), ((int)FolderType.CurrentOutfit).ToString(), root.folderID.ToString() });
if (folders.Length == 0) if (folders.Length == 0)
return null; return null;
@ -505,7 +505,7 @@ namespace OpenSim.Services.HypergridService
// Warp! Root folder for travelers // Warp! Root folder for travelers
XInventoryFolder[] folders = m_Database.GetFolders( XInventoryFolder[] folders = m_Database.GetFolders(
new string[] { "agentID", "type" }, new string[] { "agentID", "type" },
new string[] { principalID.ToString(), InventoryItemBase.SUITCASE_FOLDER_TYPE.ToString() }); // This is a special folder type... new string[] { principalID.ToString(), FolderType.Suitcase.ToString() });
if (folders != null && folders.Length > 0) if (folders != null && folders.Length > 0)
return folders[0]; return folders[0];
@ -513,13 +513,13 @@ namespace OpenSim.Services.HypergridService
// check to see if we have the old Suitcase folder // check to see if we have the old Suitcase folder
folders = m_Database.GetFolders( folders = m_Database.GetFolders(
new string[] { "agentID", "folderName", "parentFolderID" }, new string[] { "agentID", "folderName", "parentFolderID" },
new string[] { principalID.ToString(), InventoryItemBase.SUITCASE_FOLDER_NAME, UUID.Zero.ToString() }); new string[] { principalID.ToString(), InventoryFolderBase.SUITCASE_FOLDER_NAME, UUID.Zero.ToString() });
if (folders != null && folders.Length > 0) if (folders != null && folders.Length > 0)
{ {
// Move it to under the root folder // Move it to under the root folder
XInventoryFolder root = GetRootXFolder(principalID); XInventoryFolder root = GetRootXFolder(principalID);
folders[0].parentFolderID = root.folderID; folders[0].parentFolderID = root.folderID;
folders[0].type = InventoryItemBase.SUITCASE_FOLDER_TYPE; folders[0].type = (int)FolderType.Suitcase;
m_Database.StoreFolder(folders[0]); m_Database.StoreFolder(folders[0]);
return folders[0]; return folders[0];
} }
@ -529,7 +529,7 @@ namespace OpenSim.Services.HypergridService
private void SetAsNormalFolder(XInventoryFolder suitcase) private void SetAsNormalFolder(XInventoryFolder suitcase)
{ {
suitcase.type = InventoryItemBase.SUITCASE_FOLDER_FAKE_TYPE; //suitcase.type = InventoryItemBase.SUITCASE_FOLDER_FAKE_TYPE;
} }
private List<XInventoryFolder> GetFolderTree(UUID principalID, UUID folder) private List<XInventoryFolder> GetFolderTree(UUID principalID, UUID folder)

View File

@ -67,7 +67,7 @@ namespace OpenSim.Services.Interfaces
/// <param name="userID"></param> /// <param name="userID"></param>
/// <param name="type"></param> /// <param name="type"></param>
/// <returns></returns> /// <returns></returns>
InventoryFolderBase GetFolderForType(UUID userID, AssetType type); InventoryFolderBase GetFolderForType(UUID userID, FolderType type);
/// <summary> /// <summary>
/// Gets everything (folders and items) inside a folder /// Gets everything (folders and items) inside a folder

View File

@ -111,48 +111,48 @@ namespace OpenSim.Services.InventoryService
if (rootFolder == null) if (rootFolder == null)
{ {
rootFolder = ConvertToOpenSim(CreateFolder(principalID, UUID.Zero, (int)AssetType.RootFolder, "My Inventory")); rootFolder = ConvertToOpenSim(CreateFolder(principalID, UUID.Zero, (int)FolderType.Root, InventoryFolderBase.ROOT_FOLDER_NAME));
result = true; result = true;
} }
XInventoryFolder[] sysFolders = GetSystemFolders(principalID, rootFolder.ID); XInventoryFolder[] sysFolders = GetSystemFolders(principalID, rootFolder.ID);
if (!Array.Exists(sysFolders, delegate (XInventoryFolder f) { if (f.type == (int)AssetType.Animation) return true; return false; })) if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Animation) return true; return false; }))
CreateFolder(principalID, rootFolder.ID, (int)AssetType.Animation, "Animations"); CreateFolder(principalID, rootFolder.ID, (int)FolderType.Animation, "Animations");
if (!Array.Exists(sysFolders, delegate (XInventoryFolder f) { if (f.type == (int)AssetType.Bodypart) return true; return false; })) if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.BodyPart) return true; return false; }))
CreateFolder(principalID, rootFolder.ID, (int)AssetType.Bodypart, "Body Parts"); CreateFolder(principalID, rootFolder.ID, (int)FolderType.BodyPart, "Body Parts");
if (!Array.Exists(sysFolders, delegate (XInventoryFolder f) { if (f.type == (int)AssetType.CallingCard) return true; return false; })) if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.CallingCard) return true; return false; }))
{ {
XInventoryFolder folder = CreateFolder(principalID, rootFolder.ID, (int)AssetType.CallingCard, "Calling Cards"); XInventoryFolder folder = CreateFolder(principalID, rootFolder.ID, (int)FolderType.CallingCard, "Calling Cards");
folder = CreateFolder(principalID, folder.folderID, (int)AssetType.CallingCard, "Friends"); folder = CreateFolder(principalID, folder.folderID, (int)FolderType.CallingCard, "Friends");
CreateFolder(principalID, folder.folderID, (int)AssetType.CallingCard, "All"); CreateFolder(principalID, folder.folderID, (int)FolderType.CallingCard, "All");
} }
if (!Array.Exists(sysFolders, delegate (XInventoryFolder f) { if (f.type == (int)AssetType.Clothing) return true; return false; })) if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Clothing) return true; return false; }))
CreateFolder(principalID, rootFolder.ID, (int)AssetType.Clothing, "Clothing"); CreateFolder(principalID, rootFolder.ID, (int)FolderType.Clothing, "Clothing");
if (!Array.Exists(sysFolders, delegate (XInventoryFolder f) { if (f.type == (int)AssetType.CurrentOutfitFolder) return true; return false; })) if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.CurrentOutfit) return true; return false; }))
CreateFolder(principalID, rootFolder.ID, (int)AssetType.CurrentOutfitFolder, "Current Outfit"); CreateFolder(principalID, rootFolder.ID, (int)FolderType.CurrentOutfit, "Current Outfit");
if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)AssetType.FavoriteFolder) return true; return false; })) if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Favorites) return true; return false; }))
CreateFolder(principalID, rootFolder.ID, (int)AssetType.FavoriteFolder, "Favorites"); CreateFolder(principalID, rootFolder.ID, (int)FolderType.Favorites, "Favorites");
if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)AssetType.Gesture) return true; return false; })) if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Gesture) return true; return false; }))
CreateFolder(principalID, rootFolder.ID, (int)AssetType.Gesture, "Gestures"); CreateFolder(principalID, rootFolder.ID, (int)FolderType.Gesture, "Gestures");
if (!Array.Exists(sysFolders, delegate (XInventoryFolder f) { if (f.type == (int)AssetType.Landmark) return true; return false; })) if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Landmark) return true; return false; }))
CreateFolder(principalID, rootFolder.ID, (int)AssetType.Landmark, "Landmarks"); CreateFolder(principalID, rootFolder.ID, (int)FolderType.Landmark, "Landmarks");
if (!Array.Exists(sysFolders, delegate (XInventoryFolder f) { if (f.type == (int)AssetType.LostAndFoundFolder) return true; return false; })) if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.LostAndFound) return true; return false; }))
CreateFolder(principalID, rootFolder.ID, (int)AssetType.LostAndFoundFolder, "Lost And Found"); CreateFolder(principalID, rootFolder.ID, (int)FolderType.LostAndFound, "Lost And Found");
if (!Array.Exists(sysFolders, delegate (XInventoryFolder f) { if (f.type == (int)AssetType.Notecard) return true; return false; })) if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Notecard) return true; return false; }))
CreateFolder(principalID, rootFolder.ID, (int)AssetType.Notecard, "Notecards"); CreateFolder(principalID, rootFolder.ID, (int)FolderType.Notecard, "Notecards");
if (!Array.Exists(sysFolders, delegate (XInventoryFolder f) { if (f.type == (int)AssetType.Object) return true; return false; })) if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Object) return true; return false; }))
CreateFolder(principalID, rootFolder.ID, (int)AssetType.Object, "Objects"); CreateFolder(principalID, rootFolder.ID, (int)FolderType.Object, "Objects");
if (!Array.Exists(sysFolders, delegate (XInventoryFolder f) { if (f.type == (int)AssetType.SnapshotFolder) return true; return false; })) if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Snapshot) return true; return false; }))
CreateFolder(principalID, rootFolder.ID, (int)AssetType.SnapshotFolder, "Photo Album"); CreateFolder(principalID, rootFolder.ID, (int)FolderType.Snapshot, "Photo Album");
if (!Array.Exists(sysFolders, delegate (XInventoryFolder f) { if (f.type == (int)AssetType.LSLText) return true; return false; })) if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.LSLText) return true; return false; }))
CreateFolder(principalID, rootFolder.ID, (int)AssetType.LSLText, "Scripts"); CreateFolder(principalID, rootFolder.ID, (int)FolderType.LSLText, "Scripts");
if (!Array.Exists(sysFolders, delegate (XInventoryFolder f) { if (f.type == (int)AssetType.Sound) return true; return false; })) if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Sound) return true; return false; }))
CreateFolder(principalID, rootFolder.ID, (int)AssetType.Sound, "Sounds"); CreateFolder(principalID, rootFolder.ID, (int)FolderType.Sound, "Sounds");
if (!Array.Exists(sysFolders, delegate (XInventoryFolder f) { if (f.type == (int)AssetType.Texture) return true; return false; })) if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Texture) return true; return false; }))
CreateFolder(principalID, rootFolder.ID, (int)AssetType.Texture, "Textures"); CreateFolder(principalID, rootFolder.ID, (int)FolderType.Texture, "Textures");
if (!Array.Exists(sysFolders, delegate (XInventoryFolder f) { if (f.type == (int)AssetType.TrashFolder) return true; return false; })) if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Trash) return true; return false; }))
CreateFolder(principalID, rootFolder.ID, (int)AssetType.TrashFolder, "Trash"); CreateFolder(principalID, rootFolder.ID, (int)FolderType.Trash, "Trash");
return result; return result;
} }
@ -228,7 +228,7 @@ namespace OpenSim.Services.InventoryService
XInventoryFolder root = null; XInventoryFolder root = null;
foreach (XInventoryFolder folder in folders) foreach (XInventoryFolder folder in folders)
{ {
if (folder.folderName == "My Inventory") if (folder.folderName == InventoryFolderBase.ROOT_FOLDER_NAME)
{ {
root = folder; root = folder;
break; break;
@ -241,7 +241,7 @@ namespace OpenSim.Services.InventoryService
return ConvertToOpenSim(root); return ConvertToOpenSim(root);
} }
public virtual InventoryFolderBase GetFolderForType(UUID principalID, AssetType type) public virtual InventoryFolderBase GetFolderForType(UUID principalID, FolderType type)
{ {
// m_log.DebugFormat("[XINVENTORY SERVICE]: Getting folder type {0} for user {1}", type, principalID); // m_log.DebugFormat("[XINVENTORY SERVICE]: Getting folder type {0} for user {1}", type, principalID);
@ -259,11 +259,11 @@ namespace OpenSim.Services.InventoryService
return GetSystemFolderForType(rootFolder, type); return GetSystemFolderForType(rootFolder, type);
} }
private InventoryFolderBase GetSystemFolderForType(InventoryFolderBase rootFolder, AssetType type) private InventoryFolderBase GetSystemFolderForType(InventoryFolderBase rootFolder, FolderType type)
{ {
//m_log.DebugFormat("[XINVENTORY SERVICE]: Getting folder type {0}", type); //m_log.DebugFormat("[XINVENTORY SERVICE]: Getting folder type {0}", type);
if (type == AssetType.RootFolder) if (type == FolderType.Root)
return rootFolder; return rootFolder;
XInventoryFolder[] folders = m_Database.GetFolders( XInventoryFolder[] folders = m_Database.GetFolders(
@ -363,7 +363,7 @@ namespace OpenSim.Services.InventoryService
if (check != null) if (check != null)
return false; return false;
if (folder.Type != (short)AssetType.Folder && folder.Type != (short)AssetType.Unknown) if (folder.Type != (short)FolderType.None)
{ {
InventoryFolderBase rootFolder = GetRootFolder(folder.Owner); InventoryFolderBase rootFolder = GetRootFolder(folder.Owner);
@ -380,7 +380,7 @@ namespace OpenSim.Services.InventoryService
if (folder.ParentID == rootFolder.ID) if (folder.ParentID == rootFolder.ID)
{ {
InventoryFolderBase existingSystemFolder InventoryFolderBase existingSystemFolder
= GetSystemFolderForType(rootFolder, (AssetType)folder.Type); = GetSystemFolderForType(rootFolder, (FolderType)folder.Type);
if (existingSystemFolder != null) if (existingSystemFolder != null)
{ {
@ -407,8 +407,8 @@ namespace OpenSim.Services.InventoryService
if (check == null) if (check == null)
return AddFolder(folder); return AddFolder(folder);
if ((check.Type != (short)AssetType.Unknown || xFolder.type != (short)AssetType.Unknown) if ((check.Type != (short)FolderType.None || xFolder.type != (short)FolderType.None)
&& (check.Type != (short)AssetType.OutfitFolder || xFolder.type != (short)AssetType.OutfitFolder)) && (check.Type != (short)FolderType.Outfit || xFolder.type != (short)FolderType.Outfit))
{ {
if (xFolder.version < check.Version) if (xFolder.version < check.Version)
{ {
@ -672,9 +672,9 @@ namespace OpenSim.Services.InventoryService
newFolder.ParentID = folder.parentFolderID; newFolder.ParentID = folder.parentFolderID;
newFolder.Type = (short)folder.type; newFolder.Type = (short)folder.type;
// Viewer can't understand anything that's not in it's LLFolderType enum //// Viewer can't understand anything that's not in it's LLFolderType enum
if (newFolder.Type == InventoryItemBase.SUITCASE_FOLDER_TYPE) //if (newFolder.Type == InventoryItemBase.SUITCASE_FOLDER_TYPE)
newFolder.Type = InventoryItemBase.SUITCASE_FOLDER_FAKE_TYPE; // newFolder.Type = InventoryItemBase.SUITCASE_FOLDER_FAKE_TYPE;
newFolder.Version = (ushort)folder.version; newFolder.Version = (ushort)folder.version;
newFolder.Name = folder.folderName; newFolder.Name = folder.folderName;
newFolder.Owner = folder.agentID; newFolder.Owner = folder.agentID;
@ -765,7 +765,7 @@ namespace OpenSim.Services.InventoryService
if (folder.Length < 1) if (folder.Length < 1)
return false; return false;
if (folder[0].type == (int)AssetType.TrashFolder) if (folder[0].type == (int)FolderType.Trash)
return true; return true;
UUID parentFolder = folder[0].parentFolderID; UUID parentFolder = folder[0].parentFolderID;
@ -776,9 +776,9 @@ namespace OpenSim.Services.InventoryService
if (parent.Length < 1) if (parent.Length < 1)
return false; return false;
if (parent[0].type == (int)AssetType.TrashFolder) if (parent[0].type == (int)FolderType.Trash)
return true; return true;
if (parent[0].type == (int)AssetType.RootFolder) if (parent[0].type == (int)FolderType.Root)
return false; return false;
parentFolder = parent[0].parentFolderID; parentFolder = parent[0].parentFolderID;

View File

@ -788,7 +788,7 @@ namespace OpenSim.Services.LLLoginService
Hashtable TempHash; Hashtable TempHash;
foreach (InventoryFolderBase InvFolder in folders) foreach (InventoryFolderBase InvFolder in folders)
{ {
if (InvFolder.ParentID == UUID.Zero && InvFolder.Name == "My Inventory") if (InvFolder.ParentID == UUID.Zero && InvFolder.Name == InventoryFolderBase.ROOT_FOLDER_NAME)
{ {
rootID = InvFolder.ID; rootID = InvFolder.ID;
} }

View File

@ -595,7 +595,7 @@ namespace OpenSim.Services.UserAccountService
{ {
m_log.DebugFormat("[USER ACCOUNT SERVICE]: Creating default appearance items for {0}", principalID); m_log.DebugFormat("[USER ACCOUNT SERVICE]: Creating default appearance items for {0}", principalID);
InventoryFolderBase bodyPartsFolder = m_InventoryService.GetFolderForType(principalID, AssetType.Bodypart); InventoryFolderBase bodyPartsFolder = m_InventoryService.GetFolderForType(principalID, FolderType.BodyPart);
InventoryItemBase eyes = new InventoryItemBase(UUID.Random(), principalID); InventoryItemBase eyes = new InventoryItemBase(UUID.Random(), principalID);
eyes.AssetID = new UUID("4bb6fa4d-1cd2-498a-a84c-95c1a0e745a7"); eyes.AssetID = new UUID("4bb6fa4d-1cd2-498a-a84c-95c1a0e745a7");
@ -657,7 +657,7 @@ namespace OpenSim.Services.UserAccountService
hair.Flags = (uint)WearableType.Hair; hair.Flags = (uint)WearableType.Hair;
m_InventoryService.AddItem(hair); m_InventoryService.AddItem(hair);
InventoryFolderBase clothingFolder = m_InventoryService.GetFolderForType(principalID, AssetType.Clothing); InventoryFolderBase clothingFolder = m_InventoryService.GetFolderForType(principalID, FolderType.Clothing);
InventoryItemBase shirt = new InventoryItemBase(UUID.Random(), principalID); InventoryItemBase shirt = new InventoryItemBase(UUID.Random(), principalID);
shirt.AssetID = AvatarWearable.DEFAULT_SHIRT_ASSET; shirt.AssetID = AvatarWearable.DEFAULT_SHIRT_ASSET;

View File

@ -102,7 +102,7 @@ namespace OpenSim.Tests.Common
{ {
return AddInventoryItem( return AddInventoryItem(
scene, itemName, itemId, itemType, asset, userId, scene, itemName, itemId, itemType, asset, userId,
scene.InventoryService.GetFolderForType(userId, (AssetType)asset.Type).Name); scene.InventoryService.GetFolderForType(userId, (FolderType)asset.Type).Name);
} }
/// <summary> /// <summary>

View File

@ -78,7 +78,7 @@ namespace Robust.Tests
m_rootFolderID = m_Connector.GetRootFolder(m_userID).ID; m_rootFolderID = m_Connector.GetRootFolder(m_userID).ID;
Assert.AreNotEqual(m_rootFolderID, UUID.Zero, "Root folder ID must not be UUID.Zero"); Assert.AreNotEqual(m_rootFolderID, UUID.Zero, "Root folder ID must not be UUID.Zero");
InventoryFolderBase of = m_Connector.GetFolderForType(m_userID, AssetType.Object); InventoryFolderBase of = m_Connector.GetFolderForType(m_userID, FolderType.Object);
Assert.IsNotNull(of, "Failed to retrieve Objects folder"); Assert.IsNotNull(of, "Failed to retrieve Objects folder");
m_objectsFolder = of.ID; m_objectsFolder = of.ID;
Assert.AreNotEqual(m_objectsFolder, UUID.Zero, "Objects folder ID must not be UUID.Zero"); Assert.AreNotEqual(m_objectsFolder, UUID.Zero, "Objects folder ID must not be UUID.Zero");
@ -93,7 +93,7 @@ namespace Robust.Tests
success = m_Connector.AddItem(item); success = m_Connector.AddItem(item);
Assert.IsTrue(success, "Failed to add object to inventory"); Assert.IsTrue(success, "Failed to add object to inventory");
InventoryFolderBase ncf = m_Connector.GetFolderForType(m_userID, AssetType.Notecard); InventoryFolderBase ncf = m_Connector.GetFolderForType(m_userID, FolderType.Notecard);
Assert.IsNotNull(of, "Failed to retrieve Notecards folder"); Assert.IsNotNull(of, "Failed to retrieve Notecards folder");
m_notecardsFolder = ncf.ID; m_notecardsFolder = ncf.ID;
Assert.AreNotEqual(m_notecardsFolder, UUID.Zero, "Notecards folder ID must not be UUID.Zero"); Assert.AreNotEqual(m_notecardsFolder, UUID.Zero, "Notecards folder ID must not be UUID.Zero");
@ -118,7 +118,7 @@ namespace Robust.Tests
// Add a folder // Add a folder
InventoryFolderBase folder = new InventoryFolderBase(new UUID("f0000000-0000-0000-0000-00000000000f"), "Test Folder", m_userID, m_rootFolderID); InventoryFolderBase folder = new InventoryFolderBase(new UUID("f0000000-0000-0000-0000-00000000000f"), "Test Folder", m_userID, m_rootFolderID);
folder.Type = (int)AssetType.Folder; folder.Type = (int)FolderType.None;
success = m_Connector.AddFolder(folder); success = m_Connector.AddFolder(folder);
Assert.IsTrue(success, "Failed to add Test Folder to inventory"); Assert.IsTrue(success, "Failed to add Test Folder to inventory");
@ -133,7 +133,7 @@ namespace Robust.Tests
Assert.IsTrue(success, "Failed to add link to notecard to inventory"); Assert.IsTrue(success, "Failed to add link to notecard to inventory");
// Add a link to the Objects folder in Test Folder // Add a link to the Objects folder in Test Folder
item.AssetID = m_Connector.GetFolderForType(m_userID, AssetType.Object).ID; // use item ID of Objects folder item.AssetID = m_Connector.GetFolderForType(m_userID, FolderType.Object).ID; // use item ID of Objects folder
item.ID = new UUID("50000000-0000-0000-0000-000000000005"); item.ID = new UUID("50000000-0000-0000-0000-000000000005");
item.AssetType = (int)AssetType.LinkFolder; item.AssetType = (int)AssetType.LinkFolder;
item.Folder = folder.ID; item.Folder = folder.ID;

Binary file not shown.

Binary file not shown.

Binary file not shown.