mirror of
https://github.com/opensim/opensim.git
synced 2026-08-10 19:36:07 +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:
@@ -26,37 +26,34 @@
|
||||
*
|
||||
*/
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Reflection;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using OpenGrid.Framework.Data;
|
||||
using libsecondlife;
|
||||
using System.Reflection;
|
||||
|
||||
using System.Xml;
|
||||
using Nwc.XmlRpc;
|
||||
using OpenSim.Framework.Sims;
|
||||
using OpenSim.Framework.Inventory;
|
||||
using OpenSim.Framework.Console;
|
||||
using OpenSim.Framework.Utilities;
|
||||
using OpenSim.Framework.Data;
|
||||
using InventoryCategory = OpenSim.Framework.Data.InventoryCategory;
|
||||
|
||||
using System.Security.Cryptography;
|
||||
|
||||
namespace OpenGridServices.InventoryServer
|
||||
namespace OpenSim.Grid.InventoryServer
|
||||
{
|
||||
class InventoryManager
|
||||
class InventoryManager : IInventoryData
|
||||
{
|
||||
Dictionary<string, IInventoryData> _plugins = new Dictionary<string, IInventoryData>();
|
||||
IInventoryData _databasePlugin;
|
||||
|
||||
/// <summary>
|
||||
/// Adds a new inventory server plugin - user servers will be requested in the order they were loaded.
|
||||
/// </summary>
|
||||
/// <param name="FileName">The filename to the inventory server plugin DLL</param>
|
||||
public void AddPlugin(string FileName)
|
||||
public void AddDatabasePlugin(string FileName)
|
||||
{
|
||||
OpenSim.Framework.Console.MainConsole.Instance.Verbose( "Invenstorage: Attempting to load " + FileName);
|
||||
MainLog.Instance.Verbose(OpenInventory_Main.MainLogName, "Invenstorage: Attempting to load " + FileName);
|
||||
Assembly pluginAssembly = Assembly.LoadFrom(FileName);
|
||||
|
||||
OpenSim.Framework.Console.MainConsole.Instance.Verbose( "Invenstorage: Found " + pluginAssembly.GetTypes().Length + " interfaces.");
|
||||
MainLog.Instance.Verbose(OpenInventory_Main.MainLogName, "Invenstorage: Found " + pluginAssembly.GetTypes().Length + " interfaces.");
|
||||
foreach (Type pluginType in pluginAssembly.GetTypes())
|
||||
{
|
||||
if (!pluginType.IsAbstract)
|
||||
@@ -67,8 +64,9 @@ namespace OpenGridServices.InventoryServer
|
||||
{
|
||||
IInventoryData plug = (IInventoryData)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
|
||||
plug.Initialise();
|
||||
this._plugins.Add(plug.getName(), plug);
|
||||
OpenSim.Framework.Console.MainConsole.Instance.Verbose( "Invenstorage: Added IUserData Interface");
|
||||
_databasePlugin = plug;
|
||||
MainLog.Instance.Verbose(OpenInventory_Main.MainLogName, "Invenstorage: Added IInventoryData Interface");
|
||||
break;
|
||||
}
|
||||
|
||||
typeInterface = null;
|
||||
@@ -80,46 +78,87 @@ namespace OpenGridServices.InventoryServer
|
||||
|
||||
public List<InventoryFolderBase> getRootFolders(LLUUID user)
|
||||
{
|
||||
foreach (KeyValuePair<string, IInventoryData> kvp in _plugins)
|
||||
{
|
||||
try
|
||||
{
|
||||
return kvp.Value.getUserRootFolders(user);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
OpenSim.Framework.Console.MainConsole.Instance.Notice("Unable to get root folders via " + kvp.Key + " (" + e.ToString() + ")");
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public XmlRpcResponse XmlRpcInventoryRequest(XmlRpcRequest request)
|
||||
#region IInventoryData Members
|
||||
|
||||
|
||||
public List<InventoryItemBase> getInventoryInFolder(LLUUID folderID)
|
||||
{
|
||||
XmlRpcResponse response = new XmlRpcResponse();
|
||||
Hashtable requestData = (Hashtable)request.Params[0];
|
||||
|
||||
Hashtable responseData = new Hashtable();
|
||||
|
||||
// Stuff happens here
|
||||
|
||||
if (requestData.ContainsKey("Access-type"))
|
||||
{
|
||||
if (requestData["access-type"] == "rootfolders")
|
||||
{
|
||||
// responseData["rootfolders"] =
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
responseData["error"] = "No access-type specified.";
|
||||
}
|
||||
|
||||
|
||||
// Stuff stops happening here
|
||||
|
||||
response.Value = responseData;
|
||||
return response;
|
||||
return _databasePlugin.getInventoryInFolder(folderID);
|
||||
}
|
||||
|
||||
public List<InventoryFolderBase> getUserRootFolders(LLUUID user)
|
||||
{
|
||||
return _databasePlugin.getUserRootFolders(user);
|
||||
}
|
||||
|
||||
public List<InventoryFolderBase> getInventoryFolders(LLUUID parentID)
|
||||
{
|
||||
return _databasePlugin.getInventoryFolders(parentID);
|
||||
}
|
||||
|
||||
public InventoryItemBase getInventoryItem(LLUUID item)
|
||||
{
|
||||
throw new Exception("The method or operation is not implemented.");
|
||||
}
|
||||
|
||||
public InventoryFolderBase getInventoryFolder(LLUUID folder)
|
||||
{
|
||||
return _databasePlugin.getInventoryFolder(folder);
|
||||
}
|
||||
|
||||
public void addInventoryItem(InventoryItemBase item)
|
||||
{
|
||||
_databasePlugin.addInventoryItem(item);
|
||||
}
|
||||
|
||||
public void updateInventoryItem(InventoryItemBase item)
|
||||
{
|
||||
throw new Exception("The method or operation is not implemented.");
|
||||
}
|
||||
|
||||
public void deleteInventoryItem(InventoryItemBase item)
|
||||
{
|
||||
throw new Exception("The method or operation is not implemented.");
|
||||
}
|
||||
|
||||
public void addInventoryFolder(InventoryFolderBase folder)
|
||||
{
|
||||
_databasePlugin.addInventoryFolder(folder);
|
||||
}
|
||||
|
||||
public void updateInventoryFolder(InventoryFolderBase folder)
|
||||
{
|
||||
throw new Exception("The method or operation is not implemented.");
|
||||
}
|
||||
|
||||
public void Initialise()
|
||||
{
|
||||
throw new Exception("The method or operation is not implemented.");
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
throw new Exception("The method or operation is not implemented.");
|
||||
}
|
||||
|
||||
public string getName()
|
||||
{
|
||||
throw new Exception("The method or operation is not implemented.");
|
||||
}
|
||||
|
||||
public string getVersion()
|
||||
{
|
||||
throw new Exception("The method or operation is not implemented.");
|
||||
}
|
||||
|
||||
public void deleteInventoryCategory(InventoryCategory inventoryCategory)
|
||||
{
|
||||
_databasePlugin.deleteInventoryCategory(inventoryCategory);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user