From 464ecc15a09dc8165c0a7a589e69c368666f30b6 Mon Sep 17 00:00:00 2001 From: Dr Scofield Date: Mon, 26 Jan 2009 21:31:02 +0000 Subject: [PATCH] starting draft attendee list notification support. --- .../Avatar/Concierge/ConciergeModule.cs | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/OpenSim/Region/Environment/Modules/Avatar/Concierge/ConciergeModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Concierge/ConciergeModule.cs index 023dc33ab2..38aaf729b2 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Concierge/ConciergeModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Concierge/ConciergeModule.cs @@ -65,6 +65,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Concierge private string _announceEntering = "{0} enters {1} (now {2} visitors in this region)"; private string _announceLeaving = "{0} leaves {1} (back to {2} visitors in this region)"; private string _xmlRpcPassword = String.Empty; + private string _brokerURI = String.Empty; internal object _syncy = new object(); @@ -118,6 +119,8 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Concierge _announceEntering = _config.GetString("announce_entering", _announceEntering); _announceLeaving = _config.GetString("announce_leaving", _announceLeaving); _xmlRpcPassword = _config.GetString("password", _xmlRpcPassword); + _brokerURI = _config.GetString("broker", _brokerURI); + _log.InfoFormat("[Concierge] reporting as \"{0}\" to our users", _whoami); // calculate regions Regex @@ -274,6 +277,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Concierge RemoveFromAttendeeList(client.AgentId, client.Name, client.Scene); AnnounceToAgentsRegion(client.Scene, String.Format(_announceLeaving, client.Name, client.Scene.RegionInfo.RegionName, _sceneAttendees[client.Scene].Count)); + UpdateBroker(client.Scene); } } @@ -287,6 +291,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Concierge WelcomeAvatar(agent, agent.Scene); AnnounceToAgentsRegion(agent.Scene, String.Format(_announceEntering, agent.Name, agent.Scene.RegionInfo.RegionName, _sceneAttendees[agent.Scene].Count)); + UpdateBroker(agent.Scene); } } @@ -299,6 +304,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Concierge RemoveFromAttendeeList(agent.UUID, agent.Name, agent.Scene); AnnounceToAgentsRegion(agent.Scene, String.Format(_announceLeaving, agent.Name, agent.Scene.RegionInfo.RegionName, _sceneAttendees[agent.Scene].Count)); + UpdateBroker(agent.Scene); } } @@ -334,6 +340,27 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Concierge } } + protected void UpdateBroker(IScene scene) + { + if (String.IsNullOrEmpty(_brokerURI)) + return; + + // get attendee list for the scene + List attendees; + lock (_sceneAttendees) + { + if (!_sceneAttendees.ContainsKey(scene)) + { + _log.DebugFormat("[Concierge]: attendee list missing for region {0}", scene.RegionInfo.RegionName); + return; + } + + attendees = _sceneAttendees[scene]; + } + + // post via REST to broker + } + protected void WelcomeAvatar(ScenePresence agent, Scene scene) { // welcome mechanics: check whether we have a welcomes