diff options
Diffstat (limited to 'OpenSim/Region/OptionalModules/Avatar/Concierge')
-rw-r--r-- | OpenSim/Region/OptionalModules/Avatar/Concierge/ConciergeModule.cs | 41 |
1 files changed, 16 insertions, 25 deletions
diff --git a/OpenSim/Region/OptionalModules/Avatar/Concierge/ConciergeModule.cs b/OpenSim/Region/OptionalModules/Avatar/Concierge/ConciergeModule.cs index c864993..2fcc477 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Concierge/ConciergeModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Concierge/ConciergeModule.cs | |||
@@ -318,9 +318,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge | |||
318 | { | 318 | { |
319 | Scene scene = client.Scene as Scene; | 319 | Scene scene = client.Scene as Scene; |
320 | m_log.DebugFormat("[Concierge]: {0} logs off from {1}", client.Name, scene.RegionInfo.RegionName); | 320 | m_log.DebugFormat("[Concierge]: {0} logs off from {1}", client.Name, scene.RegionInfo.RegionName); |
321 | List<ScenePresence> avs = scene.GetAvatars(); | 321 | AnnounceToAgentsRegion(scene, String.Format(m_announceLeaving, client.Name, scene.RegionInfo.RegionName, scene.GetRootAgentCount())); |
322 | AnnounceToAgentsRegion(scene, String.Format(m_announceLeaving, client.Name, scene.RegionInfo.RegionName, avs.Count)); | 322 | UpdateBroker(scene); |
323 | UpdateBroker(scene, avs); | ||
324 | } | 323 | } |
325 | } | 324 | } |
326 | 325 | ||
@@ -331,11 +330,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge | |||
331 | { | 330 | { |
332 | Scene scene = agent.Scene; | 331 | Scene scene = agent.Scene; |
333 | m_log.DebugFormat("[Concierge]: {0} enters {1}", agent.Name, scene.RegionInfo.RegionName); | 332 | m_log.DebugFormat("[Concierge]: {0} enters {1}", agent.Name, scene.RegionInfo.RegionName); |
334 | List<ScenePresence> avs = scene.GetAvatars(); | ||
335 | WelcomeAvatar(agent, scene); | 333 | WelcomeAvatar(agent, scene); |
336 | AnnounceToAgentsRegion(scene, String.Format(m_announceEntering, agent.Name, | 334 | AnnounceToAgentsRegion(scene, String.Format(m_announceEntering, agent.Name, |
337 | scene.RegionInfo.RegionName, avs.Count)); | 335 | scene.RegionInfo.RegionName, scene.GetRootAgentCount())); |
338 | UpdateBroker(scene, avs); | 336 | UpdateBroker(scene); |
339 | } | 337 | } |
340 | } | 338 | } |
341 | 339 | ||
@@ -346,10 +344,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge | |||
346 | { | 344 | { |
347 | Scene scene = agent.Scene; | 345 | Scene scene = agent.Scene; |
348 | m_log.DebugFormat("[Concierge]: {0} leaves {1}", agent.Name, scene.RegionInfo.RegionName); | 346 | m_log.DebugFormat("[Concierge]: {0} leaves {1}", agent.Name, scene.RegionInfo.RegionName); |
349 | List<ScenePresence> avs = scene.GetAvatars(); | ||
350 | AnnounceToAgentsRegion(scene, String.Format(m_announceLeaving, agent.Name, | 347 | AnnounceToAgentsRegion(scene, String.Format(m_announceLeaving, agent.Name, |
351 | scene.RegionInfo.RegionName, avs.Count)); | 348 | scene.RegionInfo.RegionName, scene.GetRootAgentCount())); |
352 | UpdateBroker(scene, avs); | 349 | UpdateBroker(scene); |
353 | } | 350 | } |
354 | } | 351 | } |
355 | 352 | ||
@@ -368,7 +365,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge | |||
368 | } | 365 | } |
369 | } | 366 | } |
370 | 367 | ||
371 | protected void UpdateBroker(IScene scene, List<ScenePresence> avatars) | 368 | protected void UpdateBroker(Scene scene) |
372 | { | 369 | { |
373 | if (String.IsNullOrEmpty(m_brokerURI)) | 370 | if (String.IsNullOrEmpty(m_brokerURI)) |
374 | return; | 371 | return; |
@@ -377,24 +374,18 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge | |||
377 | 374 | ||
378 | // create XML sniplet | 375 | // create XML sniplet |
379 | StringBuilder list = new StringBuilder(); | 376 | StringBuilder list = new StringBuilder(); |
380 | if (0 == avatars.Count) | 377 | list.Append(String.Format("<avatars count=\"{0}\" region_name=\"{1}\" region_uuid=\"{2}\" timestamp=\"{3}\">\n", |
381 | { | 378 | scene.GetRootAgentCount(), scene.RegionInfo.RegionName, |
382 | list.Append(String.Format("<avatars count=\"0\" region_name=\"{0}\" region_uuid=\"{1}\" timestamp=\"{2}\" />", | 379 | scene.RegionInfo.RegionID, |
383 | scene.RegionInfo.RegionName, scene.RegionInfo.RegionID, | ||
384 | DateTime.UtcNow.ToString("s"))); | 380 | DateTime.UtcNow.ToString("s"))); |
385 | } | 381 | scene.ForEachScenePresence(delegate(ScenePresence sp) |
386 | else | ||
387 | { | 382 | { |
388 | list.Append(String.Format("<avatars count=\"{0}\" region_name=\"{1}\" region_uuid=\"{2}\" timestamp=\"{3}\">\n", | 383 | if (!sp.IsChildAgent) |
389 | avatars.Count, scene.RegionInfo.RegionName, | ||
390 | scene.RegionInfo.RegionID, | ||
391 | DateTime.UtcNow.ToString("s"))); | ||
392 | foreach (ScenePresence av in avatars) | ||
393 | { | 384 | { |
394 | list.Append(String.Format(" <avatar name=\"{0}\" uuid=\"{1}\" />\n", av.Name, av.UUID)); | 385 | list.Append(String.Format(" <avatar name=\"{0}\" uuid=\"{1}\" />\n", sp.Name, sp.UUID)); |
386 | list.Append("</avatars>"); | ||
395 | } | 387 | } |
396 | list.Append("</avatars>"); | 388 | }); |
397 | } | ||
398 | string payload = list.ToString(); | 389 | string payload = list.ToString(); |
399 | 390 | ||
400 | // post via REST to broker | 391 | // post via REST to broker |
@@ -529,7 +520,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge | |||
529 | // protected void AnnounceToAgentsRegion(Scene scene, string msg) | 520 | // protected void AnnounceToAgentsRegion(Scene scene, string msg) |
530 | // { | 521 | // { |
531 | // ScenePresence agent = null; | 522 | // ScenePresence agent = null; |
532 | // if ((client.Scene is Scene) && (client.Scene as Scene).TryGetAvatar(client.AgentId, out agent)) | 523 | // if ((client.Scene is Scene) && (client.Scene as Scene).TryGetScenePresence(client.AgentId, out agent)) |
533 | // AnnounceToAgentsRegion(agent, msg); | 524 | // AnnounceToAgentsRegion(agent, msg); |
534 | // else | 525 | // else |
535 | // m_log.DebugFormat("[Concierge]: could not find an agent for client {0}", client.Name); | 526 | // m_log.DebugFormat("[Concierge]: could not find an agent for client {0}", client.Name); |