本文整理汇总了C#中Aurora.Framework.InventoryFolderBase类的典型用法代码示例。如果您正苦于以下问题:C# InventoryFolderBase类的具体用法?C# InventoryFolderBase怎么用?C# InventoryFolderBase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
InventoryFolderBase类属于Aurora.Framework命名空间,在下文中一共展示了InventoryFolderBase类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateUserRootFolder
public virtual bool CreateUserRootFolder(UUID principalID)
{
bool result = false;
InventoryFolderBase rootFolder = GetRootFolder(principalID);
if (rootFolder == null)
{
List<InventoryFolderBase> rootFolders = GetInventorySkeleton(principalID);
if (rootFolders.Count == 0)
rootFolder = CreateFolder(principalID, UUID.Zero, (int) AssetType.RootFolder, "My Inventory");
else
{
rootFolder = new InventoryFolderBase
{
Name = "My Inventory",
Type = (short) AssetType.RootFolder,
Version = 1,
ID = rootFolders[0].ParentID,
Owner = principalID,
ParentID = UUID.Zero
};
m_Database.StoreFolder(rootFolder);
}
result = true;
}
return result;
}
示例2: InventoryFolderImpl
// Constructors
public InventoryFolderImpl(InventoryFolderBase folderbase)
{
Owner = folderbase.Owner;
ID = folderbase.ID;
Name = folderbase.Name;
ParentID = folderbase.ParentID;
Type = folderbase.Type;
Version = folderbase.Version;
}
示例3: AddFolder
public override bool AddFolder(InventoryFolderBase folder)
{
string invserverURL = "";
if (GetHandlers.GetIsForeign (folder.Owner, "InventoryServerURI", m_registry, out invserverURL))
{
XInventoryServicesConnector xinv = new XInventoryServicesConnector (invserverURL + "xinventory");
return xinv.AddFolder (folder);
}
return base.AddFolder (folder);
}
示例4: AddFolder
public override bool AddFolder(InventoryFolderBase folder)
{
object remoteValue = DoRemote(folder);
if (remoteValue != null || m_doRemoteOnly)
return remoteValue != null && (bool)remoteValue;
string invserverURL = "";
if (GetHandlers.GetIsForeign (folder.Owner, "InventoryServerURI", m_registry, out invserverURL))
{
XInventoryServicesConnector xinv = new XInventoryServicesConnector (invserverURL + "xinventory");
return xinv.AddFolder (folder);
}
return base.AddFolder (folder);
}
示例5: FromOSD
public override void FromOSD(OSDMap map)
{
OSDArray items = (OSDArray)map["Items"];
Items = items.ConvertAll<InventoryItemBase>((osd) =>
{
InventoryItemBase item = new InventoryItemBase();
item.FromOSD((OSDMap)osd);
return item;
}
);
OSDArray folders = (OSDArray)map["Folders"];
Folders = folders.ConvertAll<InventoryFolderBase>((osd) =>
{
InventoryFolderBase folder = new InventoryFolderBase();
folder.FromOSD((OSDMap)osd);
return folder;
}
);
UserID = map["UserID"];
}
示例6: AddFolder
public virtual bool AddFolder(InventoryFolderBase folder)
{
if (folder == null)
return false;
Dictionary<string, object> ret = MakeRequest("ADDFOLDER",
new Dictionary<string, object>
{
{"ParentID", folder.ParentID.ToString()},
{"Type", folder.Type.ToString()},
{"Version", folder.Version.ToString()},
{"Name", folder.Name},
{"Owner", folder.Owner.ToString()},
{"ID", folder.ID.ToString()}
});
if (ret == null)
return false;
return bool.Parse(ret["RESULT"].ToString());
}
示例7: HandleMoveInventoryFolder
/// <summary>
/// Move the inventory folder to another place in the user's inventory
/// </summary>
/// <param name="remoteClient">The client that requested the change</param>
/// <param name="folderID">The folder UUID to move</param>
/// <param name="parentID">The folder to move the folder (folderID) into</param>
protected void HandleMoveInventoryFolder(IClientAPI remoteClient, UUID folderID, UUID parentID)
{
InventoryFolderBase folder = new InventoryFolderBase(folderID, remoteClient.AgentId);
folder = m_scene.InventoryService.GetFolder(folder);
if (folder != null)
{
folder.ParentID = parentID;
if (!m_scene.InventoryService.MoveFolder(folder))
MainConsole.Instance.WarnFormat("[AGENT INVENTORY]: could not move folder {0}", folderID);
else
MainConsole.Instance.DebugFormat("[AGENT INVENTORY]: folder {0} moved to parent {1}", folderID, parentID);
}
else
{
MainConsole.Instance.WarnFormat("[AGENT INVENTORY]: request to move folder {0} but folder not found", folderID);
}
}
示例8: HandleCreateInventoryFolder
/// <summary>
/// Handle an inventory folder creation request from the client.
/// </summary>
/// <param name="remoteClient"></param>
/// <param name="folderID"></param>
/// <param name="folderType"></param>
/// <param name="folderName"></param>
/// <param name="parentID"></param>
protected void HandleCreateInventoryFolder(IClientAPI remoteClient, UUID folderID, ushort folderType,
string folderName, UUID parentID)
{
InventoryFolderBase folder = new InventoryFolderBase(folderID, folderName, remoteClient.AgentId, (short)folderType, parentID, 1);
if (!m_scene.InventoryService.AddFolder(folder))
{
MainConsole.Instance.WarnFormat(
"[AGENT INVENTORY]: Failed to create folder for user {0} {1}",
remoteClient.Name, remoteClient.AgentId);
}
}
示例9: SendInventoryUpdate
/// <summary>
/// Send an update to the client about the given folder
/// </summary>
/// <param name="client">The client to send the update to</param>
/// <param name="folder">The folder that we need to send</param>
/// <param name="fetchFolders">Should we fetch folders inside of this folder</param>
/// <param name="fetchItems">Should we fetch items inside of this folder</param>
protected void SendInventoryUpdate(IClientAPI client, InventoryFolderBase folder, bool fetchFolders, bool fetchItems)
{
if (folder == null)
return;
// Fetch the folder contents
InventoryCollection contents = m_scene.InventoryService.GetFolderContent(client.AgentId, folder.ID);
// Fetch the folder itself to get its current version
InventoryFolderBase containingFolder = new InventoryFolderBase(folder.ID, client.AgentId);
containingFolder = m_scene.InventoryService.GetFolder(containingFolder);
//MainConsole.Instance.DebugFormat("[AGENT INVENTORY]: Sending inventory folder contents ({0} nodes) for \"{1}\" to {2} {3}",
// contents.Folders.Count + contents.Items.Count, containingFolder.Name, client.FirstName, client.LastName);
if (containingFolder != null)
client.SendInventoryFolderDetails(client.AgentId, folder.ID, contents.Items, contents.Folders, containingFolder.Version, fetchFolders, fetchItems);
}
示例10: NewFolder
private void NewFolder(UUID userID, string newFolderName, string folder)
{
UUID folderID = UUID.Zero;
if (UUID.TryParse(folder, out folderID))
{
InventoryFolderBase fbase = new InventoryFolderBase(UUID.Random(), newFolderName, userID, folderID);
fbase.Type = (short)AssetType.Folder;
m_InventoryService.AddFolder(fbase);
}
}
示例11: Delete
private void Delete(UUID userID, List<string> nodes, List<string> types)
{
List<UUID> items = new List<UUID>();
List<UUID> folders = new List<UUID>();
SplitNodes(userID, nodes, types, items, folders);
var trash = m_InventoryService.GetFolderForType(userID, InventoryType.Folder, AssetType.TrashFolder);
if (trash != null)
{
List<InventoryItemBase> its = new List<InventoryItemBase>();
foreach (UUID uuid in items)
{
InventoryItemBase itbase = new InventoryItemBase();
itbase.ID = uuid;
itbase.Folder = UUID.Zero;
its.Add(itbase);
}
m_InventoryService.MoveItems(userID, its);
bool purgeTrash = false;
foreach (UUID uuid in folders)
{
InventoryFolderBase fbase = new InventoryFolderBase(uuid, userID);
//if (uuid == trash)
// purgeTrash = true;
//else
{
fbase.ParentID = UUID.Zero;
m_InventoryService.MoveFolder(fbase);
}
}
if (purgeTrash)
{
InventoryFolderBase fbase = new InventoryFolderBase(UUID.Zero, userID);
m_InventoryService.PurgeFolder(fbase);
}
}
}
示例12: CreateArchiveFolderName
///<summary>
/// Create the archive name for a particular folder.
///</summary>
///These names are prepended with an inventory folder's UUID so that more than one folder can have the
///same name
///<param name = "folder"></param>
///<returns></returns>
public static string CreateArchiveFolderName(InventoryFolderBase folder)
{
return CreateArchiveFolderName(folder.Name, folder.ID);
}
示例13: PurgeFolder
/// <summary>
/// Purge an inventory folder of all its items and subfolders.
/// </summary>
/// <param name = "folder"></param>
/// <returns>true if the folder was successfully purged</returns>
public bool PurgeFolder(InventoryFolderBase folder)
{
NameValueCollection requestArgs = new NameValueCollection
{
{"RequestMethod", "PurgeInventoryFolder"},
{"OwnerID", folder.Owner.ToString()},
{"FolderID", folder.ID.ToString()}
};
OSDMap response = WebUtils.PostToService(m_serverUrl, requestArgs);
bool success = response["Success"].AsBoolean();
if (!success)
{
MainConsole.Instance.Warn("[SIMIAN INVENTORY CONNECTOR]: Error purging folder " + folder.ID + " for " + folder.Owner +
": " +
response["Message"].AsString());
}
return success;
}
示例14: GetFolder
/// <summary>
/// Get a folder, given by its UUID
/// </summary>
/// <param name = "folder"></param>
/// <returns></returns>
public InventoryFolderBase GetFolder(InventoryFolderBase folder)
{
NameValueCollection requestArgs = new NameValueCollection
{
{"RequestMethod", "GetInventoryNode"},
{"ItemID", folder.ID.ToString()},
{"OwnerID", folder.Owner.ToString()},
{"IncludeFolders", "1"},
{"IncludeItems", "0"},
{"ChildrenOnly", "1"}
};
OSDMap response = WebUtils.PostToService(m_serverUrl, requestArgs);
if (response["Success"].AsBoolean() && response["Items"] is OSDArray)
{
OSDArray items = (OSDArray) response["Items"];
List<InventoryFolderBase> folders = GetFoldersFromResponse(items, folder.ID, true);
if (folders.Count > 0)
return folders[0];
}
return null;
}
示例15: AddFolder
/// <summary>
/// Add a new folder to the user's inventory
/// </summary>
/// <param name = "folder"></param>
/// <returns>true if the folder was successfully added</returns>
public bool AddFolder(InventoryFolderBase folder)
{
NameValueCollection requestArgs = new NameValueCollection
{
{"RequestMethod", "AddInventoryFolder"},
{"FolderID", folder.ID.ToString()},
{"ParentID", folder.ParentID.ToString()},
{"OwnerID", folder.Owner.ToString()},
{"Name", folder.Name},
{"ContentType", SLUtil.SLAssetTypeToContentType(folder.Type)}
};
OSDMap response = WebUtils.PostToService(m_serverUrl, requestArgs);
bool success = response["Success"].AsBoolean();
if (!success)
{
MainConsole.Instance.Warn("[SIMIAN INVENTORY CONNECTOR]: Error creating folder " + folder.Name + " for " + folder.Owner +
": " +
response["Message"].AsString());
}
return success;
}