diff options
author | Justin Clarke Casey | 2009-01-16 21:56:13 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2009-01-16 21:56:13 +0000 |
commit | eca6442bae4093019bd221e87413c74c77c4ff5d (patch) | |
tree | e62245b1cf2a5f0afdde443fba38c2b62d401100 /OpenSim/Region/Environment | |
parent | * minor: Future archiver test stub (diff) | |
download | opensim-SC-eca6442bae4093019bd221e87413c74c77c4ff5d.zip opensim-SC-eca6442bae4093019bd221e87413c74c77c4ff5d.tar.gz opensim-SC-eca6442bae4093019bd221e87413c74c77c4ff5d.tar.bz2 opensim-SC-eca6442bae4093019bd221e87413c74c77c4ff5d.tar.xz |
* Rig up enough infrastructure to actually perform a successful 'standalone' teleport unit test with checks that the scene presence disappeared from sceneA and appeared in
sceneB
* However, I'm not convinced that the actual process in the test completely reflects reality, and a lot of stuff had to be rigged up (which should get resolved over time)
Diffstat (limited to '')
8 files changed, 32 insertions, 14 deletions
diff --git a/OpenSim/Region/Environment/Modules/Agent/TextureSender/Tests/TextureSenderTests.cs b/OpenSim/Region/Environment/Modules/Agent/TextureSender/Tests/TextureSenderTests.cs index 42a4e91..cfac868 100644 --- a/OpenSim/Region/Environment/Modules/Agent/TextureSender/Tests/TextureSenderTests.cs +++ b/OpenSim/Region/Environment/Modules/Agent/TextureSender/Tests/TextureSenderTests.cs | |||
@@ -61,7 +61,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender | |||
61 | agent.InventoryFolder = UUID.Zero; | 61 | agent.InventoryFolder = UUID.Zero; |
62 | agent.startpos = Vector3.Zero; | 62 | agent.startpos = Vector3.Zero; |
63 | agent.CapsPath = "http://wibble.com"; | 63 | agent.CapsPath = "http://wibble.com"; |
64 | client = new TestClient(agent); | 64 | client = new TestClient(agent, null); |
65 | ts = new TextureSender(client, 0, 0); | 65 | ts = new TextureSender(client, 0, 0); |
66 | testsize = random.Next(5000,15000); | 66 | testsize = random.Next(5000,15000); |
67 | npackets = CalculateNumPackets(testsize); | 67 | npackets = CalculateNumPackets(testsize); |
diff --git a/OpenSim/Region/Environment/Modules/Communications/Local/LocalInterregionComms.cs b/OpenSim/Region/Environment/Modules/Communications/Local/LocalInterregionComms.cs index 5fcb4bc..62f6df0 100644 --- a/OpenSim/Region/Environment/Modules/Communications/Local/LocalInterregionComms.cs +++ b/OpenSim/Region/Environment/Modules/Communications/Local/LocalInterregionComms.cs | |||
@@ -128,6 +128,7 @@ namespace OpenSim.Region.Environment.Modules.Communications.Local | |||
128 | return true; | 128 | return true; |
129 | } | 129 | } |
130 | } | 130 | } |
131 | |||
131 | // m_log.DebugFormat("[LOCAL COMMS]: Did not find region {0} for SendCreateChildAgent", regionHandle); | 132 | // m_log.DebugFormat("[LOCAL COMMS]: Did not find region {0} for SendCreateChildAgent", regionHandle); |
132 | return false; | 133 | return false; |
133 | } | 134 | } |
@@ -138,12 +139,16 @@ namespace OpenSim.Region.Environment.Modules.Communications.Local | |||
138 | { | 139 | { |
139 | if (s.RegionInfo.RegionHandle == regionHandle) | 140 | if (s.RegionInfo.RegionHandle == regionHandle) |
140 | { | 141 | { |
141 | //m_log.Debug("[LOCAL COMMS]: Found region to send ChildAgentUpdate"); | 142 | //m_log.DebugFormat( |
143 | // "[LOCAL COMMS]: Found region {0} {1} to send ChildAgentUpdate", | ||
144 | // s.RegionInfo.RegionName, regionHandle); | ||
145 | |||
142 | s.IncomingChildAgentDataUpdate(cAgentData); | 146 | s.IncomingChildAgentDataUpdate(cAgentData); |
143 | return true; | 147 | return true; |
144 | } | 148 | } |
145 | } | 149 | } |
146 | //m_log.Debug("[LOCAL COMMS]: region not found for ChildAgentUpdate"); | 150 | |
151 | // m_log.DebugFormat("[LOCAL COMMS]: Did not find region {0} for ChildAgentUpdate", regionHandle); | ||
147 | return false; | 152 | return false; |
148 | } | 153 | } |
149 | 154 | ||
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 9c3aa96..8a9d295 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -2777,7 +2777,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2777 | 2777 | ||
2778 | // Don't disable this log message - it's too helpful | 2778 | // Don't disable this log message - it's too helpful |
2779 | m_log.DebugFormat( | 2779 | m_log.DebugFormat( |
2780 | "[CONNECTION BEGIN]: Scene {0} told of incoming client {1} {2} {3} (circuit code {4})", | 2780 | "[CONNECTION BEGIN]: Region {0} told of incoming client {1} {2} {3} (circuit code {4})", |
2781 | RegionInfo.RegionName, agent.firstname, agent.lastname, agent.AgentID, agent.circuitcode); | 2781 | RegionInfo.RegionName, agent.firstname, agent.lastname, agent.AgentID, agent.circuitcode); |
2782 | 2782 | ||
2783 | if (m_regInfo.EstateSettings.IsBanned(agent.AgentID)) | 2783 | if (m_regInfo.EstateSettings.IsBanned(agent.AgentID)) |
@@ -2977,13 +2977,16 @@ namespace OpenSim.Region.Environment.Scenes | |||
2977 | 2977 | ||
2978 | public virtual bool IncomingChildAgentDataUpdate(AgentData cAgentData) | 2978 | public virtual bool IncomingChildAgentDataUpdate(AgentData cAgentData) |
2979 | { | 2979 | { |
2980 | //Console.WriteLine(" XXX Scene IncomingChildAgentDataUpdate FULL in " + RegionInfo.RegionName); | 2980 | // m_log.DebugFormat( |
2981 | // "[SCENE]: Incoming child agent update for {0} in {1}", cAgentData.AgentID, RegionInfo.RegionName); | ||
2982 | |||
2981 | ScenePresence childAgentUpdate = GetScenePresence(cAgentData.AgentID); | 2983 | ScenePresence childAgentUpdate = GetScenePresence(cAgentData.AgentID); |
2982 | if (childAgentUpdate != null) | 2984 | if (childAgentUpdate != null) |
2983 | { | 2985 | { |
2984 | childAgentUpdate.ChildAgentDataUpdate(cAgentData); | 2986 | childAgentUpdate.ChildAgentDataUpdate(cAgentData); |
2985 | return true; | 2987 | return true; |
2986 | } | 2988 | } |
2989 | |||
2987 | return false; | 2990 | return false; |
2988 | } | 2991 | } |
2989 | 2992 | ||
@@ -3030,6 +3033,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
3030 | /// <param name="agentID"></param> | 3033 | /// <param name="agentID"></param> |
3031 | public bool IncomingCloseAgent(UUID agentID) | 3034 | public bool IncomingCloseAgent(UUID agentID) |
3032 | { | 3035 | { |
3036 | //m_log.DebugFormat("[SCENE]: Processing incoming close agent for {0}", agentID); | ||
3037 | |||
3033 | ScenePresence presence = m_sceneGraph.GetScenePresence(agentID); | 3038 | ScenePresence presence = m_sceneGraph.GetScenePresence(agentID); |
3034 | if (presence != null) | 3039 | if (presence != null) |
3035 | { | 3040 | { |
@@ -3056,9 +3061,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
3056 | else | 3061 | else |
3057 | presence.ControllingClient.SendShutdownConnectionNotice(); | 3062 | presence.ControllingClient.SendShutdownConnectionNotice(); |
3058 | } | 3063 | } |
3064 | |||
3059 | presence.ControllingClient.Close(true); | 3065 | presence.ControllingClient.Close(true); |
3060 | return true; | 3066 | return true; |
3061 | } | 3067 | } |
3068 | |||
3062 | // Agent not here | 3069 | // Agent not here |
3063 | return false; | 3070 | return false; |
3064 | } | 3071 | } |
diff --git a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs index 65e62ef..a46fa0b 100644 --- a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs | |||
@@ -758,6 +758,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
758 | // both regions | 758 | // both regions |
759 | if (avatar.ParentID != (uint)0) | 759 | if (avatar.ParentID != (uint)0) |
760 | avatar.StandUp(); | 760 | avatar.StandUp(); |
761 | |||
761 | if (!avatar.ValidateAttachments()) | 762 | if (!avatar.ValidateAttachments()) |
762 | { | 763 | { |
763 | avatar.ControllingClient.SendTeleportFailed("Inconsistent attachment state"); | 764 | avatar.ControllingClient.SendTeleportFailed("Inconsistent attachment state"); |
@@ -772,13 +773,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
772 | // once we reach here... | 773 | // once we reach here... |
773 | //avatar.Scene.RemoveCapsHandler(avatar.UUID); | 774 | //avatar.Scene.RemoveCapsHandler(avatar.UUID); |
774 | 775 | ||
775 | |||
776 | string capsPath = String.Empty; | 776 | string capsPath = String.Empty; |
777 | AgentCircuitData agentCircuit = avatar.ControllingClient.RequestClientInfo(); | 777 | AgentCircuitData agentCircuit = avatar.ControllingClient.RequestClientInfo(); |
778 | agentCircuit.BaseFolder = UUID.Zero; | 778 | agentCircuit.BaseFolder = UUID.Zero; |
779 | agentCircuit.InventoryFolder = UUID.Zero; | 779 | agentCircuit.InventoryFolder = UUID.Zero; |
780 | agentCircuit.startpos = position; | 780 | agentCircuit.startpos = position; |
781 | agentCircuit.child = true; | 781 | agentCircuit.child = true; |
782 | |||
782 | if (Util.IsOutsideView(oldRegionX, newRegionX, oldRegionY, newRegionY)) | 783 | if (Util.IsOutsideView(oldRegionX, newRegionX, oldRegionY, newRegionY)) |
783 | { | 784 | { |
784 | // brand new agent, let's create a new caps seed | 785 | // brand new agent, let's create a new caps seed |
@@ -871,7 +872,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
871 | teleportFlags, capsPath); | 872 | teleportFlags, capsPath); |
872 | } | 873 | } |
873 | 874 | ||
874 | |||
875 | // TeleportFinish makes the client send CompleteMovementIntoRegion (at the destination), which | 875 | // TeleportFinish makes the client send CompleteMovementIntoRegion (at the destination), which |
876 | // trigers a whole shebang of things there, including MakeRoot. So let's wait for confirmation | 876 | // trigers a whole shebang of things there, including MakeRoot. So let's wait for confirmation |
877 | // that the client contacted the destination before we send the attachments and close things here. | 877 | // that the client contacted the destination before we send the attachments and close things here. |
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index bdb0836..77d5b93 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs | |||
@@ -1017,9 +1017,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
1017 | 1017 | ||
1018 | if ((m_callbackURI != null) && !m_callbackURI.Equals("")) | 1018 | if ((m_callbackURI != null) && !m_callbackURI.Equals("")) |
1019 | { | 1019 | { |
1020 | //m_log.DebugFormat("Found callback URI {0}", m_callbackURI); | ||
1020 | Scene.SendReleaseAgent(m_rootRegionHandle, UUID, m_callbackURI); | 1021 | Scene.SendReleaseAgent(m_rootRegionHandle, UUID, m_callbackURI); |
1021 | m_callbackURI = null; | 1022 | m_callbackURI = null; |
1022 | } | 1023 | } |
1024 | |||
1025 | //m_log.DebugFormat("Completed movement"); | ||
1023 | } | 1026 | } |
1024 | } | 1027 | } |
1025 | 1028 | ||
@@ -2594,7 +2597,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
2594 | /// </summary> | 2597 | /// </summary> |
2595 | public void ChildAgentDataUpdate(AgentPosition cAgentData, uint tRegionX, uint tRegionY, uint rRegionX, uint rRegionY) | 2598 | public void ChildAgentDataUpdate(AgentPosition cAgentData, uint tRegionX, uint tRegionY, uint rRegionX, uint rRegionY) |
2596 | { | 2599 | { |
2597 | // | ||
2598 | if (!IsChildAgent) | 2600 | if (!IsChildAgent) |
2599 | return; | 2601 | return; |
2600 | 2602 | ||
@@ -2615,7 +2617,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
2615 | if ((cAgentData.Throttles != null) && cAgentData.Throttles.Length > 0) | 2617 | if ((cAgentData.Throttles != null) && cAgentData.Throttles.Length > 0) |
2616 | ControllingClient.SetChildAgentThrottle(cAgentData.Throttles); | 2618 | ControllingClient.SetChildAgentThrottle(cAgentData.Throttles); |
2617 | 2619 | ||
2618 | |||
2619 | // Sends out the objects in the user's draw distance if m_sendTasksToChild is true. | 2620 | // Sends out the objects in the user's draw distance if m_sendTasksToChild is true. |
2620 | if (m_scene.m_seeIntoRegionFromNeighbor) | 2621 | if (m_scene.m_seeIntoRegionFromNeighbor) |
2621 | m_pendingObjects = null; | 2622 | m_pendingObjects = null; |
@@ -2662,7 +2663,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
2662 | cAgent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY; | 2663 | cAgent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY; |
2663 | } | 2664 | } |
2664 | 2665 | ||
2665 | |||
2666 | cAgent.GodLevel = (byte)m_godlevel; | 2666 | cAgent.GodLevel = (byte)m_godlevel; |
2667 | cAgent.AlwaysRun = m_setAlwaysRun; | 2667 | cAgent.AlwaysRun = m_setAlwaysRun; |
2668 | 2668 | ||
diff --git a/OpenSim/Region/Environment/Scenes/Tests/ScenePresenceTests.cs b/OpenSim/Region/Environment/Scenes/Tests/ScenePresenceTests.cs index 548fea9..5ce78a3 100644 --- a/OpenSim/Region/Environment/Scenes/Tests/ScenePresenceTests.cs +++ b/OpenSim/Region/Environment/Scenes/Tests/ScenePresenceTests.cs | |||
@@ -63,7 +63,7 @@ namespace OpenSim.Region.Environment.Scenes.Tests | |||
63 | agent.CapsPath = "http://wibble.com"; | 63 | agent.CapsPath = "http://wibble.com"; |
64 | 64 | ||
65 | scene.NewUserConnection(agent); | 65 | scene.NewUserConnection(agent); |
66 | scene.AddNewClient(new TestClient(agent)); | 66 | scene.AddNewClient(new TestClient(agent, scene)); |
67 | 67 | ||
68 | ScenePresence presence = scene.GetScenePresence(agentId); | 68 | ScenePresence presence = scene.GetScenePresence(agentId); |
69 | 69 | ||
diff --git a/OpenSim/Region/Environment/Scenes/Tests/SceneTestUtils.cs b/OpenSim/Region/Environment/Scenes/Tests/SceneTestUtils.cs index 3c4049d..5fa897c 100644 --- a/OpenSim/Region/Environment/Scenes/Tests/SceneTestUtils.cs +++ b/OpenSim/Region/Environment/Scenes/Tests/SceneTestUtils.cs | |||
@@ -118,7 +118,7 @@ namespace OpenSim.Region.Environment.Scenes.Tests | |||
118 | scene.NewUserConnection(agent); | 118 | scene.NewUserConnection(agent); |
119 | 119 | ||
120 | // Stage 2: add the new client as a child agent to the scene | 120 | // Stage 2: add the new client as a child agent to the scene |
121 | TestClient client = new TestClient(agent); | 121 | TestClient client = new TestClient(agent, scene); |
122 | scene.AddNewClient(client); | 122 | scene.AddNewClient(client); |
123 | 123 | ||
124 | // Stage 3: Invoke agent crossing, which converts the child agent into a root agent (with appearance, | 124 | // Stage 3: Invoke agent crossing, which converts the child agent into a root agent (with appearance, |
diff --git a/OpenSim/Region/Environment/Scenes/Tests/StandaloneTeleportTests.cs b/OpenSim/Region/Environment/Scenes/Tests/StandaloneTeleportTests.cs index a3d116d..d7342de 100644 --- a/OpenSim/Region/Environment/Scenes/Tests/StandaloneTeleportTests.cs +++ b/OpenSim/Region/Environment/Scenes/Tests/StandaloneTeleportTests.cs | |||
@@ -27,6 +27,7 @@ | |||
27 | 27 | ||
28 | using Nini.Config; | 28 | using Nini.Config; |
29 | using NUnit.Framework; | 29 | using NUnit.Framework; |
30 | using NUnit.Framework.SyntaxHelpers; | ||
30 | using OpenMetaverse; | 31 | using OpenMetaverse; |
31 | using OpenSim.Framework; | 32 | using OpenSim.Framework; |
32 | using OpenSim.Framework.Communications; | 33 | using OpenSim.Framework.Communications; |
@@ -77,9 +78,14 @@ namespace OpenSim.Region.Environment.Scenes.Tests | |||
77 | 78 | ||
78 | TestClient client = SceneTestUtils.AddRootAgent(sceneA, agentId); | 79 | TestClient client = SceneTestUtils.AddRootAgent(sceneA, agentId); |
79 | 80 | ||
80 | client.Teleport(sceneB.RegionInfo.RegionHandle, new Vector3(100, 100, 100), new Vector3(40, 40, 40)); | 81 | // FIXME: This is a hack to get the test working - really the normal OpenSim mechanisms should be used. |
82 | client.TeleportTargetScene = sceneB; | ||
81 | 83 | ||
82 | // TODO: Check that everything is as it should be | 84 | client.Teleport(sceneB.RegionInfo.RegionHandle, new Vector3(100, 100, 100), new Vector3(40, 40, 40)); |
85 | Assert.That(sceneB.GetScenePresence(agentId), Is.Not.Null, "Client does not have an agent in sceneB"); | ||
86 | Assert.That(sceneA.GetScenePresence(agentId), Is.Null, "Client still had an agent in sceneA"); | ||
87 | |||
88 | // TODO: Check that more of everything is as it should be | ||
83 | 89 | ||
84 | // TODO: test what happens if we try to teleport to a region that doesn't exist | 90 | // TODO: test what happens if we try to teleport to a region that doesn't exist |
85 | } | 91 | } |