aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Connectors/SimianGrid
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Services/Connectors/SimianGrid')
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs40
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs41
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianAvatarServiceConnector.cs39
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianFriendsServiceConnector.cs58
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianGrid.cs14
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs44
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs62
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs38
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs54
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs37
10 files changed, 209 insertions, 218 deletions
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs
index 616b5a7..99e6983 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs
@@ -55,6 +55,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
55 55
56 private string m_serverUrl = String.Empty; 56 private string m_serverUrl = String.Empty;
57 private IImprovedAssetCache m_cache; 57 private IImprovedAssetCache m_cache;
58 private bool m_Enabled = false;
58 59
59 #region ISharedRegionModule 60 #region ISharedRegionModule
60 61
@@ -73,8 +74,8 @@ namespace OpenSim.Services.Connectors.SimianGrid
73 74
74 public SimianAssetServiceConnector() { } 75 public SimianAssetServiceConnector() { }
75 public string Name { get { return "SimianAssetServiceConnector"; } } 76 public string Name { get { return "SimianAssetServiceConnector"; } }
76 public void AddRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.RegisterModuleInterface<IAssetService>(this); } } 77 public void AddRegion(Scene scene) { if (m_Enabled) { scene.RegisterModuleInterface<IAssetService>(this); } }
77 public void RemoveRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.UnregisterModuleInterface<IAssetService>(this); } } 78 public void RemoveRegion(Scene scene) { if (m_Enabled) { scene.UnregisterModuleInterface<IAssetService>(this); } }
78 79
79 #endregion ISharedRegionModule 80 #endregion ISharedRegionModule
80 81
@@ -85,26 +86,29 @@ namespace OpenSim.Services.Connectors.SimianGrid
85 86
86 public void Initialise(IConfigSource source) 87 public void Initialise(IConfigSource source)
87 { 88 {
88 if (Simian.IsSimianEnabled(source, "AssetServices", this.Name)) 89 IConfig moduleConfig = source.Configs["Modules"];
90 if (moduleConfig != null)
89 { 91 {
90 IConfig gridConfig = source.Configs["AssetService"]; 92 string name = moduleConfig.GetString("AssetServices", "");
91 if (gridConfig == null) 93 if (name == Name)
92 { 94 {
93 m_log.Error("[SIMIAN ASSET CONNECTOR]: AssetService missing from OpenSim.ini"); 95 IConfig gridConfig = source.Configs["AssetService"];
94 throw new Exception("Asset connector init error"); 96 if (gridConfig != null)
95 } 97 {
98 string serviceUrl = gridConfig.GetString("AssetServerURI");
99 if (!String.IsNullOrEmpty(serviceUrl))
100 {
101 if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("="))
102 serviceUrl = serviceUrl + '/';
103 m_serverUrl = serviceUrl;
104 }
105 }
96 106
97 string serviceUrl = gridConfig.GetString("AssetServerURI"); 107 if (String.IsNullOrEmpty(m_serverUrl))
98 if (String.IsNullOrEmpty(serviceUrl)) 108 m_log.Info("[SIMIAN ASSET CONNECTOR]: No AssetServerURI specified, disabling connector");
99 { 109 else
100 m_log.Error("[SIMIAN ASSET CONNECTOR]: No AssetServerURI in section AssetService"); 110 m_Enabled = true;
101 throw new Exception("Asset connector init error");
102 } 111 }
103
104 if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("="))
105 serviceUrl = serviceUrl + '/';
106
107 m_serverUrl = serviceUrl;
108 } 112 }
109 } 113 }
110 114
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs
index 7a96a05..68f73ee 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs
@@ -1,4 +1,4 @@
1/* 1/*
2 * Copyright (c) Contributors, http://opensimulator.org/ 2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders. 3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 * 4 *
@@ -51,6 +51,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
51 MethodBase.GetCurrentMethod().DeclaringType); 51 MethodBase.GetCurrentMethod().DeclaringType);
52 52
53 private string m_serverUrl = String.Empty; 53 private string m_serverUrl = String.Empty;
54 private bool m_Enabled = false;
54 55
55 #region ISharedRegionModule 56 #region ISharedRegionModule
56 57
@@ -61,8 +62,8 @@ namespace OpenSim.Services.Connectors.SimianGrid
61 62
62 public SimianAuthenticationServiceConnector() { } 63 public SimianAuthenticationServiceConnector() { }
63 public string Name { get { return "SimianAuthenticationServiceConnector"; } } 64 public string Name { get { return "SimianAuthenticationServiceConnector"; } }
64 public void AddRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.RegisterModuleInterface<IAuthenticationService>(this); } } 65 public void AddRegion(Scene scene) { if (m_Enabled) { scene.RegisterModuleInterface<IAuthenticationService>(this); } }
65 public void RemoveRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.UnregisterModuleInterface<IAuthenticationService>(this); } } 66 public void RemoveRegion(Scene scene) { if (m_Enabled) { scene.UnregisterModuleInterface<IAuthenticationService>(this); } }
66 67
67 #endregion ISharedRegionModule 68 #endregion ISharedRegionModule
68 69
@@ -73,23 +74,28 @@ namespace OpenSim.Services.Connectors.SimianGrid
73 74
74 public void Initialise(IConfigSource source) 75 public void Initialise(IConfigSource source)
75 { 76 {
76 if (Simian.IsSimianEnabled(source, "AuthenticationServices", this.Name)) 77 IConfig moduleConfig = source.Configs["Modules"];
78 if (moduleConfig != null)
77 { 79 {
78 IConfig assetConfig = source.Configs["AuthenticationService"]; 80 string name = moduleConfig.GetString("AuthenticationServices", "");
79 if (assetConfig == null) 81 if (name == Name)
80 { 82 {
81 m_log.Error("[SIMIAN AUTH CONNECTOR]: AuthenticationService missing from OpenSim.ini"); 83 IConfig gridConfig = source.Configs["AuthenticationService"];
82 throw new Exception("Authentication connector init error"); 84 if (gridConfig != null)
83 } 85 {
86 string serviceUrl = gridConfig.GetString("AuthenticationServerURI");
87 if (!String.IsNullOrEmpty(serviceUrl))
88 {
89 if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("="))
90 serviceUrl = serviceUrl + '/';
91 m_serverUrl = serviceUrl;
92 m_Enabled = true;
93 }
94 }
84 95
85 string serviceURI = assetConfig.GetString("AuthenticationServerURI"); 96 if (String.IsNullOrEmpty(m_serverUrl))
86 if (String.IsNullOrEmpty(serviceURI)) 97 m_log.Info("[SIMIAN AUTH CONNECTOR]: No AuthenticationServerURI specified, disabling connector");
87 {
88 m_log.Error("[SIMIAN AUTH CONNECTOR]: No Server URI named in section AuthenticationService");
89 throw new Exception("Authentication connector init error");
90 } 98 }
91
92 m_serverUrl = serviceURI;
93 } 99 }
94 } 100 }
95 101
@@ -253,7 +259,8 @@ namespace OpenSim.Services.Connectors.SimianGrid
253 if (password == simianGridCredential || 259 if (password == simianGridCredential ||
254 "$1$" + password == simianGridCredential || 260 "$1$" + password == simianGridCredential ||
255 "$1$" + Utils.MD5String(password) == simianGridCredential || 261 "$1$" + Utils.MD5String(password) == simianGridCredential ||
256 Utils.MD5String(password) == simianGridCredential) 262 Utils.MD5String(password) == simianGridCredential ||
263 "$1$" + Utils.MD5String(password + ":") == simianGridCredential)
257 { 264 {
258 authorizeResult = Authorize(userID); 265 authorizeResult = Authorize(userID);
259 return true; 266 return true;
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAvatarServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAvatarServiceConnector.cs
index 734bdd2..7e56bd1 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianAvatarServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianAvatarServiceConnector.cs
@@ -56,6 +56,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
56// private static string ZeroID = UUID.Zero.ToString(); 56// private static string ZeroID = UUID.Zero.ToString();
57 57
58 private string m_serverUrl = String.Empty; 58 private string m_serverUrl = String.Empty;
59 private bool m_Enabled = false;
59 60
60 #region ISharedRegionModule 61 #region ISharedRegionModule
61 62
@@ -66,8 +67,8 @@ namespace OpenSim.Services.Connectors.SimianGrid
66 67
67 public SimianAvatarServiceConnector() { } 68 public SimianAvatarServiceConnector() { }
68 public string Name { get { return "SimianAvatarServiceConnector"; } } 69 public string Name { get { return "SimianAvatarServiceConnector"; } }
69 public void AddRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.RegisterModuleInterface<IAvatarService>(this); } } 70 public void AddRegion(Scene scene) { if (m_Enabled) { scene.RegisterModuleInterface<IAvatarService>(this); } }
70 public void RemoveRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.UnregisterModuleInterface<IAvatarService>(this); } } 71 public void RemoveRegion(Scene scene) { if (m_Enabled) { scene.UnregisterModuleInterface<IAvatarService>(this); } }
71 72
72 #endregion ISharedRegionModule 73 #endregion ISharedRegionModule
73 74
@@ -78,26 +79,28 @@ namespace OpenSim.Services.Connectors.SimianGrid
78 79
79 public void Initialise(IConfigSource source) 80 public void Initialise(IConfigSource source)
80 { 81 {
81 if (Simian.IsSimianEnabled(source, "AvatarServices", this.Name)) 82 IConfig moduleConfig = source.Configs["Modules"];
83 if (moduleConfig != null)
82 { 84 {
83 IConfig gridConfig = source.Configs["AvatarService"]; 85 string name = moduleConfig.GetString("AvatarServices", "");
84 if (gridConfig == null) 86 if (name == Name)
85 { 87 {
86 m_log.Error("[SIMIAN AVATAR CONNECTOR]: AvatarService missing from OpenSim.ini"); 88 IConfig gridConfig = source.Configs["AvatarService"];
87 throw new Exception("Avatar connector init error"); 89 if (gridConfig != null)
88 } 90 {
91 string serviceUrl = gridConfig.GetString("AvatarServerURI");
92 if (!String.IsNullOrEmpty(serviceUrl))
93 {
94 if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("="))
95 serviceUrl = serviceUrl + '/';
96 m_serverUrl = serviceUrl;
97 m_Enabled = true;
98 }
99 }
89 100
90 string serviceUrl = gridConfig.GetString("AvatarServerURI"); 101 if (String.IsNullOrEmpty(m_serverUrl))
91 if (String.IsNullOrEmpty(serviceUrl)) 102 m_log.Info("[SIMIAN AVATAR CONNECTOR]: No AvatarServerURI specified, disabling connector");
92 {
93 m_log.Error("[SIMIAN AVATAR CONNECTOR]: No AvatarServerURI in section AvatarService");
94 throw new Exception("Avatar connector init error");
95 } 103 }
96
97 if (!serviceUrl.EndsWith("/"))
98 serviceUrl = serviceUrl + '/';
99
100 m_serverUrl = serviceUrl;
101 } 104 }
102 } 105 }
103 106
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianFriendsServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianFriendsServiceConnector.cs
index 89f3594..5b18aef 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianFriendsServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianFriendsServiceConnector.cs
@@ -46,8 +46,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
46 /// <summary> 46 /// <summary>
47 /// Stores and retrieves friend lists from the SimianGrid backend 47 /// Stores and retrieves friend lists from the SimianGrid backend
48 /// </summary> 48 /// </summary>
49 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] 49 public class SimianFriendsServiceConnector : IFriendsService
50 public class SimianFriendsServiceConnector : IFriendsService, ISharedRegionModule
51 { 50 {
52 private static readonly ILog m_log = 51 private static readonly ILog m_log =
53 LogManager.GetLogger( 52 LogManager.GetLogger(
@@ -55,20 +54,6 @@ namespace OpenSim.Services.Connectors.SimianGrid
55 54
56 private string m_serverUrl = String.Empty; 55 private string m_serverUrl = String.Empty;
57 56
58 #region ISharedRegionModule
59
60 public Type ReplaceableInterface { get { return null; } }
61 public void RegionLoaded(Scene scene) { }
62 public void PostInitialise() { }
63 public void Close() { }
64
65 public SimianFriendsServiceConnector() { }
66 public string Name { get { return "SimianFriendsServiceConnector"; } }
67 public void AddRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.RegisterModuleInterface<IFriendsService>(this); } }
68 public void RemoveRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.UnregisterModuleInterface<IFriendsService>(this); } }
69
70 #endregion ISharedRegionModule
71
72 public SimianFriendsServiceConnector(IConfigSource source) 57 public SimianFriendsServiceConnector(IConfigSource source)
73 { 58 {
74 Initialise(source); 59 Initialise(source);
@@ -76,38 +61,29 @@ namespace OpenSim.Services.Connectors.SimianGrid
76 61
77 public void Initialise(IConfigSource source) 62 public void Initialise(IConfigSource source)
78 { 63 {
79 bool isSimianEnabled = false; 64 IConfig gridConfig = source.Configs["FriendsService"];
80 65 if (gridConfig != null)
81 if (source.Configs["Friends"] != null)
82 {
83 string module = source.Configs["Friends"].GetString("Connector");
84 isSimianEnabled = !String.IsNullOrEmpty(module) && module.EndsWith(this.Name);
85 }
86
87 if (isSimianEnabled)
88 { 66 {
89 IConfig assetConfig = source.Configs["FriendsService"]; 67 string serviceUrl = gridConfig.GetString("FriendsServerURI");
90 if (assetConfig == null) 68 if (!String.IsNullOrEmpty(serviceUrl))
91 { 69 {
92 m_log.Error("[SIMIAN FRIENDS CONNECTOR]: FriendsService missing from OpenSim.ini"); 70 if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("="))
93 throw new Exception("Friends connector init error"); 71 serviceUrl = serviceUrl + '/';
72 m_serverUrl = serviceUrl;
94 } 73 }
95
96 string serviceURI = assetConfig.GetString("FriendsServerURI");
97 if (String.IsNullOrEmpty(serviceURI))
98 {
99 m_log.Error("[SIMIAN FRIENDS CONNECTOR]: No Server URI named in section FriendsService");
100 throw new Exception("Friends connector init error");
101 }
102
103 m_serverUrl = serviceURI;
104 } 74 }
75
76 if (String.IsNullOrEmpty(m_serverUrl))
77 m_log.Info("[SIMIAN FRIENDS CONNECTOR]: No FriendsServerURI specified, disabling connector");
105 } 78 }
106 79
107 #region IFriendsService 80 #region IFriendsService
108 81
109 public FriendInfo[] GetFriends(UUID principalID) 82 public FriendInfo[] GetFriends(UUID principalID)
110 { 83 {
84 if (String.IsNullOrEmpty(m_serverUrl))
85 return new FriendInfo[0];
86
111 Dictionary<UUID, FriendInfo> friends = new Dictionary<UUID, FriendInfo>(); 87 Dictionary<UUID, FriendInfo> friends = new Dictionary<UUID, FriendInfo>();
112 88
113 OSDArray friendsArray = GetFriended(principalID); 89 OSDArray friendsArray = GetFriended(principalID);
@@ -156,6 +132,9 @@ namespace OpenSim.Services.Connectors.SimianGrid
156 132
157 public bool StoreFriend(UUID principalID, string friend, int flags) 133 public bool StoreFriend(UUID principalID, string friend, int flags)
158 { 134 {
135 if (String.IsNullOrEmpty(m_serverUrl))
136 return true;
137
159 NameValueCollection requestArgs = new NameValueCollection 138 NameValueCollection requestArgs = new NameValueCollection
160 { 139 {
161 { "RequestMethod", "AddGeneric" }, 140 { "RequestMethod", "AddGeneric" },
@@ -176,6 +155,9 @@ namespace OpenSim.Services.Connectors.SimianGrid
176 155
177 public bool Delete(UUID principalID, string friend) 156 public bool Delete(UUID principalID, string friend)
178 { 157 {
158 if (String.IsNullOrEmpty(m_serverUrl))
159 return true;
160
179 NameValueCollection requestArgs = new NameValueCollection 161 NameValueCollection requestArgs = new NameValueCollection
180 { 162 {
181 { "RequestMethod", "RemoveGeneric" }, 163 { "RequestMethod", "RemoveGeneric" },
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianGrid.cs b/OpenSim/Services/Connectors/SimianGrid/SimianGrid.cs
index 7d97aaa..847319c 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianGrid.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianGrid.cs
@@ -31,17 +31,3 @@ using Nini.Config;
31 31
32[assembly: Addin("SimianGrid", "1.0")] 32[assembly: Addin("SimianGrid", "1.0")]
33[assembly: AddinDependency("OpenSim", "0.5")] 33[assembly: AddinDependency("OpenSim", "0.5")]
34
35public static class Simian
36{
37 public static bool IsSimianEnabled(IConfigSource config, string moduleName, string connectorName)
38 {
39 if (config.Configs["Modules"] != null)
40 {
41 string module = config.Configs["Modules"].GetString(moduleName);
42 return !String.IsNullOrEmpty(module) && module.EndsWith(connectorName);
43 }
44
45 return false;
46 }
47} \ No newline at end of file
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs
index 1ddcc75..4fceef6 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs
@@ -60,6 +60,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
60 60
61 private string m_serverUrl = String.Empty; 61 private string m_serverUrl = String.Empty;
62 private Dictionary<UUID, Scene> m_scenes = new Dictionary<UUID, Scene>(); 62 private Dictionary<UUID, Scene> m_scenes = new Dictionary<UUID, Scene>();
63 private bool m_Enabled = false;
63 64
64 #region ISharedRegionModule 65 #region ISharedRegionModule
65 66
@@ -72,21 +73,25 @@ namespace OpenSim.Services.Connectors.SimianGrid
72 public string Name { get { return "SimianGridServiceConnector"; } } 73 public string Name { get { return "SimianGridServiceConnector"; } }
73 public void AddRegion(Scene scene) 74 public void AddRegion(Scene scene)
74 { 75 {
76 if (!m_Enabled)
77 return;
78
75 // Every shared region module has to maintain an indepedent list of 79 // Every shared region module has to maintain an indepedent list of
76 // currently running regions 80 // currently running regions
77 lock (m_scenes) 81 lock (m_scenes)
78 m_scenes[scene.RegionInfo.RegionID] = scene; 82 m_scenes[scene.RegionInfo.RegionID] = scene;
79 83
80 if (!String.IsNullOrEmpty(m_serverUrl)) 84 scene.RegisterModuleInterface<IGridService>(this);
81 scene.RegisterModuleInterface<IGridService>(this);
82 } 85 }
83 public void RemoveRegion(Scene scene) 86 public void RemoveRegion(Scene scene)
84 { 87 {
88 if (!m_Enabled)
89 return;
90
85 lock (m_scenes) 91 lock (m_scenes)
86 m_scenes.Remove(scene.RegionInfo.RegionID); 92 m_scenes.Remove(scene.RegionInfo.RegionID);
87 93
88 if (!String.IsNullOrEmpty(m_serverUrl)) 94 scene.UnregisterModuleInterface<IGridService>(this);
89 scene.UnregisterModuleInterface<IGridService>(this);
90 } 95 }
91 96
92 #endregion ISharedRegionModule 97 #endregion ISharedRegionModule
@@ -98,23 +103,28 @@ namespace OpenSim.Services.Connectors.SimianGrid
98 103
99 public void Initialise(IConfigSource source) 104 public void Initialise(IConfigSource source)
100 { 105 {
101 if (Simian.IsSimianEnabled(source, "GridServices", this.Name)) 106 IConfig moduleConfig = source.Configs["Modules"];
107 if (moduleConfig != null)
102 { 108 {
103 IConfig gridConfig = source.Configs["GridService"]; 109 string name = moduleConfig.GetString("GridServices", "");
104 if (gridConfig == null) 110 if (name == Name)
105 { 111 {
106 m_log.Error("[SIMIAN GRID CONNECTOR]: GridService missing from OpenSim.ini"); 112 IConfig gridConfig = source.Configs["GridService"];
107 throw new Exception("Grid connector init error"); 113 if (gridConfig != null)
108 } 114 {
115 string serviceUrl = gridConfig.GetString("GridServerURI");
116 if (!String.IsNullOrEmpty(serviceUrl))
117 {
118 if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("="))
119 serviceUrl = serviceUrl + '/';
120 m_serverUrl = serviceUrl;
121 m_Enabled = true;
122 }
123 }
109 124
110 string serviceUrl = gridConfig.GetString("GridServerURI"); 125 if (String.IsNullOrEmpty(m_serverUrl))
111 if (String.IsNullOrEmpty(serviceUrl)) 126 m_log.Info("[SIMIAN GRID CONNECTOR]: No GridServerURI specified, disabling connector");
112 {
113 m_log.Error("[SIMIAN GRID CONNECTOR]: No Server URI named in section GridService");
114 throw new Exception("Grid connector init error");
115 } 127 }
116
117 m_serverUrl = serviceUrl;
118 } 128 }
119 } 129 }
120 130
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs
index 89c1a5a..eb118ae 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs
@@ -70,6 +70,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
70 private string m_serverUrl = String.Empty; 70 private string m_serverUrl = String.Empty;
71 private string m_userServerUrl = String.Empty; 71 private string m_userServerUrl = String.Empty;
72// private object m_gestureSyncRoot = new object(); 72// private object m_gestureSyncRoot = new object();
73 private bool m_Enabled = false;
73 74
74 #region ISharedRegionModule 75 #region ISharedRegionModule
75 76
@@ -80,8 +81,8 @@ namespace OpenSim.Services.Connectors.SimianGrid
80 81
81 public SimianInventoryServiceConnector() { } 82 public SimianInventoryServiceConnector() { }
82 public string Name { get { return "SimianInventoryServiceConnector"; } } 83 public string Name { get { return "SimianInventoryServiceConnector"; } }
83 public void AddRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.RegisterModuleInterface<IInventoryService>(this); } } 84 public void AddRegion(Scene scene) { if (m_Enabled) { scene.RegisterModuleInterface<IInventoryService>(this); } }
84 public void RemoveRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.UnregisterModuleInterface<IInventoryService>(this); } } 85 public void RemoveRegion(Scene scene) { if (m_Enabled) { scene.UnregisterModuleInterface<IInventoryService>(this); } }
85 86
86 #endregion ISharedRegionModule 87 #endregion ISharedRegionModule
87 88
@@ -92,36 +93,39 @@ namespace OpenSim.Services.Connectors.SimianGrid
92 93
93 public void Initialise(IConfigSource source) 94 public void Initialise(IConfigSource source)
94 { 95 {
95 if (Simian.IsSimianEnabled(source, "InventoryServices", this.Name)) 96 IConfig moduleConfig = source.Configs["Modules"];
97 if (moduleConfig != null)
96 { 98 {
97 IConfig gridConfig = source.Configs["InventoryService"]; 99 string name = moduleConfig.GetString("InventoryServices", "");
98 if (gridConfig == null) 100 if (name == Name)
99 { 101 {
100 m_log.Error("[SIMIAN INVENTORY CONNECTOR]: InventoryService missing from OpenSim.ini"); 102 IConfig gridConfig = source.Configs["InventoryService"];
101 throw new Exception("Inventory connector init error"); 103 if (gridConfig != null)
102 } 104 {
103 105 string serviceUrl = gridConfig.GetString("InventoryServerURI");
104 string serviceUrl = gridConfig.GetString("InventoryServerURI"); 106 if (!String.IsNullOrEmpty(serviceUrl))
105 if (String.IsNullOrEmpty(serviceUrl)) 107 {
106 { 108 if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("="))
107 m_log.Error("[SIMIAN INVENTORY CONNECTOR]: No Server URI named in section InventoryService"); 109 serviceUrl = serviceUrl + '/';
108 throw new Exception("Inventory connector init error"); 110 m_serverUrl = serviceUrl;
109 } 111
110 112 gridConfig = source.Configs["UserAccountService"];
111 m_serverUrl = serviceUrl; 113 if (gridConfig != null)
114 {
115 serviceUrl = gridConfig.GetString("UserAccountServerURI");
116 if (!String.IsNullOrEmpty(serviceUrl))
117 {
118 m_userServerUrl = serviceUrl;
119 m_Enabled = true;
120 }
121 }
122 }
123 }
112 124
113 gridConfig = source.Configs["UserAccountService"]; 125 if (String.IsNullOrEmpty(m_serverUrl))
114 if (gridConfig != null) 126 m_log.Info("[SIMIAN INVENTORY CONNECTOR]: No InventoryServerURI specified, disabling connector");
115 { 127 else if (String.IsNullOrEmpty(m_userServerUrl))
116 serviceUrl = gridConfig.GetString("UserAccountServerURI"); 128 m_log.Info("[SIMIAN INVENTORY CONNECTOR]: No UserAccountServerURI specified, disabling connector");
117 if (!String.IsNullOrEmpty(serviceUrl))
118 m_userServerUrl = serviceUrl;
119 else
120 m_log.Info("[SIMIAN INVENTORY CONNECTOR]: No Server URI named in section UserAccountService");
121 }
122 else
123 {
124 m_log.Warn("[SIMIAN INVENTORY CONNECTOR]: UserAccountService missing from OpenSim.ini");
125 } 129 }
126 } 130 }
127 } 131 }
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs
index ca23e27..074c80f 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs
@@ -59,6 +59,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
59 59
60 private string m_serverUrl = String.Empty; 60 private string m_serverUrl = String.Empty;
61 private SimianActivityDetector m_activityDetector; 61 private SimianActivityDetector m_activityDetector;
62 private bool m_Enabled = false;
62 63
63 #region ISharedRegionModule 64 #region ISharedRegionModule
64 65
@@ -71,7 +72,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
71 public string Name { get { return "SimianPresenceServiceConnector"; } } 72 public string Name { get { return "SimianPresenceServiceConnector"; } }
72 public void AddRegion(Scene scene) 73 public void AddRegion(Scene scene)
73 { 74 {
74 if (!String.IsNullOrEmpty(m_serverUrl)) 75 if (m_Enabled)
75 { 76 {
76 scene.RegisterModuleInterface<IPresenceService>(this); 77 scene.RegisterModuleInterface<IPresenceService>(this);
77 scene.RegisterModuleInterface<IGridUserService>(this); 78 scene.RegisterModuleInterface<IGridUserService>(this);
@@ -83,7 +84,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
83 } 84 }
84 public void RemoveRegion(Scene scene) 85 public void RemoveRegion(Scene scene)
85 { 86 {
86 if (!String.IsNullOrEmpty(m_serverUrl)) 87 if (m_Enabled)
87 { 88 {
88 scene.UnregisterModuleInterface<IPresenceService>(this); 89 scene.UnregisterModuleInterface<IPresenceService>(this);
89 scene.UnregisterModuleInterface<IGridUserService>(this); 90 scene.UnregisterModuleInterface<IGridUserService>(this);
@@ -103,23 +104,28 @@ namespace OpenSim.Services.Connectors.SimianGrid
103 104
104 public void Initialise(IConfigSource source) 105 public void Initialise(IConfigSource source)
105 { 106 {
106 if (Simian.IsSimianEnabled(source, "PresenceServices", this.Name)) 107 IConfig moduleConfig = source.Configs["Modules"];
108 if (moduleConfig != null)
107 { 109 {
108 IConfig gridConfig = source.Configs["PresenceService"]; 110 string name = moduleConfig.GetString("PresenceServices", "");
109 if (gridConfig == null) 111 if (name == Name)
110 { 112 {
111 m_log.Error("[SIMIAN PRESENCE CONNECTOR]: PresenceService missing from OpenSim.ini"); 113 IConfig gridConfig = source.Configs["PresenceService"];
112 throw new Exception("Presence connector init error"); 114 if (gridConfig != null)
115 {
116 string serviceUrl = gridConfig.GetString("PresenceServerURI");
117 if (!String.IsNullOrEmpty(serviceUrl))
118 {
119 if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("="))
120 serviceUrl = serviceUrl + '/';
121 m_serverUrl = serviceUrl;
122 m_Enabled = true;
123 }
124 }
125
126 if (String.IsNullOrEmpty(m_serverUrl))
127 m_log.Info("[SIMIAN PRESENCE CONNECTOR]: No PresenceServerURI specified, disabling connector");
113 } 128 }
114
115 string serviceUrl = gridConfig.GetString("PresenceServerURI");
116 if (String.IsNullOrEmpty(serviceUrl))
117 {
118 m_log.Error("[SIMIAN PRESENCE CONNECTOR]: No PresenceServerURI in section PresenceService");
119 throw new Exception("Presence connector init error");
120 }
121
122 m_serverUrl = serviceUrl;
123 } 129 }
124 } 130 }
125 131
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs b/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs
index d30d880..0ef4974 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs
@@ -67,6 +67,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
67 MethodBase.GetCurrentMethod().DeclaringType); 67 MethodBase.GetCurrentMethod().DeclaringType);
68 68
69 private string m_serverUrl = String.Empty; 69 private string m_serverUrl = String.Empty;
70 private bool m_Enabled = false;
70 71
71 #region INonSharedRegionModule 72 #region INonSharedRegionModule
72 73
@@ -76,8 +77,8 @@ namespace OpenSim.Services.Connectors.SimianGrid
76 77
77 public SimianProfiles() { } 78 public SimianProfiles() { }
78 public string Name { get { return "SimianProfiles"; } } 79 public string Name { get { return "SimianProfiles"; } }
79 public void AddRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { CheckEstateManager(scene); scene.EventManager.OnClientConnect += ClientConnectHandler; } } 80 public void AddRegion(Scene scene) { if (m_Enabled) { CheckEstateManager(scene); scene.EventManager.OnClientConnect += ClientConnectHandler; } }
80 public void RemoveRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.EventManager.OnClientConnect -= ClientConnectHandler; } } 81 public void RemoveRegion(Scene scene) { if (m_Enabled) { scene.EventManager.OnClientConnect -= ClientConnectHandler; } }
81 82
82 #endregion INonSharedRegionModule 83 #endregion INonSharedRegionModule
83 84
@@ -88,44 +89,27 @@ namespace OpenSim.Services.Connectors.SimianGrid
88 89
89 public void Initialise(IConfigSource source) 90 public void Initialise(IConfigSource source)
90 { 91 {
91 if (Simian.IsSimianEnabled(source, "UserAccountServices", "SimianUserAccountServiceConnector")) 92 IConfig profileConfig = source.Configs["Profile"];
92 { 93 if (profileConfig == null)
93 IConfig gridConfig = source.Configs["UserAccountService"]; 94 return;
94 if (gridConfig == null)
95 {
96 m_log.Error("[SIMIAN PROFILES]: UserAccountService missing from OpenSim.ini");
97 throw new Exception("Profiles init error");
98 }
99
100 string serviceUrl = gridConfig.GetString("UserAccountServerURI");
101 if (String.IsNullOrEmpty(serviceUrl))
102 {
103 m_log.Error("[SIMIAN PROFILES]: No UserAccountServerURI in section UserAccountService");
104 throw new Exception("Profiles init error");
105 }
106 95
107 if (!serviceUrl.EndsWith("/")) 96 if (profileConfig.GetString("Module", String.Empty) != Name)
108 serviceUrl = serviceUrl + '/'; 97 return;
109 98
110 m_serverUrl = serviceUrl; 99 IConfig gridConfig = source.Configs["UserAccountService"];
111 IConfig profilesConfig = source.Configs["Profiles"]; 100 if (gridConfig != null)
112 if (profilesConfig == null) 101 {
102 string serviceUrl = gridConfig.GetString("UserAccountServerURI");
103 if (!String.IsNullOrEmpty(serviceUrl))
113 { 104 {
114 // Do not run this module by default. 105 if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("="))
115 return; 106 serviceUrl = serviceUrl + '/';
116 } 107 m_serverUrl = serviceUrl;
117 else
118 {
119 // if profiles aren't enabled, we're not needed.
120 // if we're not specified as the connector to use, then we're not wanted
121 if (profilesConfig.GetString("Module", String.Empty) != Name)
122 {
123
124 return;
125 }
126 m_log.InfoFormat("[SIMIAN ACCOUNT CONNECTOR]: Initializing {0}", this.Name);
127 } 108 }
128 } 109 }
110
111 if (String.IsNullOrEmpty(m_serverUrl))
112 m_log.Info("[SIMIAN PROFILES]: No UserAccountServerURI specified, disabling connector");
129 } 113 }
130 114
131 private void ClientConnectHandler(IClientCore clientCore) 115 private void ClientConnectHandler(IClientCore clientCore)
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs
index 56c73ec..deb8695 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs
@@ -55,6 +55,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
55 55
56 private string m_serverUrl = String.Empty; 56 private string m_serverUrl = String.Empty;
57 private ExpiringCache<UUID, UserAccount> m_accountCache; 57 private ExpiringCache<UUID, UserAccount> m_accountCache;
58 private bool m_Enabled = false;
58 59
59 #region ISharedRegionModule 60 #region ISharedRegionModule
60 61
@@ -65,8 +66,8 @@ namespace OpenSim.Services.Connectors.SimianGrid
65 66
66 public SimianUserAccountServiceConnector() { } 67 public SimianUserAccountServiceConnector() { }
67 public string Name { get { return "SimianUserAccountServiceConnector"; } } 68 public string Name { get { return "SimianUserAccountServiceConnector"; } }
68 public void AddRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.RegisterModuleInterface<IUserAccountService>(this); } } 69 public void AddRegion(Scene scene) { if (m_Enabled) { scene.RegisterModuleInterface<IUserAccountService>(this); } }
69 public void RemoveRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.UnregisterModuleInterface<IUserAccountService>(this); } } 70 public void RemoveRegion(Scene scene) { if (m_Enabled) { scene.UnregisterModuleInterface<IUserAccountService>(this); } }
70 71
71 #endregion ISharedRegionModule 72 #endregion ISharedRegionModule
72 73
@@ -77,24 +78,28 @@ namespace OpenSim.Services.Connectors.SimianGrid
77 78
78 public void Initialise(IConfigSource source) 79 public void Initialise(IConfigSource source)
79 { 80 {
80 if (Simian.IsSimianEnabled(source, "UserAccountServices", this.Name)) 81 IConfig moduleConfig = source.Configs["Modules"];
82 if (moduleConfig != null)
81 { 83 {
82 IConfig assetConfig = source.Configs["UserAccountService"]; 84 string name = moduleConfig.GetString("UserAccountServices", "");
83 if (assetConfig == null) 85 if (name == Name)
84 { 86 {
85 m_log.Error("[SIMIAN ACCOUNT CONNECTOR]: UserAccountService missing from OpenSim.ini"); 87 IConfig gridConfig = source.Configs["UserAccountService"];
86 throw new Exception("User account connector init error"); 88 if (gridConfig != null)
87 } 89 {
90 string serviceUrl = gridConfig.GetString("UserAccountServerURI");
91 if (!String.IsNullOrEmpty(serviceUrl))
92 {
93 if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("="))
94 serviceUrl = serviceUrl + '/';
95 m_serverUrl = serviceUrl;
96 m_Enabled = true;
97 }
98 }
88 99
89 string serviceURI = assetConfig.GetString("UserAccountServerURI"); 100 if (String.IsNullOrEmpty(m_serverUrl))
90 if (String.IsNullOrEmpty(serviceURI)) 101 m_log.Info("[SIMIAN ACCOUNT CONNECTOR]: No UserAccountServerURI specified, disabling connector");
91 {
92 m_log.Error("[SIMIAN ACCOUNT CONNECTOR]: No UserAccountServerURI in section UserAccountService, skipping SimianUserAccountServiceConnector");
93 throw new Exception("User account connector init error");
94 } 102 }
95
96 m_accountCache = new ExpiringCache<UUID, UserAccount>();
97 m_serverUrl = serviceURI;
98 } 103 }
99 } 104 }
100 105