Merge branch 'master' into careminster-presence-refactor

avinationmerge
Melanie 2010-09-05 19:15:49 +01:00
commit b9c20fbaa7
9 changed files with 180 additions and 110 deletions

View File

@ -55,6 +55,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
private string m_serverUrl = String.Empty;
private IImprovedAssetCache m_cache;
private bool m_Enabled = false;
#region ISharedRegionModule
@ -73,8 +74,8 @@ namespace OpenSim.Services.Connectors.SimianGrid
public SimianAssetServiceConnector() { }
public string Name { get { return "SimianAssetServiceConnector"; } }
public void AddRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.RegisterModuleInterface<IAssetService>(this); } }
public void RemoveRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.UnregisterModuleInterface<IAssetService>(this); } }
public void AddRegion(Scene scene) { if (m_Enabled) { scene.RegisterModuleInterface<IAssetService>(this); } }
public void RemoveRegion(Scene scene) { if (m_Enabled) { scene.UnregisterModuleInterface<IAssetService>(this); } }
#endregion ISharedRegionModule
@ -85,20 +86,30 @@ namespace OpenSim.Services.Connectors.SimianGrid
public void Initialise(IConfigSource source)
{
IConfig gridConfig = source.Configs["AssetService"];
if (gridConfig != null)
IConfig moduleConfig = source.Configs["Modules"];
if (moduleConfig != null)
{
string serviceUrl = gridConfig.GetString("AssetServerURI");
if (!String.IsNullOrEmpty(serviceUrl))
string name = moduleConfig.GetString("AssetServices", "");
if (name == Name)
{
if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("="))
serviceUrl = serviceUrl + '/';
m_serverUrl = serviceUrl;
IConfig gridConfig = source.Configs["AssetService"];
if (gridConfig != null)
{
string serviceUrl = gridConfig.GetString("AssetServerURI");
if (!String.IsNullOrEmpty(serviceUrl))
{
if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("="))
serviceUrl = serviceUrl + '/';
m_serverUrl = serviceUrl;
}
}
if (String.IsNullOrEmpty(m_serverUrl))
m_log.Info("[SIMIAN ASSET CONNECTOR]: No AssetServerURI specified, disabling connector");
else
m_Enabled = true;
}
}
if (String.IsNullOrEmpty(m_serverUrl))
m_log.Info("[SIMIAN ASSET CONNECTOR]: No AssetServerURI specified, disabling connector");
}
#region IAssetService

View File

@ -51,6 +51,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
MethodBase.GetCurrentMethod().DeclaringType);
private string m_serverUrl = String.Empty;
private bool m_Enabled = false;
#region ISharedRegionModule
@ -61,8 +62,8 @@ namespace OpenSim.Services.Connectors.SimianGrid
public SimianAuthenticationServiceConnector() { }
public string Name { get { return "SimianAuthenticationServiceConnector"; } }
public void AddRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.RegisterModuleInterface<IAuthenticationService>(this); } }
public void RemoveRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.UnregisterModuleInterface<IAuthenticationService>(this); } }
public void AddRegion(Scene scene) { if (m_Enabled) { scene.RegisterModuleInterface<IAuthenticationService>(this); } }
public void RemoveRegion(Scene scene) { if (m_Enabled) { scene.UnregisterModuleInterface<IAuthenticationService>(this); } }
#endregion ISharedRegionModule
@ -73,20 +74,29 @@ namespace OpenSim.Services.Connectors.SimianGrid
public void Initialise(IConfigSource source)
{
IConfig gridConfig = source.Configs["AuthenticationService"];
if (gridConfig != null)
IConfig moduleConfig = source.Configs["Modules"];
if (moduleConfig != null)
{
string serviceUrl = gridConfig.GetString("AuthenticationServerURI");
if (!String.IsNullOrEmpty(serviceUrl))
string name = moduleConfig.GetString("AuthenticationServices", "");
if (name == Name)
{
if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("="))
serviceUrl = serviceUrl + '/';
m_serverUrl = serviceUrl;
IConfig gridConfig = source.Configs["AuthenticationService"];
if (gridConfig != null)
{
string serviceUrl = gridConfig.GetString("AuthenticationServerURI");
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 AUTH CONNECTOR]: No AuthenticationServerURI specified, disabling connector");
}
}
if (String.IsNullOrEmpty(m_serverUrl))
m_log.Info("[SIMIAN AUTH CONNECTOR]: No AuthenticationServerURI specified, disabling connector");
}
public string Authenticate(UUID principalID, string password, int lifetime)

View File

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

View File

@ -46,8 +46,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
/// <summary>
/// Stores and retrieves friend lists from the SimianGrid backend
/// </summary>
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
public class SimianFriendsServiceConnector : IFriendsService, ISharedRegionModule
public class SimianFriendsServiceConnector : IFriendsService
{
private static readonly ILog m_log =
LogManager.GetLogger(
@ -55,20 +54,6 @@ namespace OpenSim.Services.Connectors.SimianGrid
private string m_serverUrl = String.Empty;
#region ISharedRegionModule
public Type ReplaceableInterface { get { return null; } }
public void RegionLoaded(Scene scene) { }
public void PostInitialise() { }
public void Close() { }
public SimianFriendsServiceConnector() { }
public string Name { get { return "SimianFriendsServiceConnector"; } }
public void AddRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.RegisterModuleInterface<IFriendsService>(this); } }
public void RemoveRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.UnregisterModuleInterface<IFriendsService>(this); } }
#endregion ISharedRegionModule
public SimianFriendsServiceConnector(IConfigSource source)
{
Initialise(source);

View File

@ -60,6 +60,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
private string m_serverUrl = String.Empty;
private Dictionary<UUID, Scene> m_scenes = new Dictionary<UUID, Scene>();
private bool m_Enabled = false;
#region ISharedRegionModule
@ -72,21 +73,25 @@ namespace OpenSim.Services.Connectors.SimianGrid
public string Name { get { return "SimianGridServiceConnector"; } }
public void AddRegion(Scene scene)
{
if (!m_Enabled)
return;
// Every shared region module has to maintain an indepedent list of
// currently running regions
lock (m_scenes)
m_scenes[scene.RegionInfo.RegionID] = scene;
if (!String.IsNullOrEmpty(m_serverUrl))
scene.RegisterModuleInterface<IGridService>(this);
scene.RegisterModuleInterface<IGridService>(this);
}
public void RemoveRegion(Scene scene)
{
if (!m_Enabled)
return;
lock (m_scenes)
m_scenes.Remove(scene.RegionInfo.RegionID);
if (!String.IsNullOrEmpty(m_serverUrl))
scene.UnregisterModuleInterface<IGridService>(this);
scene.UnregisterModuleInterface<IGridService>(this);
}
#endregion ISharedRegionModule
@ -98,20 +103,29 @@ namespace OpenSim.Services.Connectors.SimianGrid
public void Initialise(IConfigSource source)
{
IConfig gridConfig = source.Configs["GridService"];
if (gridConfig != null)
IConfig moduleConfig = source.Configs["Modules"];
if (moduleConfig != null)
{
string serviceUrl = gridConfig.GetString("GridServerURI");
if (!String.IsNullOrEmpty(serviceUrl))
string name = moduleConfig.GetString("GridServices", "");
if (name == Name)
{
if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("="))
serviceUrl = serviceUrl + '/';
m_serverUrl = serviceUrl;
IConfig gridConfig = source.Configs["GridService"];
if (gridConfig != null)
{
string serviceUrl = gridConfig.GetString("GridServerURI");
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 GRID CONNECTOR]: No GridServerURI specified, disabling connector");
}
}
if (String.IsNullOrEmpty(m_serverUrl))
m_log.Info("[SIMIAN GRID CONNECTOR]: No GridServerURI specified, disabling connector");
}
#region IGridService

View File

@ -70,6 +70,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
private string m_serverUrl = String.Empty;
private string m_userServerUrl = String.Empty;
// private object m_gestureSyncRoot = new object();
private bool m_Enabled = false;
#region ISharedRegionModule
@ -80,8 +81,8 @@ namespace OpenSim.Services.Connectors.SimianGrid
public SimianInventoryServiceConnector() { }
public string Name { get { return "SimianInventoryServiceConnector"; } }
public void AddRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.RegisterModuleInterface<IInventoryService>(this); } }
public void RemoveRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.UnregisterModuleInterface<IInventoryService>(this); } }
public void AddRegion(Scene scene) { if (m_Enabled) { scene.RegisterModuleInterface<IInventoryService>(this); } }
public void RemoveRegion(Scene scene) { if (m_Enabled) { scene.UnregisterModuleInterface<IInventoryService>(this); } }
#endregion ISharedRegionModule
@ -92,30 +93,41 @@ namespace OpenSim.Services.Connectors.SimianGrid
public void Initialise(IConfigSource source)
{
IConfig gridConfig = source.Configs["InventoryService"];
if (gridConfig != null)
IConfig moduleConfig = source.Configs["Modules"];
if (moduleConfig != null)
{
string serviceUrl = gridConfig.GetString("InventoryServerURI");
if (!String.IsNullOrEmpty(serviceUrl))
string name = moduleConfig.GetString("InventoryServices", "");
if (name == Name)
{
if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("="))
serviceUrl = serviceUrl + '/';
m_serverUrl = serviceUrl;
gridConfig = source.Configs["UserAccountService"];
IConfig gridConfig = source.Configs["InventoryService"];
if (gridConfig != null)
{
serviceUrl = gridConfig.GetString("UserAccountServerURI");
string serviceUrl = gridConfig.GetString("InventoryServerURI");
if (!String.IsNullOrEmpty(serviceUrl))
m_userServerUrl = serviceUrl;
{
if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("="))
serviceUrl = serviceUrl + '/';
m_serverUrl = serviceUrl;
gridConfig = source.Configs["UserAccountService"];
if (gridConfig != null)
{
serviceUrl = gridConfig.GetString("UserAccountServerURI");
if (!String.IsNullOrEmpty(serviceUrl))
{
m_userServerUrl = serviceUrl;
m_Enabled = true;
}
}
}
}
if (String.IsNullOrEmpty(m_serverUrl))
m_log.Info("[SIMIAN INVENTORY CONNECTOR]: No InventoryServerURI specified, disabling connector");
else if (String.IsNullOrEmpty(m_userServerUrl))
m_log.Info("[SIMIAN INVENTORY CONNECTOR]: No UserAccountServerURI specified, disabling connector");
}
}
if (String.IsNullOrEmpty(m_serverUrl))
m_log.Info("[SIMIAN INVENTORY CONNECTOR]: No InventoryServerURI specified, disabling connector");
else if (String.IsNullOrEmpty(m_userServerUrl))
m_log.Info("[SIMIAN INVENTORY CONNECTOR]: No UserAccountServerURI specified, disabling connector");
}
/// <summary>

View File

@ -59,6 +59,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
private string m_serverUrl = String.Empty;
private SimianActivityDetector m_activityDetector;
private bool m_Enabled = false;
#region ISharedRegionModule
@ -71,7 +72,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
public string Name { get { return "SimianPresenceServiceConnector"; } }
public void AddRegion(Scene scene)
{
if (!String.IsNullOrEmpty(m_serverUrl))
if (m_Enabled)
{
scene.RegisterModuleInterface<IPresenceService>(this);
scene.RegisterModuleInterface<IGridUserService>(this);
@ -83,7 +84,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
}
public void RemoveRegion(Scene scene)
{
if (!String.IsNullOrEmpty(m_serverUrl))
if (m_Enabled)
{
scene.UnregisterModuleInterface<IPresenceService>(this);
scene.UnregisterModuleInterface<IGridUserService>(this);
@ -103,20 +104,29 @@ namespace OpenSim.Services.Connectors.SimianGrid
public void Initialise(IConfigSource source)
{
IConfig gridConfig = source.Configs["PresenceService"];
if (gridConfig != null)
IConfig moduleConfig = source.Configs["Modules"];
if (moduleConfig != null)
{
string serviceUrl = gridConfig.GetString("PresenceServerURI");
if (!String.IsNullOrEmpty(serviceUrl))
string name = moduleConfig.GetString("PresenceServices", "");
if (name == Name)
{
if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("="))
serviceUrl = serviceUrl + '/';
m_serverUrl = serviceUrl;
IConfig gridConfig = source.Configs["PresenceService"];
if (gridConfig != null)
{
string serviceUrl = gridConfig.GetString("PresenceServerURI");
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 PRESENCE CONNECTOR]: No PresenceServerURI specified, disabling connector");
}
}
if (String.IsNullOrEmpty(m_serverUrl))
m_log.Info("[SIMIAN PRESENCE CONNECTOR]: No PresenceServerURI specified, disabling connector");
}
#region IPresenceService

View File

@ -67,6 +67,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
MethodBase.GetCurrentMethod().DeclaringType);
private string m_serverUrl = String.Empty;
private bool m_Enabled = false;
#region INonSharedRegionModule
@ -76,8 +77,8 @@ namespace OpenSim.Services.Connectors.SimianGrid
public SimianProfiles() { }
public string Name { get { return "SimianProfiles"; } }
public void AddRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { CheckEstateManager(scene); scene.EventManager.OnClientConnect += ClientConnectHandler; } }
public void RemoveRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.EventManager.OnClientConnect -= ClientConnectHandler; } }
public void AddRegion(Scene scene) { if (m_Enabled) { CheckEstateManager(scene); scene.EventManager.OnClientConnect += ClientConnectHandler; } }
public void RemoveRegion(Scene scene) { if (m_Enabled) { scene.EventManager.OnClientConnect -= ClientConnectHandler; } }
#endregion INonSharedRegionModule
@ -88,6 +89,13 @@ namespace OpenSim.Services.Connectors.SimianGrid
public void Initialise(IConfigSource source)
{
IConfig profileConfig = source.Configs["Profile"];
if (profileConfig == null)
return;
if (profileConfig.GetString("Module", String.Empty) != Name)
return;
IConfig gridConfig = source.Configs["UserAccountService"];
if (gridConfig != null)
{

View File

@ -55,6 +55,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
private string m_serverUrl = String.Empty;
private ExpiringCache<UUID, UserAccount> m_accountCache;
private bool m_Enabled = false;
#region ISharedRegionModule
@ -65,8 +66,8 @@ namespace OpenSim.Services.Connectors.SimianGrid
public SimianUserAccountServiceConnector() { }
public string Name { get { return "SimianUserAccountServiceConnector"; } }
public void AddRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.RegisterModuleInterface<IUserAccountService>(this); } }
public void RemoveRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.UnregisterModuleInterface<IUserAccountService>(this); } }
public void AddRegion(Scene scene) { if (m_Enabled) { scene.RegisterModuleInterface<IUserAccountService>(this); } }
public void RemoveRegion(Scene scene) { if (m_Enabled) { scene.UnregisterModuleInterface<IUserAccountService>(this); } }
#endregion ISharedRegionModule
@ -77,20 +78,29 @@ namespace OpenSim.Services.Connectors.SimianGrid
public void Initialise(IConfigSource source)
{
IConfig gridConfig = source.Configs["UserAccountService"];
if (gridConfig != null)
IConfig moduleConfig = source.Configs["Modules"];
if (moduleConfig != null)
{
string serviceUrl = gridConfig.GetString("UserAccountServerURI");
if (!String.IsNullOrEmpty(serviceUrl))
string name = moduleConfig.GetString("UserAccountServices", "");
if (name == Name)
{
if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("="))
serviceUrl = serviceUrl + '/';
m_serverUrl = serviceUrl;
IConfig gridConfig = source.Configs["UserAccountService"];
if (gridConfig != null)
{
string serviceUrl = gridConfig.GetString("UserAccountServerURI");
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 ACCOUNT CONNECTOR]: No UserAccountServerURI specified, disabling connector");
}
}
if (String.IsNullOrEmpty(m_serverUrl))
m_log.Info("[SIMIAN ACCOUNT CONNECTOR]: No UserAccountServerURI specified, disabling connector");
}
public UserAccount GetUserAccount(UUID scopeID, string firstName, string lastName)