diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/OptionalModules/Avatar/Concierge/ConciergeModule.cs | 212 |
1 files changed, 106 insertions, 106 deletions
diff --git a/OpenSim/Region/OptionalModules/Avatar/Concierge/ConciergeModule.cs b/OpenSim/Region/OptionalModules/Avatar/Concierge/ConciergeModule.cs index bb46b11..3f99562 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Concierge/ConciergeModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Concierge/ConciergeModule.cs | |||
@@ -49,44 +49,44 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge | |||
49 | { | 49 | { |
50 | public class ConciergeModule : ChatModule, IRegionModule | 50 | public class ConciergeModule : ChatModule, IRegionModule |
51 | { | 51 | { |
52 | private static readonly ILog _log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 52 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
53 | 53 | ||
54 | private const int DEBUG_CHANNEL = 2147483647; | 54 | private const int DEBUG_CHANNEL = 2147483647; |
55 | 55 | ||
56 | private List<IScene> _scenes = new List<IScene>(); | 56 | private List<IScene> m_scenes = new List<IScene>(); |
57 | private List<IScene> _conciergedScenes = new List<IScene>(); | 57 | private List<IScene> m_conciergedScenes = new List<IScene>(); |
58 | private Dictionary<IScene, List<UUID>> _sceneAttendees = | 58 | private Dictionary<IScene, List<UUID>> m_sceneAttendees = |
59 | new Dictionary<IScene, List<UUID>>(); | 59 | new Dictionary<IScene, List<UUID>>(); |
60 | private Dictionary<UUID, string> _attendeeNames = | 60 | private Dictionary<UUID, string> m_attendeeNames = |
61 | new Dictionary<UUID, string>(); | 61 | new Dictionary<UUID, string>(); |
62 | 62 | ||
63 | private bool _replacingChatModule = false; | 63 | private bool m_replacingChatModule = false; |
64 | 64 | ||
65 | private IConfig _config; | 65 | private IConfig m_config; |
66 | 66 | ||
67 | private string _whoami = "conferencier"; | 67 | private string m_whoami = "conferencier"; |
68 | private Regex _regions = null; | 68 | private Regex m_regions = null; |
69 | private string _welcomes = null; | 69 | private string m_welcomes = null; |
70 | private int _conciergeChannel = 42; | 70 | private int m_conciergeChannel = 42; |
71 | private string _announceEntering = "{0} enters {1} (now {2} visitors in this region)"; | 71 | private string m_announceEntering = "{0} enters {1} (now {2} visitors in this region)"; |
72 | private string _announceLeaving = "{0} leaves {1} (back to {2} visitors in this region)"; | 72 | private string m_announceLeaving = "{0} leaves {1} (back to {2} visitors in this region)"; |
73 | private string _xmlRpcPassword = String.Empty; | 73 | private string m_xmlRpcPassword = String.Empty; |
74 | private string _brokerURI = String.Empty; | 74 | private string m_brokerURI = String.Empty; |
75 | 75 | ||
76 | internal object _syncy = new object(); | 76 | internal object m_syncy = new object(); |
77 | 77 | ||
78 | #region IRegionModule Members | 78 | #region IRegionModule Members |
79 | public override void Initialise(Scene scene, IConfigSource config) | 79 | public override void Initialise(Scene scene, IConfigSource config) |
80 | { | 80 | { |
81 | try | 81 | try |
82 | { | 82 | { |
83 | if ((_config = config.Configs["Concierge"]) == null) | 83 | if ((m_config = config.Configs["Concierge"]) == null) |
84 | { | 84 | { |
85 | //_log.InfoFormat("[Concierge]: no configuration section [Concierge] in OpenSim.ini: module not configured"); | 85 | //_log.InfoFormat("[Concierge]: no configuration section [Concierge] in OpenSim.ini: module not configured"); |
86 | return; | 86 | return; |
87 | } | 87 | } |
88 | 88 | ||
89 | if (!_config.GetBoolean("enabled", false)) | 89 | if (!m_config.GetBoolean("enabled", false)) |
90 | { | 90 | { |
91 | //_log.InfoFormat("[Concierge]: module disabled by OpenSim.ini configuration"); | 91 | //_log.InfoFormat("[Concierge]: module disabled by OpenSim.ini configuration"); |
92 | return; | 92 | return; |
@@ -94,7 +94,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge | |||
94 | } | 94 | } |
95 | catch (Exception) | 95 | catch (Exception) |
96 | { | 96 | { |
97 | _log.Info("[Concierge]: module not configured"); | 97 | m_log.Info("[Concierge]: module not configured"); |
98 | return; | 98 | return; |
99 | } | 99 | } |
100 | 100 | ||
@@ -104,58 +104,58 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge | |||
104 | { | 104 | { |
105 | if (config.Configs["Chat"] == null) | 105 | if (config.Configs["Chat"] == null) |
106 | { | 106 | { |
107 | _replacingChatModule = false; | 107 | m_replacingChatModule = false; |
108 | } | 108 | } |
109 | else | 109 | else |
110 | { | 110 | { |
111 | _replacingChatModule = !config.Configs["Chat"].GetBoolean("enabled", true); | 111 | m_replacingChatModule = !config.Configs["Chat"].GetBoolean("enabled", true); |
112 | } | 112 | } |
113 | } | 113 | } |
114 | catch (Exception) | 114 | catch (Exception) |
115 | { | 115 | { |
116 | _replacingChatModule = false; | 116 | m_replacingChatModule = false; |
117 | } | 117 | } |
118 | _log.InfoFormat("[Concierge] {0} ChatModule", _replacingChatModule ? "replacing" : "not replacing"); | 118 | m_log.InfoFormat("[Concierge] {0} ChatModule", m_replacingChatModule ? "replacing" : "not replacing"); |
119 | 119 | ||
120 | 120 | ||
121 | // take note of concierge channel and of identity | 121 | // take note of concierge channel and of identity |
122 | _conciergeChannel = config.Configs["Concierge"].GetInt("concierge_channel", _conciergeChannel); | 122 | m_conciergeChannel = config.Configs["Concierge"].GetInt("concierge_channel", m_conciergeChannel); |
123 | _whoami = _config.GetString("whoami", "conferencier"); | 123 | m_whoami = m_config.GetString("whoami", "conferencier"); |
124 | _welcomes = _config.GetString("welcomes", _welcomes); | 124 | m_welcomes = m_config.GetString("welcomes", m_welcomes); |
125 | _announceEntering = _config.GetString("announce_entering", _announceEntering); | 125 | m_announceEntering = m_config.GetString("announce_entering", m_announceEntering); |
126 | _announceLeaving = _config.GetString("announce_leaving", _announceLeaving); | 126 | m_announceLeaving = m_config.GetString("announce_leaving", m_announceLeaving); |
127 | _xmlRpcPassword = _config.GetString("password", _xmlRpcPassword); | 127 | m_xmlRpcPassword = m_config.GetString("password", m_xmlRpcPassword); |
128 | _brokerURI = _config.GetString("broker", _brokerURI); | 128 | m_brokerURI = m_config.GetString("broker", m_brokerURI); |
129 | 129 | ||
130 | _log.InfoFormat("[Concierge] reporting as \"{0}\" to our users", _whoami); | 130 | m_log.InfoFormat("[Concierge] reporting as \"{0}\" to our users", m_whoami); |
131 | 131 | ||
132 | // calculate regions Regex | 132 | // calculate regions Regex |
133 | if (_regions == null) | 133 | if (m_regions == null) |
134 | { | 134 | { |
135 | string regions = _config.GetString("regions", String.Empty); | 135 | string regions = m_config.GetString("regions", String.Empty); |
136 | if (!String.IsNullOrEmpty(regions)) | 136 | if (!String.IsNullOrEmpty(regions)) |
137 | { | 137 | { |
138 | _regions = new Regex(@regions, RegexOptions.Compiled | RegexOptions.IgnoreCase); | 138 | m_regions = new Regex(@regions, RegexOptions.Compiled | RegexOptions.IgnoreCase); |
139 | } | 139 | } |
140 | } | 140 | } |
141 | 141 | ||
142 | scene.CommsManager.HttpServer.AddXmlRPCHandler("concierge_update_welcome", XmlRpcUpdateWelcomeMethod, false); | 142 | scene.CommsManager.HttpServer.AddXmlRPCHandler("concierge_update_welcome", XmlRpcUpdateWelcomeMethod, false); |
143 | 143 | ||
144 | lock (_syncy) | 144 | lock (m_syncy) |
145 | { | 145 | { |
146 | if (!_scenes.Contains(scene)) | 146 | if (!m_scenes.Contains(scene)) |
147 | { | 147 | { |
148 | _scenes.Add(scene); | 148 | m_scenes.Add(scene); |
149 | 149 | ||
150 | if (_regions == null || _regions.IsMatch(scene.RegionInfo.RegionName)) | 150 | if (m_regions == null || m_regions.IsMatch(scene.RegionInfo.RegionName)) |
151 | _conciergedScenes.Add(scene); | 151 | m_conciergedScenes.Add(scene); |
152 | 152 | ||
153 | // subscribe to NewClient events | 153 | // subscribe to NewClient events |
154 | scene.EventManager.OnNewClient += OnNewClient; | 154 | scene.EventManager.OnNewClient += OnNewClient; |
155 | 155 | ||
156 | // subscribe to *Chat events | 156 | // subscribe to *Chat events |
157 | scene.EventManager.OnChatFromWorld += OnChatFromWorld; | 157 | scene.EventManager.OnChatFromWorld += OnChatFromWorld; |
158 | if (!_replacingChatModule) | 158 | if (!m_replacingChatModule) |
159 | scene.EventManager.OnChatFromClient += OnChatFromClient; | 159 | scene.EventManager.OnChatFromClient += OnChatFromClient; |
160 | scene.EventManager.OnChatBroadcast += OnChatBroadcast; | 160 | scene.EventManager.OnChatBroadcast += OnChatBroadcast; |
161 | 161 | ||
@@ -164,7 +164,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge | |||
164 | scene.EventManager.OnMakeChildAgent += OnMakeChildAgent; | 164 | scene.EventManager.OnMakeChildAgent += OnMakeChildAgent; |
165 | } | 165 | } |
166 | } | 166 | } |
167 | _log.InfoFormat("[Concierge]: initialized for {0}", scene.RegionInfo.RegionName); | 167 | m_log.InfoFormat("[Concierge]: initialized for {0}", scene.RegionInfo.RegionName); |
168 | } | 168 | } |
169 | 169 | ||
170 | public override void PostInitialise() | 170 | public override void PostInitialise() |
@@ -190,7 +190,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge | |||
190 | #region ISimChat Members | 190 | #region ISimChat Members |
191 | public override void OnChatBroadcast(Object sender, OSChatMessage c) | 191 | public override void OnChatBroadcast(Object sender, OSChatMessage c) |
192 | { | 192 | { |
193 | if (_replacingChatModule) | 193 | if (m_replacingChatModule) |
194 | { | 194 | { |
195 | // distribute chat message to each and every avatar in | 195 | // distribute chat message to each and every avatar in |
196 | // the region | 196 | // the region |
@@ -203,7 +203,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge | |||
203 | 203 | ||
204 | public override void OnChatFromClient(Object sender, OSChatMessage c) | 204 | public override void OnChatFromClient(Object sender, OSChatMessage c) |
205 | { | 205 | { |
206 | if (_replacingChatModule) | 206 | if (m_replacingChatModule) |
207 | { | 207 | { |
208 | // replacing ChatModule: need to redistribute | 208 | // replacing ChatModule: need to redistribute |
209 | // ChatFromClient to interested subscribers | 209 | // ChatFromClient to interested subscribers |
@@ -212,7 +212,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge | |||
212 | Scene scene = (Scene)c.Scene; | 212 | Scene scene = (Scene)c.Scene; |
213 | scene.EventManager.TriggerOnChatFromClient(sender, c); | 213 | scene.EventManager.TriggerOnChatFromClient(sender, c); |
214 | 214 | ||
215 | if (_conciergedScenes.Contains(c.Scene)) | 215 | if (m_conciergedScenes.Contains(c.Scene)) |
216 | { | 216 | { |
217 | // when we are replacing ChatModule, we treat | 217 | // when we are replacing ChatModule, we treat |
218 | // OnChatFromClient like OnChatBroadcast for | 218 | // OnChatFromClient like OnChatBroadcast for |
@@ -237,9 +237,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge | |||
237 | 237 | ||
238 | public override void OnChatFromWorld(Object sender, OSChatMessage c) | 238 | public override void OnChatFromWorld(Object sender, OSChatMessage c) |
239 | { | 239 | { |
240 | if (_replacingChatModule) | 240 | if (m_replacingChatModule) |
241 | { | 241 | { |
242 | if (_conciergedScenes.Contains(c.Scene)) | 242 | if (m_conciergedScenes.Contains(c.Scene)) |
243 | { | 243 | { |
244 | // when we are replacing ChatModule, we treat | 244 | // when we are replacing ChatModule, we treat |
245 | // OnChatFromClient like OnChatBroadcast for | 245 | // OnChatFromClient like OnChatBroadcast for |
@@ -265,7 +265,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge | |||
265 | { | 265 | { |
266 | client.OnLogout += OnClientLoggedOut; | 266 | client.OnLogout += OnClientLoggedOut; |
267 | 267 | ||
268 | if (_replacingChatModule) | 268 | if (m_replacingChatModule) |
269 | client.OnChatFromClient += OnChatFromClient; | 269 | client.OnChatFromClient += OnChatFromClient; |
270 | } | 270 | } |
271 | 271 | ||
@@ -276,12 +276,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge | |||
276 | client.OnLogout -= OnClientLoggedOut; | 276 | client.OnLogout -= OnClientLoggedOut; |
277 | client.OnConnectionClosed -= OnClientLoggedOut; | 277 | client.OnConnectionClosed -= OnClientLoggedOut; |
278 | 278 | ||
279 | if (_conciergedScenes.Contains(client.Scene)) | 279 | if (m_conciergedScenes.Contains(client.Scene)) |
280 | { | 280 | { |
281 | _log.DebugFormat("[Concierge]: {0} logs off from {1}", client.Name, client.Scene.RegionInfo.RegionName); | 281 | m_log.DebugFormat("[Concierge]: {0} logs off from {1}", client.Name, client.Scene.RegionInfo.RegionName); |
282 | RemoveFromAttendeeList(client.AgentId, client.Name, client.Scene); | 282 | RemoveFromAttendeeList(client.AgentId, client.Name, client.Scene); |
283 | AnnounceToAgentsRegion(client.Scene, String.Format(_announceLeaving, client.Name, client.Scene.RegionInfo.RegionName, | 283 | AnnounceToAgentsRegion(client.Scene, String.Format(m_announceLeaving, client.Name, client.Scene.RegionInfo.RegionName, |
284 | _sceneAttendees[client.Scene].Count)); | 284 | m_sceneAttendees[client.Scene].Count)); |
285 | UpdateBroker(client.Scene); | 285 | UpdateBroker(client.Scene); |
286 | } | 286 | } |
287 | } | 287 | } |
@@ -289,13 +289,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge | |||
289 | 289 | ||
290 | public void OnMakeRootAgent(ScenePresence agent) | 290 | public void OnMakeRootAgent(ScenePresence agent) |
291 | { | 291 | { |
292 | if (_conciergedScenes.Contains(agent.Scene)) | 292 | if (m_conciergedScenes.Contains(agent.Scene)) |
293 | { | 293 | { |
294 | _log.DebugFormat("[Concierge]: {0} enters {1}", agent.Name, agent.Scene.RegionInfo.RegionName); | 294 | m_log.DebugFormat("[Concierge]: {0} enters {1}", agent.Name, agent.Scene.RegionInfo.RegionName); |
295 | AddToAttendeeList(agent.UUID, agent.Name, agent.Scene); | 295 | AddToAttendeeList(agent.UUID, agent.Name, agent.Scene); |
296 | WelcomeAvatar(agent, agent.Scene); | 296 | WelcomeAvatar(agent, agent.Scene); |
297 | AnnounceToAgentsRegion(agent.Scene, String.Format(_announceEntering, agent.Name, agent.Scene.RegionInfo.RegionName, | 297 | AnnounceToAgentsRegion(agent.Scene, String.Format(m_announceEntering, agent.Name, agent.Scene.RegionInfo.RegionName, |
298 | _sceneAttendees[agent.Scene].Count)); | 298 | m_sceneAttendees[agent.Scene].Count)); |
299 | UpdateBroker(agent.Scene); | 299 | UpdateBroker(agent.Scene); |
300 | } | 300 | } |
301 | } | 301 | } |
@@ -303,73 +303,73 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge | |||
303 | 303 | ||
304 | public void OnMakeChildAgent(ScenePresence agent) | 304 | public void OnMakeChildAgent(ScenePresence agent) |
305 | { | 305 | { |
306 | if (_conciergedScenes.Contains(agent.Scene)) | 306 | if (m_conciergedScenes.Contains(agent.Scene)) |
307 | { | 307 | { |
308 | _log.DebugFormat("[Concierge]: {0} leaves {1}", agent.Name, agent.Scene.RegionInfo.RegionName); | 308 | m_log.DebugFormat("[Concierge]: {0} leaves {1}", agent.Name, agent.Scene.RegionInfo.RegionName); |
309 | RemoveFromAttendeeList(agent.UUID, agent.Name, agent.Scene); | 309 | RemoveFromAttendeeList(agent.UUID, agent.Name, agent.Scene); |
310 | AnnounceToAgentsRegion(agent.Scene, String.Format(_announceLeaving, agent.Name, agent.Scene.RegionInfo.RegionName, | 310 | AnnounceToAgentsRegion(agent.Scene, String.Format(m_announceLeaving, agent.Name, agent.Scene.RegionInfo.RegionName, |
311 | _sceneAttendees[agent.Scene].Count)); | 311 | m_sceneAttendees[agent.Scene].Count)); |
312 | UpdateBroker(agent.Scene); | 312 | UpdateBroker(agent.Scene); |
313 | } | 313 | } |
314 | } | 314 | } |
315 | 315 | ||
316 | protected void AddToAttendeeList(UUID agentID, string name, Scene scene) | 316 | protected void AddToAttendeeList(UUID agentID, string name, Scene scene) |
317 | { | 317 | { |
318 | lock (_sceneAttendees) | 318 | lock (m_sceneAttendees) |
319 | { | 319 | { |
320 | if (!_sceneAttendees.ContainsKey(scene)) | 320 | if (!m_sceneAttendees.ContainsKey(scene)) |
321 | _sceneAttendees[scene] = new List<UUID>(); | 321 | m_sceneAttendees[scene] = new List<UUID>(); |
322 | 322 | ||
323 | List<UUID> attendees = _sceneAttendees[scene]; | 323 | List<UUID> attendees = m_sceneAttendees[scene]; |
324 | if (!attendees.Contains(agentID)) | 324 | if (!attendees.Contains(agentID)) |
325 | { | 325 | { |
326 | attendees.Add(agentID); | 326 | attendees.Add(agentID); |
327 | _attendeeNames[agentID] = name; | 327 | m_attendeeNames[agentID] = name; |
328 | } | 328 | } |
329 | } | 329 | } |
330 | } | 330 | } |
331 | 331 | ||
332 | protected void RemoveFromAttendeeList(UUID agentID, String name, IScene scene) | 332 | protected void RemoveFromAttendeeList(UUID agentID, String name, IScene scene) |
333 | { | 333 | { |
334 | lock (_sceneAttendees) | 334 | lock (m_sceneAttendees) |
335 | { | 335 | { |
336 | if (!_sceneAttendees.ContainsKey(scene)) | 336 | if (!m_sceneAttendees.ContainsKey(scene)) |
337 | { | 337 | { |
338 | _log.WarnFormat("[Concierge]: attendee list missing for region {0}", scene.RegionInfo.RegionName); | 338 | m_log.WarnFormat("[Concierge]: attendee list missing for region {0}", scene.RegionInfo.RegionName); |
339 | return; | 339 | return; |
340 | } | 340 | } |
341 | 341 | ||
342 | List<UUID> attendees = _sceneAttendees[scene]; | 342 | List<UUID> attendees = m_sceneAttendees[scene]; |
343 | if (!attendees.Contains(agentID)) | 343 | if (!attendees.Contains(agentID)) |
344 | { | 344 | { |
345 | _log.WarnFormat("[Concierge]: avatar {0} must have sneaked in to region {1} earlier", | 345 | m_log.WarnFormat("[Concierge]: avatar {0} must have sneaked in to region {1} earlier", |
346 | name, scene.RegionInfo.RegionName); | 346 | name, scene.RegionInfo.RegionName); |
347 | return; | 347 | return; |
348 | } | 348 | } |
349 | 349 | ||
350 | attendees.Remove(agentID); | 350 | attendees.Remove(agentID); |
351 | _attendeeNames.Remove(agentID); | 351 | m_attendeeNames.Remove(agentID); |
352 | } | 352 | } |
353 | } | 353 | } |
354 | 354 | ||
355 | protected void UpdateBroker(IScene scene) | 355 | protected void UpdateBroker(IScene scene) |
356 | { | 356 | { |
357 | if (String.IsNullOrEmpty(_brokerURI)) | 357 | if (String.IsNullOrEmpty(m_brokerURI)) |
358 | return; | 358 | return; |
359 | 359 | ||
360 | string uri = String.Format(_brokerURI, scene.RegionInfo.RegionName, scene.RegionInfo.RegionID); | 360 | string uri = String.Format(m_brokerURI, scene.RegionInfo.RegionName, scene.RegionInfo.RegionID); |
361 | 361 | ||
362 | // get attendee list for the scene | 362 | // get attendee list for the scene |
363 | List<UUID> attendees; | 363 | List<UUID> attendees; |
364 | lock (_sceneAttendees) | 364 | lock (m_sceneAttendees) |
365 | { | 365 | { |
366 | if (!_sceneAttendees.ContainsKey(scene)) | 366 | if (!m_sceneAttendees.ContainsKey(scene)) |
367 | { | 367 | { |
368 | _log.DebugFormat("[Concierge]: attendee list missing for region {0}", scene.RegionInfo.RegionName); | 368 | m_log.DebugFormat("[Concierge]: attendee list missing for region {0}", scene.RegionInfo.RegionName); |
369 | return; | 369 | return; |
370 | } | 370 | } |
371 | 371 | ||
372 | attendees = _sceneAttendees[scene]; | 372 | attendees = m_sceneAttendees[scene]; |
373 | } | 373 | } |
374 | 374 | ||
375 | // create XML sniplet | 375 | // create XML sniplet |
@@ -388,7 +388,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge | |||
388 | DateTime.UtcNow.ToString("s"))); | 388 | DateTime.UtcNow.ToString("s"))); |
389 | foreach (UUID uuid in attendees) | 389 | foreach (UUID uuid in attendees) |
390 | { | 390 | { |
391 | string name = _attendeeNames[uuid]; | 391 | string name = m_attendeeNames[uuid]; |
392 | list.Append(String.Format(" <avatar name=\"{0}\" uuid=\"{1}\" />\n", name, uuid)); | 392 | list.Append(String.Format(" <avatar name=\"{0}\" uuid=\"{1}\" />\n", name, uuid)); |
393 | } | 393 | } |
394 | list.Append("</avatars>"); | 394 | list.Append("</avatars>"); |
@@ -409,11 +409,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge | |||
409 | payloadStream.Close(); | 409 | payloadStream.Close(); |
410 | 410 | ||
411 | updatePost.BeginGetResponse(UpdateBrokerDone, updatePost); | 411 | updatePost.BeginGetResponse(UpdateBrokerDone, updatePost); |
412 | _log.DebugFormat("[Concierge] async broker POST to {0} started", uri); | 412 | m_log.DebugFormat("[Concierge] async broker POST to {0} started", uri); |
413 | } | 413 | } |
414 | catch (WebException we) | 414 | catch (WebException we) |
415 | { | 415 | { |
416 | _log.ErrorFormat("[Concierge] async broker POST to {0} failed: {1}", uri, we.Status); | 416 | m_log.ErrorFormat("[Concierge] async broker POST to {0} failed: {1}", uri, we.Status); |
417 | } | 417 | } |
418 | } | 418 | } |
419 | 419 | ||
@@ -425,25 +425,25 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge | |||
425 | updatePost = result.AsyncState as HttpWebRequest; | 425 | updatePost = result.AsyncState as HttpWebRequest; |
426 | using (HttpWebResponse response = updatePost.EndGetResponse(result) as HttpWebResponse) | 426 | using (HttpWebResponse response = updatePost.EndGetResponse(result) as HttpWebResponse) |
427 | { | 427 | { |
428 | _log.DebugFormat("[Concierge] broker update: status {0}", response.StatusCode); | 428 | m_log.DebugFormat("[Concierge] broker update: status {0}", response.StatusCode); |
429 | } | 429 | } |
430 | } | 430 | } |
431 | catch (WebException we) | 431 | catch (WebException we) |
432 | { | 432 | { |
433 | string uri = updatePost.RequestUri.OriginalString; | 433 | string uri = updatePost.RequestUri.OriginalString; |
434 | _log.ErrorFormat("[Concierge] broker update to {0} failed with status {1}", uri, we.Status); | 434 | m_log.ErrorFormat("[Concierge] broker update to {0} failed with status {1}", uri, we.Status); |
435 | if (null != we.Response) | 435 | if (null != we.Response) |
436 | { | 436 | { |
437 | using (HttpWebResponse resp = we.Response as HttpWebResponse) | 437 | using (HttpWebResponse resp = we.Response as HttpWebResponse) |
438 | { | 438 | { |
439 | _log.ErrorFormat("[Concierge] response from {0} status code: {1}", uri, resp.StatusCode); | 439 | m_log.ErrorFormat("[Concierge] response from {0} status code: {1}", uri, resp.StatusCode); |
440 | _log.ErrorFormat("[Concierge] response from {0} status desc: {1}", uri, resp.StatusDescription); | 440 | m_log.ErrorFormat("[Concierge] response from {0} status desc: {1}", uri, resp.StatusDescription); |
441 | _log.ErrorFormat("[Concierge] response from {0} server: {1}", uri, resp.Server); | 441 | m_log.ErrorFormat("[Concierge] response from {0} server: {1}", uri, resp.Server); |
442 | 442 | ||
443 | if (resp.ContentLength > 0) | 443 | if (resp.ContentLength > 0) |
444 | { | 444 | { |
445 | StreamReader content = new StreamReader(resp.GetResponseStream()); | 445 | StreamReader content = new StreamReader(resp.GetResponseStream()); |
446 | _log.ErrorFormat("[Concierge] response from {0} content: {1}", uri, content.ReadToEnd()); | 446 | m_log.ErrorFormat("[Concierge] response from {0} content: {1}", uri, content.ReadToEnd()); |
447 | content.Close(); | 447 | content.Close(); |
448 | } | 448 | } |
449 | } | 449 | } |
@@ -456,11 +456,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge | |||
456 | // welcome mechanics: check whether we have a welcomes | 456 | // welcome mechanics: check whether we have a welcomes |
457 | // directory set and wether there is a region specific | 457 | // directory set and wether there is a region specific |
458 | // welcome file there: if yes, send it to the agent | 458 | // welcome file there: if yes, send it to the agent |
459 | if (!String.IsNullOrEmpty(_welcomes)) | 459 | if (!String.IsNullOrEmpty(m_welcomes)) |
460 | { | 460 | { |
461 | string[] welcomes = new string[] { | 461 | string[] welcomes = new string[] { |
462 | Path.Combine(_welcomes, agent.Scene.RegionInfo.RegionName), | 462 | Path.Combine(m_welcomes, agent.Scene.RegionInfo.RegionName), |
463 | Path.Combine(_welcomes, "DEFAULT")}; | 463 | Path.Combine(m_welcomes, "DEFAULT")}; |
464 | foreach (string welcome in welcomes) | 464 | foreach (string welcome in welcomes) |
465 | { | 465 | { |
466 | if (File.Exists(welcome)) | 466 | if (File.Exists(welcome)) |
@@ -470,22 +470,22 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge | |||
470 | string[] welcomeLines = File.ReadAllLines(welcome); | 470 | string[] welcomeLines = File.ReadAllLines(welcome); |
471 | foreach (string l in welcomeLines) | 471 | foreach (string l in welcomeLines) |
472 | { | 472 | { |
473 | AnnounceToAgent(agent, String.Format(l, agent.Name, scene.RegionInfo.RegionName, _whoami)); | 473 | AnnounceToAgent(agent, String.Format(l, agent.Name, scene.RegionInfo.RegionName, m_whoami)); |
474 | } | 474 | } |
475 | } | 475 | } |
476 | catch (IOException ioe) | 476 | catch (IOException ioe) |
477 | { | 477 | { |
478 | _log.ErrorFormat("[Concierge]: run into trouble reading welcome file {0} for region {1} for avatar {2}: {3}", | 478 | m_log.ErrorFormat("[Concierge]: run into trouble reading welcome file {0} for region {1} for avatar {2}: {3}", |
479 | welcome, scene.RegionInfo.RegionName, agent.Name, ioe); | 479 | welcome, scene.RegionInfo.RegionName, agent.Name, ioe); |
480 | } | 480 | } |
481 | catch (FormatException fe) | 481 | catch (FormatException fe) |
482 | { | 482 | { |
483 | _log.ErrorFormat("[Concierge]: welcome file {0} is malformed: {1}", welcome, fe); | 483 | m_log.ErrorFormat("[Concierge]: welcome file {0} is malformed: {1}", welcome, fe); |
484 | } | 484 | } |
485 | } | 485 | } |
486 | return; | 486 | return; |
487 | } | 487 | } |
488 | _log.DebugFormat("[Concierge]: no welcome message for region {0}", scene.RegionInfo.RegionName); | 488 | m_log.DebugFormat("[Concierge]: no welcome message for region {0}", scene.RegionInfo.RegionName); |
489 | } | 489 | } |
490 | } | 490 | } |
491 | 491 | ||
@@ -497,7 +497,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge | |||
497 | // if ((client.Scene is Scene) && (client.Scene as Scene).TryGetAvatar(client.AgentId, out agent)) | 497 | // if ((client.Scene is Scene) && (client.Scene as Scene).TryGetAvatar(client.AgentId, out agent)) |
498 | // AnnounceToAgentsRegion(agent, msg); | 498 | // AnnounceToAgentsRegion(agent, msg); |
499 | // else | 499 | // else |
500 | // _log.DebugFormat("[Concierge]: could not find an agent for client {0}", client.Name); | 500 | // m_log.DebugFormat("[Concierge]: could not find an agent for client {0}", client.Name); |
501 | // } | 501 | // } |
502 | 502 | ||
503 | protected void AnnounceToAgentsRegion(IScene scene, string msg) | 503 | protected void AnnounceToAgentsRegion(IScene scene, string msg) |
@@ -507,7 +507,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge | |||
507 | c.Type = ChatTypeEnum.Say; | 507 | c.Type = ChatTypeEnum.Say; |
508 | c.Channel = 0; | 508 | c.Channel = 0; |
509 | c.Position = PosOfGod; | 509 | c.Position = PosOfGod; |
510 | c.From = _whoami; | 510 | c.From = m_whoami; |
511 | c.Sender = null; | 511 | c.Sender = null; |
512 | c.SenderUUID = UUID.Zero; | 512 | c.SenderUUID = UUID.Zero; |
513 | c.Scene = scene; | 513 | c.Scene = scene; |
@@ -523,12 +523,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge | |||
523 | c.Type = ChatTypeEnum.Say; | 523 | c.Type = ChatTypeEnum.Say; |
524 | c.Channel = 0; | 524 | c.Channel = 0; |
525 | c.Position = PosOfGod; | 525 | c.Position = PosOfGod; |
526 | c.From = _whoami; | 526 | c.From = m_whoami; |
527 | c.Sender = null; | 527 | c.Sender = null; |
528 | c.SenderUUID = UUID.Zero; | 528 | c.SenderUUID = UUID.Zero; |
529 | c.Scene = agent.Scene; | 529 | c.Scene = agent.Scene; |
530 | 530 | ||
531 | agent.ControllingClient.SendChatMessage(msg, (byte) ChatTypeEnum.Say, PosOfGod, _whoami, UUID.Zero, | 531 | agent.ControllingClient.SendChatMessage(msg, (byte) ChatTypeEnum.Say, PosOfGod, m_whoami, UUID.Zero, |
532 | (byte)ChatSourceType.Object, (byte)ChatAudibleLevel.Fully); | 532 | (byte)ChatSourceType.Object, (byte)ChatAudibleLevel.Fully); |
533 | } | 533 | } |
534 | 534 | ||
@@ -546,7 +546,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge | |||
546 | 546 | ||
547 | public XmlRpcResponse XmlRpcUpdateWelcomeMethod(XmlRpcRequest request) | 547 | public XmlRpcResponse XmlRpcUpdateWelcomeMethod(XmlRpcRequest request) |
548 | { | 548 | { |
549 | _log.Info("[Concierge]: processing UpdateWelcome request"); | 549 | m_log.Info("[Concierge]: processing UpdateWelcome request"); |
550 | XmlRpcResponse response = new XmlRpcResponse(); | 550 | XmlRpcResponse response = new XmlRpcResponse(); |
551 | Hashtable responseData = new Hashtable(); | 551 | Hashtable responseData = new Hashtable(); |
552 | 552 | ||
@@ -556,10 +556,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge | |||
556 | checkStringParameters(request, new string[] { "password", "region", "welcome" }); | 556 | checkStringParameters(request, new string[] { "password", "region", "welcome" }); |
557 | 557 | ||
558 | // check password | 558 | // check password |
559 | if (!String.IsNullOrEmpty(_xmlRpcPassword) && | 559 | if (!String.IsNullOrEmpty(m_xmlRpcPassword) && |
560 | (string)requestData["password"] != _xmlRpcPassword) throw new Exception("wrong password"); | 560 | (string)requestData["password"] != m_xmlRpcPassword) throw new Exception("wrong password"); |
561 | 561 | ||
562 | if (String.IsNullOrEmpty(_welcomes)) | 562 | if (String.IsNullOrEmpty(m_welcomes)) |
563 | throw new Exception("welcome templates are not enabled, ask your OpenSim operator to set the \"welcomes\" option in the [Concierge] section of OpenSim.ini"); | 563 | throw new Exception("welcome templates are not enabled, ask your OpenSim operator to set the \"welcomes\" option in the [Concierge] section of OpenSim.ini"); |
564 | 564 | ||
565 | string msg = (string)requestData["welcome"]; | 565 | string msg = (string)requestData["welcome"]; |
@@ -567,17 +567,17 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge | |||
567 | throw new Exception("empty parameter \"welcome\""); | 567 | throw new Exception("empty parameter \"welcome\""); |
568 | 568 | ||
569 | string regionName = (string)requestData["region"]; | 569 | string regionName = (string)requestData["region"]; |
570 | IScene scene = _scenes.Find(delegate(IScene s) { return s.RegionInfo.RegionName == regionName; }); | 570 | IScene scene = m_scenes.Find(delegate(IScene s) { return s.RegionInfo.RegionName == regionName; }); |
571 | if (scene == null) | 571 | if (scene == null) |
572 | throw new Exception(String.Format("unknown region \"{0}\"", regionName)); | 572 | throw new Exception(String.Format("unknown region \"{0}\"", regionName)); |
573 | 573 | ||
574 | if (!_conciergedScenes.Contains(scene)) | 574 | if (!m_conciergedScenes.Contains(scene)) |
575 | throw new Exception(String.Format("region \"{0}\" is not a concierged region.", regionName)); | 575 | throw new Exception(String.Format("region \"{0}\" is not a concierged region.", regionName)); |
576 | 576 | ||
577 | string welcome = Path.Combine(_welcomes, regionName); | 577 | string welcome = Path.Combine(m_welcomes, regionName); |
578 | if (File.Exists(welcome)) | 578 | if (File.Exists(welcome)) |
579 | { | 579 | { |
580 | _log.InfoFormat("[Concierge]: UpdateWelcome: updating existing template \"{0}\"", welcome); | 580 | m_log.InfoFormat("[Concierge]: UpdateWelcome: updating existing template \"{0}\"", welcome); |
581 | string welcomeBackup = String.Format("{0}~", welcome); | 581 | string welcomeBackup = String.Format("{0}~", welcome); |
582 | if (File.Exists(welcomeBackup)) | 582 | if (File.Exists(welcomeBackup)) |
583 | File.Delete(welcomeBackup); | 583 | File.Delete(welcomeBackup); |
@@ -590,14 +590,14 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge | |||
590 | } | 590 | } |
591 | catch (Exception e) | 591 | catch (Exception e) |
592 | { | 592 | { |
593 | _log.InfoFormat("[Concierge]: UpdateWelcome failed: {0}", e.Message); | 593 | m_log.InfoFormat("[Concierge]: UpdateWelcome failed: {0}", e.Message); |
594 | 594 | ||
595 | responseData["success"] = "false"; | 595 | responseData["success"] = "false"; |
596 | responseData["error"] = e.Message; | 596 | responseData["error"] = e.Message; |
597 | 597 | ||
598 | response.Value = responseData; | 598 | response.Value = responseData; |
599 | } | 599 | } |
600 | _log.Debug("[Concierge]: done processing UpdateWelcome request"); | 600 | m_log.Debug("[Concierge]: done processing UpdateWelcome request"); |
601 | return response; | 601 | return response; |
602 | } | 602 | } |
603 | } | 603 | } |