diff options
author | Melanie | 2010-09-05 17:24:05 +0100 |
---|---|---|
committer | Melanie | 2010-09-05 17:24:05 +0100 |
commit | 4025b85a07619e1d1e22095eb3f65d2238c15378 (patch) | |
tree | d7faa122dae007f85194b54d61f0e36249e0737f | |
parent | Add missing IDwellModule interface (diff) | |
download | opensim-SC-4025b85a07619e1d1e22095eb3f65d2238c15378.zip opensim-SC-4025b85a07619e1d1e22095eb3f65d2238c15378.tar.gz opensim-SC-4025b85a07619e1d1e22095eb3f65d2238c15378.tar.bz2 opensim-SC-4025b85a07619e1d1e22095eb3f65d2238c15378.tar.xz |
As an exmple, add the code to disable connectors intot he simian asset
connector
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs index 3a4f84f..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,20 +86,30 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
85 | 86 | ||
86 | public void Initialise(IConfigSource source) | 87 | public void Initialise(IConfigSource source) |
87 | { | 88 | { |
88 | IConfig gridConfig = source.Configs["AssetService"]; | 89 | IConfig moduleConfig = source.Configs["Modules"]; |
89 | if (gridConfig != null) | 90 | if (moduleConfig != null) |
90 | { | 91 | { |
91 | string serviceUrl = gridConfig.GetString("AssetServerURI"); | 92 | string name = moduleConfig.GetString("AssetServices", ""); |
92 | if (!String.IsNullOrEmpty(serviceUrl)) | 93 | if (name == Name) |
93 | { | 94 | { |
94 | if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("=")) | 95 | IConfig gridConfig = source.Configs["AssetService"]; |
95 | serviceUrl = serviceUrl + '/'; | 96 | if (gridConfig != null) |
96 | m_serverUrl = serviceUrl; | 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 | } | ||
106 | |||
107 | if (String.IsNullOrEmpty(m_serverUrl)) | ||
108 | m_log.Info("[SIMIAN ASSET CONNECTOR]: No AssetServerURI specified, disabling connector"); | ||
109 | else | ||
110 | m_Enabled = true; | ||
97 | } | 111 | } |
98 | } | 112 | } |
99 | |||
100 | if (String.IsNullOrEmpty(m_serverUrl)) | ||
101 | m_log.Info("[SIMIAN ASSET CONNECTOR]: No AssetServerURI specified, disabling connector"); | ||
102 | } | 113 | } |
103 | 114 | ||
104 | #region IAssetService | 115 | #region IAssetService |