And the avatar services :)

viewer-2-initial-appearance
Melanie 2010-09-05 17:53:15 +01:00
parent a407ad38f6
commit 1238b27d64
1 changed files with 22 additions and 12 deletions

View File

@ -56,6 +56,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
// private static string ZeroID = UUID.Zero.ToString(); // private static string ZeroID = UUID.Zero.ToString();
private string m_serverUrl = String.Empty; private string m_serverUrl = String.Empty;
private bool m_Enabled = false;
#region ISharedRegionModule #region ISharedRegionModule
@ -66,8 +67,8 @@ namespace OpenSim.Services.Connectors.SimianGrid
public SimianAvatarServiceConnector() { } public SimianAvatarServiceConnector() { }
public string Name { get { return "SimianAvatarServiceConnector"; } } public string Name { get { return "SimianAvatarServiceConnector"; } }
public void AddRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.RegisterModuleInterface<IAvatarService>(this); } } public void AddRegion(Scene scene) { if (m_Enabled) { scene.RegisterModuleInterface<IAvatarService>(this); } }
public void RemoveRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.UnregisterModuleInterface<IAvatarService>(this); } } public void RemoveRegion(Scene scene) { if (m_Enabled) { scene.UnregisterModuleInterface<IAvatarService>(this); } }
#endregion ISharedRegionModule #endregion ISharedRegionModule
@ -78,20 +79,29 @@ namespace OpenSim.Services.Connectors.SimianGrid
public void Initialise(IConfigSource source) public void Initialise(IConfigSource source)
{ {
IConfig gridConfig = source.Configs["AvatarService"]; IConfig moduleConfig = source.Configs["Modules"];
if (gridConfig != null) if (moduleConfig != null)
{ {
string serviceUrl = gridConfig.GetString("AvatarServerURI"); string name = moduleConfig.GetString("AssetServices", "");
if (!String.IsNullOrEmpty(serviceUrl)) if (name == Name)
{ {
if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("=")) IConfig gridConfig = source.Configs["AvatarService"];
serviceUrl = serviceUrl + '/'; if (gridConfig != null)
m_serverUrl = serviceUrl; {
string serviceUrl = gridConfig.GetString("AvatarServerURI");
if (!String.IsNullOrEmpty(serviceUrl))
{
if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("="))
serviceUrl = serviceUrl + '/';
m_serverUrl = serviceUrl;
m_Enabled = true;
}
}
if (String.IsNullOrEmpty(m_serverUrl))
m_log.Info("[SIMIAN AVATAR CONNECTOR]: No AvatarServerURI specified, disabling connector");
} }
} }
if (String.IsNullOrEmpty(m_serverUrl))
m_log.Info("[SIMIAN AVATAR CONNECTOR]: No AvatarServerURI specified, disabling connector");
} }
#region IAvatarService #region IAvatarService