Fix up Simian inentory

viewer-2-initial-appearance
Melanie 2010-09-05 18:14:31 +01:00
parent b2486df67c
commit 0ca48b2486
1 changed files with 30 additions and 18 deletions

View File

@ -70,6 +70,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
private string m_serverUrl = String.Empty; private string m_serverUrl = String.Empty;
private string m_userServerUrl = String.Empty; private string m_userServerUrl = String.Empty;
// private object m_gestureSyncRoot = new object(); // private object m_gestureSyncRoot = new object();
private bool m_Enabled = false;
#region ISharedRegionModule #region ISharedRegionModule
@ -80,8 +81,8 @@ namespace OpenSim.Services.Connectors.SimianGrid
public SimianInventoryServiceConnector() { } public SimianInventoryServiceConnector() { }
public string Name { get { return "SimianInventoryServiceConnector"; } } public string Name { get { return "SimianInventoryServiceConnector"; } }
public void AddRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.RegisterModuleInterface<IInventoryService>(this); } } public void AddRegion(Scene scene) { if (m_Enabled) { scene.RegisterModuleInterface<IInventoryService>(this); } }
public void RemoveRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.UnregisterModuleInterface<IInventoryService>(this); } } public void RemoveRegion(Scene scene) { if (m_Enabled) { scene.UnregisterModuleInterface<IInventoryService>(this); } }
#endregion ISharedRegionModule #endregion ISharedRegionModule
@ -91,6 +92,12 @@ namespace OpenSim.Services.Connectors.SimianGrid
} }
public void Initialise(IConfigSource source) public void Initialise(IConfigSource source)
{
IConfig moduleConfig = source.Configs["Modules"];
if (moduleConfig != null)
{
string name = moduleConfig.GetString("AssetServices", "");
if (name == Name)
{ {
IConfig gridConfig = source.Configs["InventoryService"]; IConfig gridConfig = source.Configs["InventoryService"];
if (gridConfig != null) if (gridConfig != null)
@ -107,7 +114,10 @@ namespace OpenSim.Services.Connectors.SimianGrid
{ {
serviceUrl = gridConfig.GetString("UserAccountServerURI"); serviceUrl = gridConfig.GetString("UserAccountServerURI");
if (!String.IsNullOrEmpty(serviceUrl)) if (!String.IsNullOrEmpty(serviceUrl))
{
m_userServerUrl = serviceUrl; m_userServerUrl = serviceUrl;
m_Enabled = true;
}
} }
} }
} }
@ -117,6 +127,8 @@ namespace OpenSim.Services.Connectors.SimianGrid
else if (String.IsNullOrEmpty(m_userServerUrl)) else if (String.IsNullOrEmpty(m_userServerUrl))
m_log.Info("[SIMIAN INVENTORY CONNECTOR]: No UserAccountServerURI specified, disabling connector"); m_log.Info("[SIMIAN INVENTORY CONNECTOR]: No UserAccountServerURI specified, disabling connector");
} }
}
}
/// <summary> /// <summary>
/// Create the entire inventory for a given user /// Create the entire inventory for a given user