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 string m_serverUrl = String.Empty;
private IImprovedAssetCache m_cache; private IImprovedAssetCache m_cache;
private bool m_Enabled = false;
#region ISharedRegionModule #region ISharedRegionModule
@ -73,8 +74,8 @@ namespace OpenSim.Services.Connectors.SimianGrid
public SimianAssetServiceConnector() { } public SimianAssetServiceConnector() { }
public string Name { get { return "SimianAssetServiceConnector"; } } public string Name { get { return "SimianAssetServiceConnector"; } }
public void AddRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.RegisterModuleInterface<IAssetService>(this); } } public void AddRegion(Scene scene) { if (m_Enabled) { scene.RegisterModuleInterface<IAssetService>(this); } }
public void RemoveRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.UnregisterModuleInterface<IAssetService>(this); } } public void RemoveRegion(Scene scene) { if (m_Enabled) { scene.UnregisterModuleInterface<IAssetService>(this); } }
#endregion ISharedRegionModule #endregion ISharedRegionModule
@ -84,6 +85,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["AssetService"]; IConfig gridConfig = source.Configs["AssetService"];
if (gridConfig != null) if (gridConfig != null)
@ -99,6 +106,10 @@ namespace OpenSim.Services.Connectors.SimianGrid
if (String.IsNullOrEmpty(m_serverUrl)) if (String.IsNullOrEmpty(m_serverUrl))
m_log.Info("[SIMIAN ASSET CONNECTOR]: No AssetServerURI specified, disabling connector"); m_log.Info("[SIMIAN ASSET CONNECTOR]: No AssetServerURI specified, disabling connector");
else
m_Enabled = true;
}
}
} }
#region IAssetService #region IAssetService

View File

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

View File

@ -46,8 +46,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
/// <summary> /// <summary>
/// Stores and retrieves friend lists from the SimianGrid backend /// Stores and retrieves friend lists from the SimianGrid backend
/// </summary> /// </summary>
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] public class SimianFriendsServiceConnector : IFriendsService
public class SimianFriendsServiceConnector : IFriendsService, ISharedRegionModule
{ {
private static readonly ILog m_log = private static readonly ILog m_log =
LogManager.GetLogger( LogManager.GetLogger(
@ -55,20 +54,6 @@ namespace OpenSim.Services.Connectors.SimianGrid
private string m_serverUrl = String.Empty; 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) public SimianFriendsServiceConnector(IConfigSource source)
{ {
Initialise(source); Initialise(source);

View File

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

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("InventoryServices", "");
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

View File

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

View File

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

View File

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