aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Tests/SceneTestUtils.cs
diff options
context:
space:
mode:
authorJustin Clarke Casey2009-01-22 19:46:31 +0000
committerJustin Clarke Casey2009-01-22 19:46:31 +0000
commit884009ed33eab204588cc3978a46abff1098b832 (patch)
treed6a714d3c29396e0e85fecfe31788d3953662310 /OpenSim/Region/Environment/Scenes/Tests/SceneTestUtils.cs
parent* Remove a few unnecessary locks to try and prevent lock contention in LLImag... (diff)
downloadopensim-SC_OLD-884009ed33eab204588cc3978a46abff1098b832.zip
opensim-SC_OLD-884009ed33eab204588cc3978a46abff1098b832.tar.gz
opensim-SC_OLD-884009ed33eab204588cc3978a46abff1098b832.tar.bz2
opensim-SC_OLD-884009ed33eab204588cc3978a46abff1098b832.tar.xz
* Add some caps seed capability path checking to the simple non neighbours standalone region teleport test
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Tests/SceneTestUtils.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/Tests/SceneTestUtils.cs71
1 files changed, 52 insertions, 19 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Tests/SceneTestUtils.cs b/OpenSim/Region/Environment/Scenes/Tests/SceneTestUtils.cs
index dee3914..6fa918a 100644
--- a/OpenSim/Region/Environment/Scenes/Tests/SceneTestUtils.cs
+++ b/OpenSim/Region/Environment/Scenes/Tests/SceneTestUtils.cs
@@ -99,40 +99,73 @@ namespace OpenSim.Region.Environment.Scenes.Tests
99 } 99 }
100 100
101 /// <summary> 101 /// <summary>
102 /// Add a root agent 102 /// Generate some standard agent connection data.
103 /// </summary> 103 /// </summary>
104 /// <param name="scene"></param>
105 /// <param name="agentId"></param> 104 /// <param name="agentId"></param>
106 /// <returns></returns> 105 /// <returns></returns>
107 public static TestClient AddRootAgent(Scene scene, UUID agentId) 106 public static AgentCircuitData GenerateAgentData(UUID agentId)
108 { 107 {
109 string firstName = "testfirstname"; 108 string firstName = "testfirstname";
110 109
111 AgentCircuitData agent = new AgentCircuitData(); 110 AgentCircuitData agentData = new AgentCircuitData();
112 agent.AgentID = agentId; 111 agentData.AgentID = agentId;
113 agent.firstname = firstName; 112 agentData.firstname = firstName;
114 agent.lastname = "testlastname"; 113 agentData.lastname = "testlastname";
115 agent.SessionID = UUID.Zero; 114 agentData.SessionID = UUID.Zero;
116 agent.SecureSessionID = UUID.Zero; 115 agentData.SecureSessionID = UUID.Zero;
117 agent.circuitcode = 123; 116 agentData.circuitcode = 123;
118 agent.BaseFolder = UUID.Zero; 117 agentData.BaseFolder = UUID.Zero;
119 agent.InventoryFolder = UUID.Zero; 118 agentData.InventoryFolder = UUID.Zero;
120 agent.startpos = Vector3.Zero; 119 agentData.startpos = Vector3.Zero;
121 agent.CapsPath = "http://wibble.com"; 120 agentData.CapsPath = "http://wibble.com";
122 121
122 return agentData;
123 }
124
125 /// <summary>
126 /// Add a root agent where the details of the agent connection (apart from the id) are unimportant for the test
127 /// </summary>
128 /// <param name="scene"></param>
129 /// <param name="agentId"></param>
130 /// <returns></returns>
131 public static TestClient AddRootAgent(Scene scene, UUID agentId)
132 {
133 return AddRootAgent(scene, GenerateAgentData(agentId));
134 }
135
136 /// <summary>
137 /// Add a root agent.
138 /// </summary>
139 ///
140 /// This function
141 ///
142 /// 1) Tells the scene that an agent is coming. Normally, the login service (local if standalone, from the
143 /// userserver if grid) would give initial login data back to the client and separately tell the scene that the
144 /// agent was coming.
145 ///
146 /// 2) Connects the agent with the scene
147 ///
148 /// This function performs actions equivalent with notifying the scene that an agent is
149 /// coming and then actually connecting the agent to the scene. The one step missed out is the very first
150 ///
151 /// <param name="scene"></param>
152 /// <param name="agentData"></param>
153 /// <returns></returns>
154 public static TestClient AddRootAgent(Scene scene, AgentCircuitData agentData)
155 {
123 // We emulate the proper login sequence here by doing things in three stages 156 // We emulate the proper login sequence here by doing things in three stages
124 // Stage 1: simulate login by telling the scene to expect a new user connection 157 // Stage 1: simulate login by telling the scene to expect a new user connection
125 scene.NewUserConnection(agent); 158 scene.NewUserConnection(agentData);
126 159
127 // Stage 2: add the new client as a child agent to the scene 160 // Stage 2: add the new client as a child agent to the scene
128 TestClient client = new TestClient(agent, scene); 161 TestClient client = new TestClient(agentData, scene);
129 scene.AddNewClient(client); 162 scene.AddNewClient(client);
130 163
131 // Stage 3: Invoke agent crossing, which converts the child agent into a root agent (with appearance, 164 // Stage 3: Invoke agent crossing, which converts the child agent into a root agent (with appearance,
132 // inventory, etc.) 165 // inventory, etc.)
133 scene.AgentCrossing(agent.AgentID, new Vector3(90, 90, 90), false); 166 scene.AgentCrossing(agentData.AgentID, new Vector3(90, 90, 90), false);
134 167
135 return client; 168 return client;
136 } 169 }
137 170
138 /// <summary> 171 /// <summary>