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/SimianPresenceServiceConnector.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/SimianPresenceServiceConnector.cs')
-rw-r--r-- | OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs | 38 |
1 files changed, 22 insertions, 16 deletions
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 | ||