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[] --- .../Services/PresenceService/PresenceService.cs | 42 ++++++++++++---------- 1 file changed, 23 insertions(+), 19 deletions(-) (limited to 'OpenSim/Services/PresenceService') 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