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/SimianAvatarServiceConnector.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/SimianAvatarServiceConnector.cs')
-rw-r--r-- | OpenSim/Services/Connectors/SimianGrid/SimianAvatarServiceConnector.cs | 39 |
1 files changed, 21 insertions, 18 deletions
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 | ||