aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs
diff options
context:
space:
mode:
authorMelanie2010-03-30 21:34:27 +0100
committerMelanie2010-03-30 21:34:27 +0100
commit5693870fe26fae35a28f2d5103780434f4f40e57 (patch)
tree0e070fb6f11ab8763ac4f1f9a851a0061101d4d6 /OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs
parentMerge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/ca... (diff)
parentminor: commented out code removal (diff)
downloadopensim-SC-5693870fe26fae35a28f2d5103780434f4f40e57.zip
opensim-SC-5693870fe26fae35a28f2d5103780434f4f40e57.tar.gz
opensim-SC-5693870fe26fae35a28f2d5103780434f4f40e57.tar.bz2
opensim-SC-5693870fe26fae35a28f2d5103780434f4f40e57.tar.xz
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs')
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs52
1 files changed, 26 insertions, 26 deletions
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs
index 5e0f7c2..696be94 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs
@@ -109,14 +109,14 @@ namespace OpenSim.Services.Connectors.SimianGrid
109 IConfig gridConfig = source.Configs["PresenceService"]; 109 IConfig gridConfig = source.Configs["PresenceService"];
110 if (gridConfig == null) 110 if (gridConfig == null)
111 { 111 {
112 m_log.Error("[PRESENCE CONNECTOR]: PresenceService missing from OpenSim.ini"); 112 m_log.Error("[SIMIAN PRESENCE CONNECTOR]: PresenceService missing from OpenSim.ini");
113 throw new Exception("Presence connector init error"); 113 throw new Exception("Presence connector init error");
114 } 114 }
115 115
116 string serviceUrl = gridConfig.GetString("PresenceServerURI"); 116 string serviceUrl = gridConfig.GetString("PresenceServerURI");
117 if (String.IsNullOrEmpty(serviceUrl)) 117 if (String.IsNullOrEmpty(serviceUrl))
118 { 118 {
119 m_log.Error("[PRESENCE CONNECTOR]: No PresenceServerURI in section PresenceService"); 119 m_log.Error("[SIMIAN PRESENCE CONNECTOR]: No PresenceServerURI in section PresenceService");
120 throw new Exception("Presence connector init error"); 120 throw new Exception("Presence connector init error");
121 } 121 }
122 122
@@ -128,7 +128,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
128 128
129 public bool LoginAgent(string userID, UUID sessionID, UUID secureSessionID) 129 public bool LoginAgent(string userID, UUID sessionID, UUID secureSessionID)
130 { 130 {
131 m_log.ErrorFormat("[PRESENCE CONNECTOR]: Login requested, UserID={0}, SessionID={1}, SecureSessionID={2}", 131 m_log.ErrorFormat("[SIMIAN PRESENCE CONNECTOR]: Login requested, UserID={0}, SessionID={1}, SecureSessionID={2}",
132 userID, sessionID, secureSessionID); 132 userID, sessionID, secureSessionID);
133 133
134 NameValueCollection requestArgs = new NameValueCollection 134 NameValueCollection requestArgs = new NameValueCollection
@@ -146,14 +146,14 @@ namespace OpenSim.Services.Connectors.SimianGrid
146 bool success = response["Success"].AsBoolean(); 146 bool success = response["Success"].AsBoolean();
147 147
148 if (!success) 148 if (!success)
149 m_log.Warn("[PRESENCE CONNECTOR]: Failed to login agent " + userID + ": " + response["Message"].AsString()); 149 m_log.Warn("[SIMIAN PRESENCE CONNECTOR]: Failed to login agent " + userID + ": " + response["Message"].AsString());
150 150
151 return success; 151 return success;
152 } 152 }
153 153
154 public bool LogoutAgent(UUID sessionID, Vector3 position, Vector3 lookAt) 154 public bool LogoutAgent(UUID sessionID, Vector3 position, Vector3 lookAt)
155 { 155 {
156 m_log.InfoFormat("[PRESENCE CONNECTOR]: Logout requested for agent with sessionID " + sessionID); 156 m_log.InfoFormat("[SIMIAN PRESENCE CONNECTOR]: Logout requested for agent with sessionID " + sessionID);
157 157
158 NameValueCollection requestArgs = new NameValueCollection 158 NameValueCollection requestArgs = new NameValueCollection
159 { 159 {
@@ -165,14 +165,14 @@ namespace OpenSim.Services.Connectors.SimianGrid
165 bool success = response["Success"].AsBoolean(); 165 bool success = response["Success"].AsBoolean();
166 166
167 if (!success) 167 if (!success)
168 m_log.Warn("[PRESENCE CONNECTOR]: Failed to logout agent with sessionID " + sessionID + ": " + response["Message"].AsString()); 168 m_log.Warn("[SIMIAN PRESENCE CONNECTOR]: Failed to logout agent with sessionID " + sessionID + ": " + response["Message"].AsString());
169 169
170 return success; 170 return success;
171 } 171 }
172 172
173 public bool LogoutRegionAgents(UUID regionID) 173 public bool LogoutRegionAgents(UUID regionID)
174 { 174 {
175 m_log.InfoFormat("[PRESENCE CONNECTOR]: Logout requested for all agents in region " + regionID); 175 m_log.InfoFormat("[SIMIAN PRESENCE CONNECTOR]: Logout requested for all agents in region " + regionID);
176 176
177 NameValueCollection requestArgs = new NameValueCollection 177 NameValueCollection requestArgs = new NameValueCollection
178 { 178 {
@@ -184,14 +184,14 @@ namespace OpenSim.Services.Connectors.SimianGrid
184 bool success = response["Success"].AsBoolean(); 184 bool success = response["Success"].AsBoolean();
185 185
186 if (!success) 186 if (!success)
187 m_log.Warn("[PRESENCE CONNECTOR]: Failed to logout agents from region " + regionID + ": " + response["Message"].AsString()); 187 m_log.Warn("[SIMIAN PRESENCE CONNECTOR]: Failed to logout agents from region " + regionID + ": " + response["Message"].AsString());
188 188
189 return success; 189 return success;
190 } 190 }
191 191
192 public bool ReportAgent(UUID sessionID, UUID regionID, Vector3 position, Vector3 lookAt) 192 public bool ReportAgent(UUID sessionID, UUID regionID, Vector3 position, Vector3 lookAt)
193 { 193 {
194 //m_log.DebugFormat("[PRESENCE CONNECTOR]: Updating session data for agent with sessionID " + sessionID); 194 //m_log.DebugFormat("[SIMIAN PRESENCE CONNECTOR]: Updating session data for agent with sessionID " + sessionID);
195 195
196 NameValueCollection requestArgs = new NameValueCollection 196 NameValueCollection requestArgs = new NameValueCollection
197 { 197 {
@@ -206,14 +206,14 @@ namespace OpenSim.Services.Connectors.SimianGrid
206 bool success = response["Success"].AsBoolean(); 206 bool success = response["Success"].AsBoolean();
207 207
208 if (!success) 208 if (!success)
209 m_log.Warn("[PRESENCE CONNECTOR]: Failed to update agent session " + sessionID + ": " + response["Message"].AsString()); 209 m_log.Warn("[SIMIAN PRESENCE CONNECTOR]: Failed to update agent session " + sessionID + ": " + response["Message"].AsString());
210 210
211 return success; 211 return success;
212 } 212 }
213 213
214 public PresenceInfo GetAgent(UUID sessionID) 214 public PresenceInfo GetAgent(UUID sessionID)
215 { 215 {
216 m_log.DebugFormat("[PRESENCE CONNECTOR]: Requesting session data for agent with sessionID " + sessionID); 216 m_log.DebugFormat("[SIMIAN PRESENCE CONNECTOR]: Requesting session data for agent with sessionID " + sessionID);
217 217
218 NameValueCollection requestArgs = new NameValueCollection 218 NameValueCollection requestArgs = new NameValueCollection
219 { 219 {
@@ -225,7 +225,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
225 if (sessionResponse["Success"].AsBoolean()) 225 if (sessionResponse["Success"].AsBoolean())
226 { 226 {
227 UUID userID = sessionResponse["UserID"].AsUUID(); 227 UUID userID = sessionResponse["UserID"].AsUUID();
228 m_log.DebugFormat("[PRESENCE CONNECTOR]: Requesting user data for " + userID); 228 m_log.DebugFormat("[SIMIAN PRESENCE CONNECTOR]: Requesting user data for " + userID);
229 229
230 requestArgs = new NameValueCollection 230 requestArgs = new NameValueCollection
231 { 231 {
@@ -237,11 +237,11 @@ namespace OpenSim.Services.Connectors.SimianGrid
237 if (userResponse["Success"].AsBoolean()) 237 if (userResponse["Success"].AsBoolean())
238 return ResponseToPresenceInfo(sessionResponse, userResponse); 238 return ResponseToPresenceInfo(sessionResponse, userResponse);
239 else 239 else
240 m_log.Warn("[PRESENCE CONNECTOR]: Failed to retrieve user data for " + userID + ": " + userResponse["Message"].AsString()); 240 m_log.Warn("[SIMIAN PRESENCE CONNECTOR]: Failed to retrieve user data for " + userID + ": " + userResponse["Message"].AsString());
241 } 241 }
242 else 242 else
243 { 243 {
244 m_log.Warn("[PRESENCE CONNECTOR]: Failed to retrieve session " + sessionID + ": " + sessionResponse["Message"].AsString()); 244 m_log.Warn("[SIMIAN PRESENCE CONNECTOR]: Failed to retrieve session " + sessionID + ": " + sessionResponse["Message"].AsString());
245 } 245 }
246 246
247 return null; 247 return null;
@@ -263,7 +263,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
263 263
264 public bool SetHomeLocation(string userID, UUID regionID, Vector3 position, Vector3 lookAt) 264 public bool SetHomeLocation(string userID, UUID regionID, Vector3 position, Vector3 lookAt)
265 { 265 {
266 m_log.DebugFormat("[PRESENCE CONNECTOR]: Setting home location for user " + userID); 266 m_log.DebugFormat("[SIMIAN PRESENCE CONNECTOR]: Setting home location for user " + userID);
267 267
268 NameValueCollection requestArgs = new NameValueCollection 268 NameValueCollection requestArgs = new NameValueCollection
269 { 269 {
@@ -276,7 +276,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
276 bool success = response["Success"].AsBoolean(); 276 bool success = response["Success"].AsBoolean();
277 277
278 if (!success) 278 if (!success)
279 m_log.Warn("[PRESENCE CONNECTOR]: Failed to set home location for " + userID + ": " + response["Message"].AsString()); 279 m_log.Warn("[SIMIAN PRESENCE CONNECTOR]: Failed to set home location for " + userID + ": " + response["Message"].AsString());
280 280
281 return success; 281 return success;
282 } 282 }
@@ -301,7 +301,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
301 private void SignificantClientMovementHandler(IClientAPI client) 301 private void SignificantClientMovementHandler(IClientAPI client)
302 { 302 {
303 ScenePresence sp; 303 ScenePresence sp;
304 if (client.Scene is Scene && ((Scene)client.Scene).TryGetAvatar(client.AgentId, out sp)) 304 if (client.Scene is Scene && ((Scene)client.Scene).TryGetScenePresence(client.AgentId, out sp))
305 ReportAgent(sp.ControllingClient.SessionId, sp.Scene.RegionInfo.RegionID, sp.AbsolutePosition, sp.Lookat); 305 ReportAgent(sp.ControllingClient.SessionId, sp.Scene.RegionInfo.RegionID, sp.AbsolutePosition, sp.Lookat);
306 } 306 }
307 307
@@ -312,7 +312,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
312 client.OnConnectionClosed -= LogoutHandler; 312 client.OnConnectionClosed -= LogoutHandler;
313 313
314 object obj; 314 object obj;
315 if (client.Scene.TryGetAvatar(client.AgentId, out obj) && obj is ScenePresence) 315 if (client.Scene.TryGetScenePresence(client.AgentId, out obj) && obj is ScenePresence)
316 { 316 {
317 // The avatar is still in the scene, we can get the exact logout position 317 // The avatar is still in the scene, we can get the exact logout position
318 ScenePresence sp = (ScenePresence)obj; 318 ScenePresence sp = (ScenePresence)obj;
@@ -335,7 +335,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
335 335
336 private OSDMap GetUserData(UUID userID) 336 private OSDMap GetUserData(UUID userID)
337 { 337 {
338 m_log.DebugFormat("[PRESENCE CONNECTOR]: Requesting user data for " + userID); 338 m_log.DebugFormat("[SIMIAN PRESENCE CONNECTOR]: Requesting user data for " + userID);
339 339
340 NameValueCollection requestArgs = new NameValueCollection 340 NameValueCollection requestArgs = new NameValueCollection
341 { 341 {
@@ -347,14 +347,14 @@ namespace OpenSim.Services.Connectors.SimianGrid
347 if (response["Success"].AsBoolean() && response["User"] is OSDMap) 347 if (response["Success"].AsBoolean() && response["User"] is OSDMap)
348 return response; 348 return response;
349 else 349 else
350 m_log.Warn("[PRESENCE CONNECTOR]: Failed to retrieve user data for " + userID + ": " + response["Message"].AsString()); 350 m_log.Warn("[SIMIAN PRESENCE CONNECTOR]: Failed to retrieve user data for " + userID + ": " + response["Message"].AsString());
351 351
352 return null; 352 return null;
353 } 353 }
354 354
355 private OSDMap GetSessionData(UUID sessionID) 355 private OSDMap GetSessionData(UUID sessionID)
356 { 356 {
357 m_log.DebugFormat("[PRESENCE CONNECTOR]: Requesting session data for session " + sessionID); 357 m_log.DebugFormat("[SIMIAN PRESENCE CONNECTOR]: Requesting session data for session " + sessionID);
358 358
359 NameValueCollection requestArgs = new NameValueCollection 359 NameValueCollection requestArgs = new NameValueCollection
360 { 360 {
@@ -366,7 +366,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
366 if (response["Success"].AsBoolean()) 366 if (response["Success"].AsBoolean())
367 return response; 367 return response;
368 else 368 else
369 m_log.Warn("[PRESENCE CONNECTOR]: Failed to retrieve session data for session " + sessionID); 369 m_log.Warn("[SIMIAN PRESENCE CONNECTOR]: Failed to retrieve session data for session " + sessionID);
370 370
371 return null; 371 return null;
372 } 372 }
@@ -378,7 +378,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
378 OSDMap userResponse = GetUserData(userID); 378 OSDMap userResponse = GetUserData(userID);
379 if (userResponse != null) 379 if (userResponse != null)
380 { 380 {
381 m_log.DebugFormat("[PRESENCE CONNECTOR]: Requesting sessions for " + userID); 381 m_log.DebugFormat("[SIMIAN PRESENCE CONNECTOR]: Requesting sessions for " + userID);
382 382
383 NameValueCollection requestArgs = new NameValueCollection 383 NameValueCollection requestArgs = new NameValueCollection
384 { 384 {
@@ -395,7 +395,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
395 } 395 }
396 else 396 else
397 { 397 {
398 m_log.Warn("[PRESENCE CONNECTOR]: Failed to retrieve sessions for " + userID + ": " + response["Message"].AsString()); 398 m_log.Warn("[SIMIAN PRESENCE CONNECTOR]: Failed to retrieve sessions for " + userID + ": " + response["Message"].AsString());
399 } 399 }
400 } 400 }
401 401
@@ -428,7 +428,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
428 } 428 }
429 else 429 else
430 { 430 {
431 m_log.Warn("[PRESENCE CONNECTOR]: Failed to retrieve presence information for session " + sessionID + 431 m_log.Warn("[SIMIAN PRESENCE CONNECTOR]: Failed to retrieve presence information for session " + sessionID +
432 " while saving last location: " + response["Message"].AsString()); 432 " while saving last location: " + response["Message"].AsString());
433 } 433 }
434 434
@@ -448,7 +448,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
448 bool success = response["Success"].AsBoolean(); 448 bool success = response["Success"].AsBoolean();
449 449
450 if (!success) 450 if (!success)
451 m_log.Warn("[PRESENCE CONNECTOR]: Failed to set last location for " + userID + ": " + response["Message"].AsString()); 451 m_log.Warn("[SIMIAN PRESENCE CONNECTOR]: Failed to set last location for " + userID + ": " + response["Message"].AsString());
452 452
453 return success; 453 return success;
454 } 454 }