mirror of
https://github.com/opensim/opensim.git
synced 2026-07-07 13:15:47 +08:00
* Tleiades grid mode inventory (#444) - thanx Tleiades!
* updated to rev 1413 on libsecondlife.dll and libsecondlife.dll.config (#423)
This commit is contained in:
@@ -132,7 +132,7 @@ namespace OpenSim.Framework.Data.MySQL
|
||||
param["?uuid"] = user.ToStringHyphenated();
|
||||
param["?zero"] = LLUUID.Zero.ToStringHyphenated();
|
||||
|
||||
IDbCommand result = database.Query("SELECT * FROM inventoryfolders WHERE parentFolderID = ?zero AND agentID = ?uuid", param);
|
||||
IDbCommand result = database.Query("SELECT * FROM inventoryfolders WHERE parentFolderID = ?zero AND (agentID = ?uuid OR category = 0)", param);
|
||||
IDataReader reader = result.ExecuteReader();
|
||||
|
||||
List<InventoryFolderBase> items = database.readInventoryFolders(reader);
|
||||
@@ -151,40 +151,6 @@ namespace OpenSim.Framework.Data.MySQL
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the users inventory root folder.
|
||||
/// </summary>
|
||||
/// <param name="user"></param>
|
||||
/// <returns></returns>
|
||||
public InventoryFolderBase getUserRootFolder(LLUUID user)
|
||||
{
|
||||
try
|
||||
{
|
||||
lock (database)
|
||||
{
|
||||
Dictionary<string, string> param = new Dictionary<string, string>();
|
||||
param["?uuid"] = user.ToStringHyphenated();
|
||||
param["?zero"] = LLUUID.Zero.ToStringHyphenated();
|
||||
|
||||
IDbCommand result = database.Query("SELECT * FROM inventoryfolders WHERE parentFolderID = ?zero AND agentID = ?uuid", param);
|
||||
IDataReader reader = result.ExecuteReader();
|
||||
|
||||
List<InventoryFolderBase> items = database.readInventoryFolders(reader);
|
||||
InventoryFolderBase rootFolder = items[0]; //should only be one folder with parent set to zero (the root one).
|
||||
reader.Close();
|
||||
result.Dispose();
|
||||
|
||||
return rootFolder;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
database.Reconnect();
|
||||
Console.WriteLine(e.ToString());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a list of folders in a users inventory contained within the specified folder
|
||||
/// </summary>
|
||||
@@ -348,5 +314,27 @@ namespace OpenSim.Framework.Data.MySQL
|
||||
{
|
||||
addInventoryFolder(folder);
|
||||
}
|
||||
|
||||
public void deleteInventoryCategory(InventoryCategory inventoryCategory)
|
||||
{
|
||||
try
|
||||
{
|
||||
lock (database) {
|
||||
IDbCommand cmd = database.Query(string.Format("DELETE FROM inventoryitems WHERE parentFolderID IN (SELECT folderId FROM inventoryfolders WHERE category={0})", (byte)inventoryCategory), null);
|
||||
cmd.ExecuteNonQuery();
|
||||
|
||||
|
||||
cmd = database.Query(string.Format("DELETE FROM inventoryfolders WHERE category={0}", (byte)inventoryCategory), null);
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
database.Reconnect();
|
||||
Console.WriteLine(e.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user