diff options
Diffstat (limited to 'OpenSim/Services/PresenceService/PresenceService.cs')
-rw-r--r-- | OpenSim/Services/PresenceService/PresenceService.cs | 48 |
1 files changed, 22 insertions, 26 deletions
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 | |||
50 | { | 50 | { |
51 | } | 51 | } |
52 | 52 | ||
53 | public bool LoginAgent(UUID principalID, UUID sessionID, | 53 | public bool LoginAgent(string userID, UUID sessionID, |
54 | UUID secureSessionID) | 54 | UUID secureSessionID) |
55 | { | 55 | { |
56 | // We have just logged in. If there is any info in the table | 56 | // We have just logged in. If there is any info in the table |
@@ -58,7 +58,7 @@ namespace OpenSim.Services.PresenceService | |||
58 | // | 58 | // |
59 | PresenceData data = new PresenceData(); | 59 | PresenceData data = new PresenceData(); |
60 | 60 | ||
61 | data.PrincipalID = principalID; | 61 | data.UserID = userID; |
62 | data.RegionID = UUID.Zero; | 62 | data.RegionID = UUID.Zero; |
63 | data.SessionID = sessionID; | 63 | data.SessionID = sessionID; |
64 | data.Data["SecureSessionID"] = secureSessionID.ToString(); | 64 | data.Data["SecureSessionID"] = secureSessionID.ToString(); |
@@ -105,7 +105,7 @@ namespace OpenSim.Services.PresenceService | |||
105 | if (data == null) | 105 | if (data == null) |
106 | return null; | 106 | return null; |
107 | 107 | ||
108 | ret.PrincipalID = data.PrincipalID; | 108 | ret.UserID = data.UserID; |
109 | ret.RegionID = data.RegionID; | 109 | ret.RegionID = data.RegionID; |
110 | ret.Online = bool.Parse(data.Data["Online"]); | 110 | ret.Online = bool.Parse(data.Data["Online"]); |
111 | ret.Login = Util.ToDateTime(Convert.ToInt32(data.Data["Login"])); | 111 | ret.Login = Util.ToDateTime(Convert.ToInt32(data.Data["Login"])); |
@@ -116,34 +116,30 @@ namespace OpenSim.Services.PresenceService | |||
116 | return ret; | 116 | return ret; |
117 | } | 117 | } |
118 | 118 | ||
119 | public PresenceInfo[] GetAgents(string[] principalIDs) | 119 | public PresenceInfo[] GetAgents(string[] userIDs) |
120 | { | 120 | { |
121 | List<PresenceInfo> info = new List<PresenceInfo>(); | 121 | List<PresenceInfo> info = new List<PresenceInfo>(); |
122 | 122 | ||
123 | foreach (string principalIDStr in principalIDs) | 123 | foreach (string userIDStr in userIDs) |
124 | { | 124 | { |
125 | UUID principalID = UUID.Zero; | 125 | PresenceData[] data = m_Database.Get("UserID", |
126 | if (UUID.TryParse(principalIDStr, out principalID)) | 126 | userIDStr); |
127 | |||
128 | foreach (PresenceData d in data) | ||
127 | { | 129 | { |
128 | PresenceData[] data = m_Database.Get("PrincipalID", | 130 | PresenceInfo ret = new PresenceInfo(); |
129 | principalID.ToString()); | 131 | |
130 | 132 | ret.UserID = d.UserID; | |
131 | foreach (PresenceData d in data) | 133 | ret.RegionID = d.RegionID; |
132 | { | 134 | ret.Online = bool.Parse(d.Data["Online"]); |
133 | PresenceInfo ret = new PresenceInfo(); | 135 | ret.Login = Util.ToDateTime(Convert.ToInt32( |
134 | 136 | d.Data["Login"])); | |
135 | ret.PrincipalID = d.PrincipalID; | 137 | ret.Logout = Util.ToDateTime(Convert.ToInt32( |
136 | ret.RegionID = d.RegionID; | 138 | d.Data["Logout"])); |
137 | ret.Online = bool.Parse(d.Data["Online"]); | 139 | ret.Position = Vector3.Parse(d.Data["Position"]); |
138 | ret.Login = Util.ToDateTime(Convert.ToInt32( | 140 | ret.LookAt = Vector3.Parse(d.Data["LookAt"]); |
139 | d.Data["Login"])); | 141 | |
140 | ret.Logout = Util.ToDateTime(Convert.ToInt32( | 142 | info.Add(ret); |
141 | d.Data["Logout"])); | ||
142 | ret.Position = Vector3.Parse(d.Data["Position"]); | ||
143 | ret.LookAt = Vector3.Parse(d.Data["LookAt"]); | ||
144 | |||
145 | info.Add(ret); | ||
146 | } | ||
147 | } | 143 | } |
148 | } | 144 | } |
149 | 145 | ||