From 92a40129b5dfde0d8ef798941f5efb31ca3a73fd Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 28 Dec 2009 17:34:42 +0000 Subject: Database and presence changes. Untested --- .../Services/PresenceService/PresenceService.cs | 48 ++++++++++------------ .../PresenceService/PresenceServiceBase.cs | 2 +- 2 files changed, 23 insertions(+), 27 deletions(-) (limited to 'OpenSim/Services/PresenceService') diff --git a/OpenSim/Services/PresenceService/PresenceService.cs b/OpenSim/Services/PresenceService/PresenceService.cs index 0529d3d..fe36bd0 100644 --- a/OpenSim/Services/PresenceService/PresenceService.cs +++ b/OpenSim/Services/PresenceService/PresenceService.cs @@ -50,7 +50,7 @@ namespace OpenSim.Services.PresenceService { } - public bool LoginAgent(UUID principalID, UUID sessionID, + public bool LoginAgent(string userID, UUID sessionID, UUID secureSessionID) { // We have just logged in. If there is any info in the table @@ -58,7 +58,7 @@ namespace OpenSim.Services.PresenceService // PresenceData data = new PresenceData(); - data.PrincipalID = principalID; + data.UserID = userID; data.RegionID = UUID.Zero; data.SessionID = sessionID; data.Data["SecureSessionID"] = secureSessionID.ToString(); @@ -105,7 +105,7 @@ namespace OpenSim.Services.PresenceService if (data == null) return null; - ret.PrincipalID = data.PrincipalID; + ret.UserID = data.UserID; ret.RegionID = data.RegionID; ret.Online = bool.Parse(data.Data["Online"]); ret.Login = Util.ToDateTime(Convert.ToInt32(data.Data["Login"])); @@ -116,34 +116,30 @@ namespace OpenSim.Services.PresenceService return ret; } - public PresenceInfo[] GetAgents(string[] principalIDs) + public PresenceInfo[] GetAgents(string[] userIDs) { List info = new List(); - foreach (string principalIDStr in principalIDs) + foreach (string userIDStr in userIDs) { - UUID principalID = UUID.Zero; - if (UUID.TryParse(principalIDStr, out principalID)) + PresenceData[] data = m_Database.Get("UserID", + userIDStr); + + foreach (PresenceData d in data) { - 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); - } + PresenceInfo ret = new PresenceInfo(); + + ret.UserID = d.UserID; + 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); } } diff --git a/OpenSim/Services/PresenceService/PresenceServiceBase.cs b/OpenSim/Services/PresenceService/PresenceServiceBase.cs index 60a246b..41e2d9c 100644 --- a/OpenSim/Services/PresenceService/PresenceServiceBase.cs +++ b/OpenSim/Services/PresenceService/PresenceServiceBase.cs @@ -44,7 +44,7 @@ namespace OpenSim.Services.PresenceService { string dllName = String.Empty; string connString = String.Empty; - string realm = "agents"; + string realm = "Presence"; // // Try reading the [DatabaseService] section, if it exists -- cgit v1.1