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.cs45
2 files changed, 37 insertions, 20 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 81a5cf7..6a7cb0a 100644
--- a/OpenSim/Tests/Common/Mock/TestClient.cs
+++ b/OpenSim/Tests/Common/Mock/TestClient.cs
@@ -329,7 +329,7 @@ namespace OpenSim.Tests.Common.Mock
329 /// </value> 329 /// </value>
330 private UUID m_agentId; 330 private UUID m_agentId;
331 331
332 public ISceneAgent SceneAgent { get { throw new NotImplementedException(); } } 332 public ISceneAgent SceneAgent { get; set; }
333 333
334 /// <value> 334 /// <value>
335 /// The last caps seed url that this client was given. 335 /// The last caps seed url that this client was given.
@@ -349,15 +349,9 @@ namespace OpenSim.Tests.Common.Mock
349 get { return m_agentId; } 349 get { return m_agentId; }
350 } 350 }
351 351
352 public UUID SessionId 352 public UUID SessionId { get; set; }
353 {
354 get { return UUID.Zero; }
355 }
356 353
357 public UUID SecureSessionId 354 public UUID SecureSessionId { get; set; }
358 {
359 get { return UUID.Zero; }
360 }
361 355
362 public virtual string FirstName 356 public virtual string FirstName
363 { 357 {
@@ -381,11 +375,9 @@ namespace OpenSim.Tests.Common.Mock
381 get { return true; } 375 get { return true; }
382 set { } 376 set { }
383 } 377 }
384 public bool IsLoggingOut 378
385 { 379 public bool IsLoggingOut { get; set; }
386 get { return false; } 380
387 set { }
388 }
389 public UUID ActiveGroupId 381 public UUID ActiveGroupId
390 { 382 {
391 get { return UUID.Zero; } 383 get { return UUID.Zero; }
@@ -451,6 +443,8 @@ namespace OpenSim.Tests.Common.Mock
451 m_lastName = agentData.lastname; 443 m_lastName = agentData.lastname;
452 m_circuitCode = agentData.circuitcode; 444 m_circuitCode = agentData.circuitcode;
453 m_scene = scene; 445 m_scene = scene;
446 SessionId = agentData.SessionID;
447 SecureSessionId = agentData.SecureSessionID;
454 CapsSeedUrl = agentData.CapsPath; 448 CapsSeedUrl = agentData.CapsPath;
455 449
456 ReceivedOfflineNotifications = new List<UUID>(); 450 ReceivedOfflineNotifications = new List<UUID>();
@@ -902,12 +896,29 @@ namespace OpenSim.Tests.Common.Mock
902 { 896 {
903 } 897 }
904 898
905 public void Close() 899 /// <summary>
900 /// This is a TestClient only method to do shutdown tasks that are normally carried out by LLUDPServer.RemoveClient()
901 /// </summary>
902 public void Logout()
903 {
904 // We must set this here so that the presence is removed from the PresenceService by the PresenceDetector
905 IsLoggingOut = true;
906
907 Close();
908 }
909
910 public void Close(bool c)
906 { 911 {
907 Close(true); 912 Close();
908 } 913 }
909 public void Close(bool sendStop) 914
915 public void Close()
910 { 916 {
917 // Fire the callback for this connection closing
918 // This is necesary to get the presence detector to notice that a client has logged out.
919 if (OnConnectionClosed != null)
920 OnConnectionClosed(this);
921
911 m_scene.RemoveClient(AgentId, true); 922 m_scene.RemoveClient(AgentId, true);
912 } 923 }
913 924