diff options
Diffstat (limited to 'OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs')
-rw-r--r-- | OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs index 211b775..2a34379 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs | |||
@@ -121,7 +121,7 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
121 | if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("=")) | 121 | if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("=")) |
122 | serviceUrl = serviceUrl + '/'; | 122 | serviceUrl = serviceUrl + '/'; |
123 | m_serverUrl = serviceUrl; | 123 | m_serverUrl = serviceUrl; |
124 | m_activityDetector = new SimianActivityDetector(this); | 124 | m_activityDetector = new SimianActivityDetector(this); |
125 | m_Enabled = true; | 125 | m_Enabled = true; |
126 | } | 126 | } |
127 | } | 127 | } |
@@ -210,7 +210,7 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
210 | m_log.WarnFormat("[SIMIAN PRESENCE CONNECTOR]: Failed to retrieve session {0}: {1}",sessionID.ToString(),sessionResponse["Message"].AsString()); | 210 | m_log.WarnFormat("[SIMIAN PRESENCE CONNECTOR]: Failed to retrieve session {0}: {1}",sessionID.ToString(),sessionResponse["Message"].AsString()); |
211 | return null; | 211 | return null; |
212 | } | 212 | } |
213 | 213 | ||
214 | UUID userID = sessionResponse["UserID"].AsUUID(); | 214 | UUID userID = sessionResponse["UserID"].AsUUID(); |
215 | OSDMap userResponse = GetUserData(userID); | 215 | OSDMap userResponse = GetUserData(userID); |
216 | if (userResponse == null) | 216 | if (userResponse == null) |
@@ -222,6 +222,18 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
222 | return ResponseToPresenceInfo(sessionResponse); | 222 | return ResponseToPresenceInfo(sessionResponse); |
223 | } | 223 | } |
224 | 224 | ||
225 | public PresenceInfo GetAgentByUser(UUID userID) | ||
226 | { | ||
227 | OSDMap userResponse = GetUserData(userID); | ||
228 | if (userResponse == null) | ||
229 | { | ||
230 | m_log.WarnFormat("[SIMIAN PRESENCE CONNECTOR]: Failed to retrieve user data for {0}: {1}",userID.ToString(),userResponse["Message"].AsString()); | ||
231 | return null; | ||
232 | } | ||
233 | |||
234 | return ResponseToPresenceInfo(userResponse); | ||
235 | } | ||
236 | |||
225 | public PresenceInfo[] GetAgents(string[] userIDs) | 237 | public PresenceInfo[] GetAgents(string[] userIDs) |
226 | { | 238 | { |
227 | List<PresenceInfo> presences = new List<PresenceInfo>(); | 239 | List<PresenceInfo> presences = new List<PresenceInfo>(); |
@@ -238,7 +250,7 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
238 | m_log.WarnFormat("[SIMIAN PRESENCE CONNECTOR]: Failed to retrieve sessions: {0}",sessionListResponse["Message"].AsString()); | 250 | m_log.WarnFormat("[SIMIAN PRESENCE CONNECTOR]: Failed to retrieve sessions: {0}",sessionListResponse["Message"].AsString()); |
239 | return null; | 251 | return null; |
240 | } | 252 | } |
241 | 253 | ||
242 | OSDArray sessionList = sessionListResponse["Sessions"] as OSDArray; | 254 | OSDArray sessionList = sessionListResponse["Sessions"] as OSDArray; |
243 | for (int i = 0; i < sessionList.Count; i++) | 255 | for (int i = 0; i < sessionList.Count; i++) |
244 | { | 256 | { |
@@ -311,7 +323,7 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
311 | 323 | ||
312 | public GridUserInfo GetGridUserInfo(string user) | 324 | public GridUserInfo GetGridUserInfo(string user) |
313 | { | 325 | { |
314 | // m_log.DebugFormat("[SIMIAN PRESENCE CONNECTOR]: Requesting session data for agent " + user); | 326 | // m_log.DebugFormat("[SIMIAN PRESENCE CONNECTOR]: Requesting session data for agent " + user); |
315 | 327 | ||
316 | UUID userID = new UUID(user); | 328 | UUID userID = new UUID(user); |
317 | OSDMap userResponse = GetUserData(userID); | 329 | OSDMap userResponse = GetUserData(userID); |
@@ -421,7 +433,7 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
421 | 433 | ||
422 | return null; | 434 | return null; |
423 | } | 435 | } |
424 | 436 | ||
425 | private string SerializeLocation(UUID regionID, Vector3 position, Vector3 lookAt) | 437 | private string SerializeLocation(UUID regionID, Vector3 position, Vector3 lookAt) |
426 | { | 438 | { |
427 | return "{" + String.Format("\"SceneID\":\"{0}\",\"Position\":\"{1}\",\"LookAt\":\"{2}\"", regionID, position, lookAt) + "}"; | 439 | return "{" + String.Format("\"SceneID\":\"{0}\",\"Position\":\"{1}\",\"LookAt\":\"{2}\"", regionID, position, lookAt) + "}"; |