diff options
Diffstat (limited to 'OpenSim')
9 files changed, 83 insertions, 160 deletions
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs index 616b5a7..3a4f84f 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs | |||
@@ -85,27 +85,20 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
85 | 85 | ||
86 | public void Initialise(IConfigSource source) | 86 | public void Initialise(IConfigSource source) |
87 | { | 87 | { |
88 | if (Simian.IsSimianEnabled(source, "AssetServices", this.Name)) | 88 | IConfig gridConfig = source.Configs["AssetService"]; |
89 | if (gridConfig != null) | ||
89 | { | 90 | { |
90 | IConfig gridConfig = source.Configs["AssetService"]; | ||
91 | if (gridConfig == null) | ||
92 | { | ||
93 | m_log.Error("[SIMIAN ASSET CONNECTOR]: AssetService missing from OpenSim.ini"); | ||
94 | throw new Exception("Asset connector init error"); | ||
95 | } | ||
96 | |||
97 | string serviceUrl = gridConfig.GetString("AssetServerURI"); | 91 | string serviceUrl = gridConfig.GetString("AssetServerURI"); |
98 | if (String.IsNullOrEmpty(serviceUrl)) | 92 | if (!String.IsNullOrEmpty(serviceUrl)) |
99 | { | 93 | { |
100 | m_log.Error("[SIMIAN ASSET CONNECTOR]: No AssetServerURI in section AssetService"); | 94 | if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("=")) |
101 | throw new Exception("Asset connector init error"); | 95 | serviceUrl = serviceUrl + '/'; |
96 | m_serverUrl = serviceUrl; | ||
102 | } | 97 | } |
103 | |||
104 | if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("=")) | ||
105 | serviceUrl = serviceUrl + '/'; | ||
106 | |||
107 | m_serverUrl = serviceUrl; | ||
108 | } | 98 | } |
99 | |||
100 | if (String.IsNullOrEmpty(m_serverUrl)) | ||
101 | m_log.Info("[SIMIAN ASSET CONNECTOR]: No AssetServerURI specified, disabling connector"); | ||
109 | } | 102 | } |
110 | 103 | ||
111 | #region IAssetService | 104 | #region IAssetService |
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs index 9c4718e..f1c2575 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs | |||
@@ -73,24 +73,20 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
73 | 73 | ||
74 | public void Initialise(IConfigSource source) | 74 | public void Initialise(IConfigSource source) |
75 | { | 75 | { |
76 | if (Simian.IsSimianEnabled(source, "AuthenticationServices", this.Name)) | 76 | IConfig gridConfig = source.Configs["AuthenticationService"]; |
77 | if (gridConfig != null) | ||
77 | { | 78 | { |
78 | IConfig assetConfig = source.Configs["AuthenticationService"]; | 79 | string serviceUrl = gridConfig.GetString("AuthenticationServerURI"); |
79 | if (assetConfig == null) | 80 | if (!String.IsNullOrEmpty(serviceUrl)) |
80 | { | 81 | { |
81 | m_log.Error("[SIMIAN AUTH CONNECTOR]: AuthenticationService missing from OpenSim.ini"); | 82 | if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("=")) |
82 | throw new Exception("Authentication connector init error"); | 83 | serviceUrl = serviceUrl + '/'; |
84 | m_serverUrl = serviceUrl; | ||
83 | } | 85 | } |
84 | |||
85 | string serviceURI = assetConfig.GetString("AuthenticationServerURI"); | ||
86 | if (String.IsNullOrEmpty(serviceURI)) | ||
87 | { | ||
88 | m_log.Error("[SIMIAN AUTH CONNECTOR]: No Server URI named in section AuthenticationService"); | ||
89 | throw new Exception("Authentication connector init error"); | ||
90 | } | ||
91 | |||
92 | m_serverUrl = serviceURI; | ||
93 | } | 86 | } |
87 | |||
88 | if (String.IsNullOrEmpty(m_serverUrl)) | ||
89 | m_log.Info("[SIMIAN AUTH CONNECTOR]: No AuthenticationServerURI specified, disabling connector"); | ||
94 | } | 90 | } |
95 | 91 | ||
96 | public string Authenticate(UUID principalID, string password, int lifetime) | 92 | public string Authenticate(UUID principalID, string password, int lifetime) |
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAvatarServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAvatarServiceConnector.cs index 734bdd2..c2e20a3 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianAvatarServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianAvatarServiceConnector.cs | |||
@@ -78,27 +78,20 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
78 | 78 | ||
79 | public void Initialise(IConfigSource source) | 79 | public void Initialise(IConfigSource source) |
80 | { | 80 | { |
81 | if (Simian.IsSimianEnabled(source, "AvatarServices", this.Name)) | 81 | IConfig gridConfig = source.Configs["AvatarService"]; |
82 | if (gridConfig != null) | ||
82 | { | 83 | { |
83 | IConfig gridConfig = source.Configs["AvatarService"]; | ||
84 | if (gridConfig == null) | ||
85 | { | ||
86 | m_log.Error("[SIMIAN AVATAR CONNECTOR]: AvatarService missing from OpenSim.ini"); | ||
87 | throw new Exception("Avatar connector init error"); | ||
88 | } | ||
89 | |||
90 | string serviceUrl = gridConfig.GetString("AvatarServerURI"); | 84 | string serviceUrl = gridConfig.GetString("AvatarServerURI"); |
91 | if (String.IsNullOrEmpty(serviceUrl)) | 85 | if (!String.IsNullOrEmpty(serviceUrl)) |
92 | { | 86 | { |
93 | m_log.Error("[SIMIAN AVATAR CONNECTOR]: No AvatarServerURI in section AvatarService"); | 87 | if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("=")) |
94 | throw new Exception("Avatar connector init error"); | 88 | serviceUrl = serviceUrl + '/'; |
89 | m_serverUrl = serviceUrl; | ||
95 | } | 90 | } |
96 | |||
97 | if (!serviceUrl.EndsWith("/")) | ||
98 | serviceUrl = serviceUrl + '/'; | ||
99 | |||
100 | m_serverUrl = serviceUrl; | ||
101 | } | 91 | } |
92 | |||
93 | if (String.IsNullOrEmpty(m_serverUrl)) | ||
94 | m_log.Info("[SIMIAN AVATAR CONNECTOR]: No AvatarServerURI specified, disabling connector"); | ||
102 | } | 95 | } |
103 | 96 | ||
104 | #region IAvatarService | 97 | #region IAvatarService |
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 | |||
35 | public 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 fefdad6..9d67ccb 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs | |||
@@ -98,24 +98,20 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
98 | 98 | ||
99 | public void Initialise(IConfigSource source) | 99 | public void Initialise(IConfigSource source) |
100 | { | 100 | { |
101 | if (Simian.IsSimianEnabled(source, "GridServices", this.Name)) | 101 | IConfig gridConfig = source.Configs["GridService"]; |
102 | if (gridConfig != null) | ||
102 | { | 103 | { |
103 | IConfig gridConfig = source.Configs["GridService"]; | ||
104 | if (gridConfig == null) | ||
105 | { | ||
106 | m_log.Error("[SIMIAN GRID CONNECTOR]: GridService missing from OpenSim.ini"); | ||
107 | throw new Exception("Grid connector init error"); | ||
108 | } | ||
109 | |||
110 | string serviceUrl = gridConfig.GetString("GridServerURI"); | 104 | string serviceUrl = gridConfig.GetString("GridServerURI"); |
111 | if (String.IsNullOrEmpty(serviceUrl)) | 105 | if (!String.IsNullOrEmpty(serviceUrl)) |
112 | { | 106 | { |
113 | m_log.Error("[SIMIAN GRID CONNECTOR]: No Server URI named in section GridService"); | 107 | if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("=")) |
114 | throw new Exception("Grid connector init error"); | 108 | serviceUrl = serviceUrl + '/'; |
109 | m_serverUrl = serviceUrl; | ||
115 | } | 110 | } |
116 | |||
117 | m_serverUrl = serviceUrl; | ||
118 | } | 111 | } |
112 | |||
113 | if (String.IsNullOrEmpty(m_serverUrl)) | ||
114 | m_log.Info("[SIMIAN GRID CONNECTOR]: No GridServerURI specified, disabling connector"); | ||
119 | } | 115 | } |
120 | 116 | ||
121 | #region IGridService | 117 | #region IGridService |
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs index 89c1a5a..63aaad7 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs | |||
@@ -92,38 +92,30 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
92 | 92 | ||
93 | public void Initialise(IConfigSource source) | 93 | public void Initialise(IConfigSource source) |
94 | { | 94 | { |
95 | if (Simian.IsSimianEnabled(source, "InventoryServices", this.Name)) | 95 | IConfig gridConfig = source.Configs["InventoryService"]; |
96 | if (gridConfig != null) | ||
96 | { | 97 | { |
97 | IConfig gridConfig = source.Configs["InventoryService"]; | ||
98 | if (gridConfig == null) | ||
99 | { | ||
100 | m_log.Error("[SIMIAN INVENTORY CONNECTOR]: InventoryService missing from OpenSim.ini"); | ||
101 | throw new Exception("Inventory connector init error"); | ||
102 | } | ||
103 | |||
104 | string serviceUrl = gridConfig.GetString("InventoryServerURI"); | 98 | string serviceUrl = gridConfig.GetString("InventoryServerURI"); |
105 | if (String.IsNullOrEmpty(serviceUrl)) | 99 | if (!String.IsNullOrEmpty(serviceUrl)) |
106 | { | 100 | { |
107 | m_log.Error("[SIMIAN INVENTORY CONNECTOR]: No Server URI named in section InventoryService"); | 101 | if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("=")) |
108 | throw new Exception("Inventory connector init error"); | 102 | serviceUrl = serviceUrl + '/'; |
109 | } | 103 | m_serverUrl = serviceUrl; |
110 | 104 | ||
111 | m_serverUrl = serviceUrl; | 105 | gridConfig = source.Configs["UserAccountService"]; |
112 | 106 | if (gridConfig != null) | |
113 | gridConfig = source.Configs["UserAccountService"]; | 107 | { |
114 | if (gridConfig != null) | 108 | serviceUrl = gridConfig.GetString("UserAccountServerURI"); |
115 | { | 109 | if (!String.IsNullOrEmpty(serviceUrl)) |
116 | serviceUrl = gridConfig.GetString("UserAccountServerURI"); | 110 | m_userServerUrl = serviceUrl; |
117 | if (!String.IsNullOrEmpty(serviceUrl)) | 111 | } |
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 | } | 112 | } |
126 | } | 113 | } |
114 | |||
115 | if (String.IsNullOrEmpty(m_serverUrl)) | ||
116 | m_log.Info("[SIMIAN INVENTORY CONNECTOR]: No InventoryServerURI specified, disabling connector"); | ||
117 | else if (String.IsNullOrEmpty(m_userServerUrl)) | ||
118 | m_log.Info("[SIMIAN INVENTORY CONNECTOR]: No UserAccountServerURI specified, disabling connector"); | ||
127 | } | 119 | } |
128 | 120 | ||
129 | /// <summary> | 121 | /// <summary> |
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs index ca23e27..778f3f4 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs | |||
@@ -103,24 +103,20 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
103 | 103 | ||
104 | public void Initialise(IConfigSource source) | 104 | public void Initialise(IConfigSource source) |
105 | { | 105 | { |
106 | if (Simian.IsSimianEnabled(source, "PresenceServices", this.Name)) | 106 | IConfig gridConfig = source.Configs["PresenceService"]; |
107 | if (gridConfig != null) | ||
107 | { | 108 | { |
108 | IConfig gridConfig = source.Configs["PresenceService"]; | ||
109 | if (gridConfig == null) | ||
110 | { | ||
111 | m_log.Error("[SIMIAN PRESENCE CONNECTOR]: PresenceService missing from OpenSim.ini"); | ||
112 | throw new Exception("Presence connector init error"); | ||
113 | } | ||
114 | |||
115 | string serviceUrl = gridConfig.GetString("PresenceServerURI"); | 109 | string serviceUrl = gridConfig.GetString("PresenceServerURI"); |
116 | if (String.IsNullOrEmpty(serviceUrl)) | 110 | if (!String.IsNullOrEmpty(serviceUrl)) |
117 | { | 111 | { |
118 | m_log.Error("[SIMIAN PRESENCE CONNECTOR]: No PresenceServerURI in section PresenceService"); | 112 | if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("=")) |
119 | throw new Exception("Presence connector init error"); | 113 | serviceUrl = serviceUrl + '/'; |
114 | m_serverUrl = serviceUrl; | ||
120 | } | 115 | } |
121 | |||
122 | m_serverUrl = serviceUrl; | ||
123 | } | 116 | } |
117 | |||
118 | if (String.IsNullOrEmpty(m_serverUrl)) | ||
119 | m_log.Info("[SIMIAN PRESENCE CONNECTOR]: No PresenceServerURI specified, disabling connector"); | ||
124 | } | 120 | } |
125 | 121 | ||
126 | #region IPresenceService | 122 | #region IPresenceService |
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs b/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs index d30d880..a817d7c 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs | |||
@@ -88,44 +88,20 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
88 | 88 | ||
89 | public void Initialise(IConfigSource source) | 89 | public void Initialise(IConfigSource source) |
90 | { | 90 | { |
91 | if (Simian.IsSimianEnabled(source, "UserAccountServices", "SimianUserAccountServiceConnector")) | 91 | IConfig gridConfig = source.Configs["UserAccountService"]; |
92 | if (gridConfig != null) | ||
92 | { | 93 | { |
93 | IConfig gridConfig = source.Configs["UserAccountService"]; | ||
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"); | 94 | string serviceUrl = gridConfig.GetString("UserAccountServerURI"); |
101 | if (String.IsNullOrEmpty(serviceUrl)) | 95 | 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 | |||
107 | if (!serviceUrl.EndsWith("/")) | ||
108 | serviceUrl = serviceUrl + '/'; | ||
109 | |||
110 | m_serverUrl = serviceUrl; | ||
111 | IConfig profilesConfig = source.Configs["Profiles"]; | ||
112 | if (profilesConfig == null) | ||
113 | { | 96 | { |
114 | // Do not run this module by default. | 97 | if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("=")) |
115 | return; | 98 | serviceUrl = serviceUrl + '/'; |
116 | } | 99 | 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 | } | 100 | } |
128 | } | 101 | } |
102 | |||
103 | if (String.IsNullOrEmpty(m_serverUrl)) | ||
104 | m_log.Info("[SIMIAN PROFILES]: No UserAccountServerURI specified, disabling connector"); | ||
129 | } | 105 | } |
130 | 106 | ||
131 | private void ClientConnectHandler(IClientCore clientCore) | 107 | private void ClientConnectHandler(IClientCore clientCore) |
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs index 56c73ec..4c8662f 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs | |||
@@ -77,25 +77,20 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
77 | 77 | ||
78 | public void Initialise(IConfigSource source) | 78 | public void Initialise(IConfigSource source) |
79 | { | 79 | { |
80 | if (Simian.IsSimianEnabled(source, "UserAccountServices", this.Name)) | 80 | IConfig gridConfig = source.Configs["UserAccountService"]; |
81 | if (gridConfig != null) | ||
81 | { | 82 | { |
82 | IConfig assetConfig = source.Configs["UserAccountService"]; | 83 | string serviceUrl = gridConfig.GetString("UserAccountServerURI"); |
83 | if (assetConfig == null) | 84 | if (!String.IsNullOrEmpty(serviceUrl)) |
84 | { | 85 | { |
85 | m_log.Error("[SIMIAN ACCOUNT CONNECTOR]: UserAccountService missing from OpenSim.ini"); | 86 | if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("=")) |
86 | throw new Exception("User account connector init error"); | 87 | serviceUrl = serviceUrl + '/'; |
88 | m_serverUrl = serviceUrl; | ||
87 | } | 89 | } |
88 | |||
89 | string serviceURI = assetConfig.GetString("UserAccountServerURI"); | ||
90 | if (String.IsNullOrEmpty(serviceURI)) | ||
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 | } | ||
95 | |||
96 | m_accountCache = new ExpiringCache<UUID, UserAccount>(); | ||
97 | m_serverUrl = serviceURI; | ||
98 | } | 90 | } |
91 | |||
92 | if (String.IsNullOrEmpty(m_serverUrl)) | ||
93 | m_log.Info("[SIMIAN ACCOUNT CONNECTOR]: No UserAccountServerURI specified, disabling connector"); | ||
99 | } | 94 | } |
100 | 95 | ||
101 | public UserAccount GetUserAccount(UUID scopeID, string firstName, string lastName) | 96 | public UserAccount GetUserAccount(UUID scopeID, string firstName, string lastName) |