aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Tests/Common
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Tests/Common')
-rw-r--r--OpenSim/Tests/Common/Helpers/SceneHelpers.cs12
-rw-r--r--OpenSim/Tests/Common/Mock/TestClient.cs36
2 files changed, 32 insertions, 16 deletions
diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs
index 7bf08ae..318758d 100644
--- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs
+++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs
@@ -369,8 +369,11 @@ namespace OpenSim.Tests.Common
369 agentData.AgentID = agentId; 369 agentData.AgentID = agentId;
370 agentData.firstname = firstName; 370 agentData.firstname = firstName;
371 agentData.lastname = "testlastname"; 371 agentData.lastname = "testlastname";
372 agentData.SessionID = UUID.Zero; 372
373 agentData.SecureSessionID = UUID.Zero; 373 // XXX: Sessions must be unique, otherwise one presence can overwrite another in NullPresenceData.
374 agentData.SessionID = UUID.Random();
375 agentData.SecureSessionID = UUID.Random();
376
374 agentData.circuitcode = 123; 377 agentData.circuitcode = 123;
375 agentData.BaseFolder = UUID.Zero; 378 agentData.BaseFolder = UUID.Zero;
376 agentData.InventoryFolder = UUID.Zero; 379 agentData.InventoryFolder = UUID.Zero;
@@ -416,7 +419,10 @@ namespace OpenSim.Tests.Common
416 // We emulate the proper login sequence here by doing things in four stages 419 // We emulate the proper login sequence here by doing things in four stages
417 420
418 // Stage 0: login 421 // Stage 0: login
419 scene.PresenceService.LoginAgent(agentData.AgentID.ToString(), agentData.SessionID, agentData.SecureSessionID); 422 // We need to punch through to the underlying service because scene will not, correctly, let us call it
423 // through it's reference to the LPSC
424 LocalPresenceServicesConnector lpsc = (LocalPresenceServicesConnector)scene.PresenceService;
425 lpsc.m_PresenceService.LoginAgent(agentData.AgentID.ToString(), agentData.SessionID, agentData.SecureSessionID);
420 426
421 // Stages 1 & 2 427 // Stages 1 & 2
422 ScenePresence sp = IntroduceClientToScene(scene, agentData, TeleportFlags.ViaLogin); 428 ScenePresence sp = IntroduceClientToScene(scene, agentData, TeleportFlags.ViaLogin);
diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs
index d6e7200..cb9840e 100644
--- a/OpenSim/Tests/Common/Mock/TestClient.cs
+++ b/OpenSim/Tests/Common/Mock/TestClient.cs
@@ -347,15 +347,9 @@ namespace OpenSim.Tests.Common.Mock
347 get { return m_agentId; } 347 get { return m_agentId; }
348 } 348 }
349 349
350 public UUID SessionId 350 public UUID SessionId { get; set; }
351 {
352 get { return UUID.Zero; }
353 }
354 351
355 public UUID SecureSessionId 352 public UUID SecureSessionId { get; set; }
356 {
357 get { return UUID.Zero; }
358 }
359 353
360 public virtual string FirstName 354 public virtual string FirstName
361 { 355 {
@@ -379,11 +373,9 @@ namespace OpenSim.Tests.Common.Mock
379 get { return true; } 373 get { return true; }
380 set { } 374 set { }
381 } 375 }
382 public bool IsLoggingOut 376
383 { 377 public bool IsLoggingOut { get; set; }
384 get { return false; } 378
385 set { }
386 }
387 public UUID ActiveGroupId 379 public UUID ActiveGroupId
388 { 380 {
389 get { return UUID.Zero; } 381 get { return UUID.Zero; }
@@ -449,6 +441,8 @@ namespace OpenSim.Tests.Common.Mock
449 m_lastName = agentData.lastname; 441 m_lastName = agentData.lastname;
450 m_circuitCode = agentData.circuitcode; 442 m_circuitCode = agentData.circuitcode;
451 m_scene = scene; 443 m_scene = scene;
444 SessionId = agentData.SessionID;
445 SecureSessionId = agentData.SecureSessionID;
452 CapsSeedUrl = agentData.CapsPath; 446 CapsSeedUrl = agentData.CapsPath;
453 447
454 ReceivedOfflineNotifications = new List<UUID>(); 448 ReceivedOfflineNotifications = new List<UUID>();
@@ -900,8 +894,24 @@ namespace OpenSim.Tests.Common.Mock
900 { 894 {
901 } 895 }
902 896
897 /// <summary>
898 /// This is a TestClient only method to do shutdown tasks that are normally carried out by LLUDPServer.RemoveClient()
899 /// </summary>
900 public void Logout()
901 {
902 // We must set this here so that the presence is removed from the PresenceService by the PresenceDetector
903 IsLoggingOut = true;
904
905 Close();
906 }
907
903 public void Close() 908 public void Close()
904 { 909 {
910 // Fire the callback for this connection closing
911 // This is necesary to get the presence detector to notice that a client has logged out.
912 if (OnConnectionClosed != null)
913 OnConnectionClosed(this);
914
905 m_scene.RemoveClient(AgentId, true); 915 m_scene.RemoveClient(AgentId, true);
906 } 916 }
907 917