29 using System.Collections.Generic;
30 using System.Reflection;
32 using NUnit.Framework;
34 using OpenSim.Framework;
35 using OpenSim.Framework.Servers;
36 using OpenSim.Region.Framework.Interfaces;
37 using OpenSim.Region.CoreModules.Framework;
38 using OpenSim.Region.CoreModules.Framework.EntityTransfer;
39 using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation;
40 using OpenSim.Region.CoreModules.World.Permissions;
41 using OpenSim.Tests.Common;
42 using OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups;
43 using System.Threading;
45 namespace OpenSim.
Region.Framework.Scenes.Tests
54 Util.FireAndForgetMethod = FireAndForgetMethod.RegressionTest;
63 Util.FireAndForgetMethod = Util.DefaultFireAndForgetMethod;
69 TestHelpers.InMethod();
72 UUID userId = TestHelpers.ParseTail(0x1);
79 IConfigSource config =
new IniConfigSource();
80 IConfig modulesConfig = config.AddConfig(
"Modules");
81 modulesConfig.Set(
"EntityTransferModule", etmA.Name);
82 modulesConfig.Set(
"SimulationServices", lscm.Name);
90 TestScene sceneA = sh.SetupScene(
"sceneA", TestHelpers.ParseTail(0x100), 1000, 1000);
91 TestScene sceneB = sh.SetupScene(
"sceneB", TestHelpers.ParseTail(0x200), 1000, 999);
93 SceneHelpers.SetupSceneModules(
new Scene[] { sceneA, sceneB }, config, lscm);
100 List<TestClient> destinationTestClients =
new List<TestClient>();
101 EntityTransferHelpers.SetupInformClientOfNeighbourTriggersNeighbourClientCreate(tc, destinationTestClients);
103 ScenePresence originalSp = SceneHelpers.AddScenePresence(sceneA, tc, acd);
104 originalSp.AbsolutePosition =
new Vector3(128, 32, 10);
114 moveArgs.BodyRotation = Quaternion.CreateFromEulers(
new Vector3(0, 0, (
float)-(Math.PI / 2)));
115 moveArgs.ControlFlags = (uint)AgentManager.ControlFlags.AGENT_CONTROL_AT_POS;
118 originalSp.HandleAgentUpdate(originalSp.ControllingClient, moveArgs);
126 for (
int i = 0; i < 100; i++)
145 ScenePresence spAfterCrossSceneA = sceneA.GetScenePresence(originalSp.UUID);
146 Assert.That(spAfterCrossSceneA.IsChildAgent, Is.True);
148 ScenePresence spAfterCrossSceneB = sceneB.GetScenePresence(originalSp.UUID);
151 Assert.That(spAfterCrossSceneB.IsChildAgent, Is.True);
155 int agentMovementCompleteReceived = 0;
156 sceneBTc.OnReceivedMoveAgentIntoRegion += (ri, pos, look) => agentMovementCompleteReceived++;
158 sceneBTc.CompleteMovement();
160 Assert.That(agentMovementCompleteReceived, Is.EqualTo(1));
161 Assert.That(spAfterCrossSceneB.IsChildAgent, Is.False);
171 TestHelpers.InMethod();
174 UUID userId = TestHelpers.ParseTail(0x1);
180 IConfigSource config =
new IniConfigSource();
181 IConfig modulesConfig = config.AddConfig(
"Modules");
182 modulesConfig.Set(
"EntityTransferModule", etmA.Name);
183 modulesConfig.Set(
"SimulationServices", lscm.Name);
186 TestScene sceneA = sh.SetupScene(
"sceneA", TestHelpers.ParseTail(0x100), 1000, 1000);
187 TestScene sceneB = sh.SetupScene(
"sceneB", TestHelpers.ParseTail(0x200), 1000, 999);
189 SceneHelpers.SetupSceneModules(
new Scene[] { sceneA, sceneB }, config, lscm);
199 List<TestClient> destinationTestClients =
new List<TestClient>();
200 EntityTransferHelpers.SetupInformClientOfNeighbourTriggersNeighbourClientCreate(tc, destinationTestClients);
203 sceneB.RegionInfo.EstateSettings.PublicAccess =
false;
205 ScenePresence originalSp = SceneHelpers.AddScenePresence(sceneA, tc, acd);
206 originalSp.AbsolutePosition =
new Vector3(128, 32, 10);
210 moveArgs.BodyRotation = Quaternion.CreateFromEulers(
new Vector3(0, 0, (
float)-(Math.PI / 2)));
211 moveArgs.ControlFlags = (uint)AgentManager.ControlFlags.AGENT_CONTROL_AT_POS;
222 for (
int i = 0; i < 100; i++)
229 ScenePresence spAfterCrossSceneA = sceneA.GetScenePresence(originalSp.UUID);
230 Assert.That(spAfterCrossSceneA.IsChildAgent, Is.False);
232 ScenePresence spAfterCrossSceneB = sceneB.GetScenePresence(originalSp.UUID);
235 Assert.That(spAfterCrossSceneB.IsChildAgent, Is.True);
240 int agentMovementCompleteReceived = 0;
241 sceneBTc.OnReceivedMoveAgentIntoRegion += (ri, pos, look) => agentMovementCompleteReceived++;
243 sceneBTc.CompleteMovement();
245 Assert.That(agentMovementCompleteReceived, Is.EqualTo(0));
246 Assert.That(spAfterCrossSceneB.IsChildAgent, Is.True);
IClientAPI ControllingClient
Client provided parameters for avatar movement
Circuit data for an agent. Connection information shared between regions that accept UDP connections ...
void HandleAgentUpdate(IClientAPI remoteClient, AgentUpdateArgs agentData)
This is the event handler for client movement. If a client is moving, this event is triggering...
Helpers for setting up scenes.
void TestCrossOnSameSimulator()
void TestCrossOnSameSimulatorNoRootDestPerm()
Test a cross attempt where the user can see into the neighbour but does not have permission to become...