From b8dfccb2272e12942f5364fa327ffd721292d8ad Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 27 Dec 2009 16:07:16 -0800 Subject: Changed GetAgents to take string[] instead of UUID[] --- .../Presence/LocalPresenceServiceConnector.cs | 4 +-- OpenSim/Services/Interfaces/IPresenceService.cs | 2 +- .../Services/PresenceService/PresenceService.cs | 42 ++++++++++++---------- 3 files changed, 26 insertions(+), 22 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/LocalPresenceServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/LocalPresenceServiceConnector.cs index 0012f0a..24362c7 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/LocalPresenceServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/LocalPresenceServiceConnector.cs @@ -81,7 +81,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence if (serviceDll == String.Empty) { - m_log.Error("[LOCAL PRESENCE CONNECTOR]: No LocalServiceModule named in section InventoryService"); + m_log.Error("[LOCAL PRESENCE CONNECTOR]: No LocalServiceModule named in section PresenceService"); return; } @@ -176,7 +176,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence return m_PresenceService.GetAgent(sessionID); } - public PresenceInfo[] GetAgents(UUID[] principalIDs) + public PresenceInfo[] GetAgents(string[] principalIDs) { return m_PresenceService.GetAgents(principalIDs); } diff --git a/OpenSim/Services/Interfaces/IPresenceService.cs b/OpenSim/Services/Interfaces/IPresenceService.cs index 70d4b28..1cda13c 100644 --- a/OpenSim/Services/Interfaces/IPresenceService.cs +++ b/OpenSim/Services/Interfaces/IPresenceService.cs @@ -52,6 +52,6 @@ namespace OpenSim.Services.Interfaces bool ReportAgent(UUID sessionID, UUID regionID, Vector3 position, Vector3 lookAt); PresenceInfo GetAgent(UUID sessionID); - PresenceInfo[] GetAgents(UUID[] PrincipalIDs); + PresenceInfo[] GetAgents(string[] principalIDs); } } diff --git a/OpenSim/Services/PresenceService/PresenceService.cs b/OpenSim/Services/PresenceService/PresenceService.cs index 6542c25..0529d3d 100644 --- a/OpenSim/Services/PresenceService/PresenceService.cs +++ b/OpenSim/Services/PresenceService/PresenceService.cs @@ -116,30 +116,34 @@ namespace OpenSim.Services.PresenceService return ret; } - public PresenceInfo[] GetAgents(UUID[] PrincipalIDs) + public PresenceInfo[] GetAgents(string[] principalIDs) { List info = new List(); - foreach (UUID principalID in PrincipalIDs) + foreach (string principalIDStr in principalIDs) { - PresenceData[] data = m_Database.Get("PrincipalID", - principalID.ToString()); - - foreach (PresenceData d in data) + UUID principalID = UUID.Zero; + if (UUID.TryParse(principalIDStr, out principalID)) { - PresenceInfo ret = new PresenceInfo(); - - ret.PrincipalID = d.PrincipalID; - ret.RegionID = d.RegionID; - ret.Online = bool.Parse(d.Data["Online"]); - ret.Login = Util.ToDateTime(Convert.ToInt32( - d.Data["Login"])); - ret.Logout = Util.ToDateTime(Convert.ToInt32( - d.Data["Logout"])); - ret.Position = Vector3.Parse(d.Data["Position"]); - ret.LookAt = Vector3.Parse(d.Data["LookAt"]); - - info.Add(ret); + PresenceData[] data = m_Database.Get("PrincipalID", + principalID.ToString()); + + foreach (PresenceData d in data) + { + PresenceInfo ret = new PresenceInfo(); + + ret.PrincipalID = d.PrincipalID; + ret.RegionID = d.RegionID; + ret.Online = bool.Parse(d.Data["Online"]); + ret.Login = Util.ToDateTime(Convert.ToInt32( + d.Data["Login"])); + ret.Logout = Util.ToDateTime(Convert.ToInt32( + d.Data["Logout"])); + ret.Position = Vector3.Parse(d.Data["Position"]); + ret.LookAt = Vector3.Parse(d.Data["LookAt"]); + + info.Add(ret); + } } } -- cgit v1.1