diff options
author | Kitto Flora | 2010-09-06 21:45:17 +0000 |
---|---|---|
committer | Kitto Flora | 2010-09-06 21:45:17 +0000 |
commit | cfaefad754642677dbddfcbe743c3fa5e058785d (patch) | |
tree | 48ac26cc5289d8c0459837cd7d6936152216403b /OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs | |
parent | Falling animation fix, comment out instrumentation. (diff) | |
parent | Fix yet another cause of "Ghost attachments" (diff) | |
download | opensim-SC-cfaefad754642677dbddfcbe743c3fa5e058785d.zip opensim-SC-cfaefad754642677dbddfcbe743c3fa5e058785d.tar.gz opensim-SC-cfaefad754642677dbddfcbe743c3fa5e058785d.tar.bz2 opensim-SC-cfaefad754642677dbddfcbe743c3fa5e058785d.tar.xz |
Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs')
-rw-r--r-- | OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs | 40 |
1 files changed, 22 insertions, 18 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 | ||