public void TestSimpleNotNeighboursTeleport() { TestHelper.InMethod(); // Console.WriteLine("Beginning test {0}", MethodBase.GetCurrentMethod()); log4net.Config.XmlConfigurator.Configure(); UUID sceneAId = UUID.Parse("00000000-0000-0000-0000-000000000100"); UUID sceneBId = UUID.Parse("00000000-0000-0000-0000-000000000200"); TestCommunicationsManager cm = new TestCommunicationsManager(); // shared module IRegionModule interregionComms = new RESTInterregionComms(); Scene sceneA = SceneSetupHelpers.SetupScene("sceneA", sceneAId, 1000, 1000, cm); SceneSetupHelpers.SetupSceneModules(sceneA, new IniConfigSource(), interregionComms); sceneA.RegisterRegionWithGrid(); Scene sceneB = SceneSetupHelpers.SetupScene("sceneB", sceneBId, 1010, 1010, cm); SceneSetupHelpers.SetupSceneModules(sceneB, new IniConfigSource(), interregionComms); sceneB.RegisterRegionWithGrid(); UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000041"); TestClient client = SceneSetupHelpers.AddRootAgent(sceneA, agentId); ICapabilitiesModule sceneACapsModule = sceneA.RequestModuleInterface <ICapabilitiesModule>(); Assert.That( sceneACapsModule.GetCapsPath(agentId), Is.EqualTo(client.CapsSeedUrl), "Incorrect caps object path set up in sceneA"); // FIXME: This is a hack to get the test working - really the normal OpenSim mechanisms should be used. client.TeleportTargetScene = sceneB; client.Teleport(sceneB.RegionInfo.RegionHandle, new Vector3(100, 100, 100), new Vector3(40, 40, 40)); Assert.That(sceneB.GetScenePresence(agentId), Is.Not.Null, "Client does not have an agent in sceneB"); Assert.That(sceneA.GetScenePresence(agentId), Is.Null, "Client still had an agent in sceneA"); ICapabilitiesModule sceneBCapsModule = sceneB.RequestModuleInterface <ICapabilitiesModule>(); // Temporary assertion - caps url construction should at least be doable through a method. Assert.That( "http://" + sceneB.RegionInfo.ExternalHostName + ":" + sceneB.RegionInfo.HttpPort + "/CAPS/" + sceneBCapsModule.GetCapsPath(agentId) + "0000/", Is.EqualTo(client.CapsSeedUrl), "Incorrect caps object path set up in sceneB"); // This assertion will currently fail since we don't remove the caps paths when no longer needed //Assert.That(sceneACapsModule.GetCapsPath(agentId), Is.Null, "sceneA still had a caps object path"); // TODO: Check that more of everything is as it should be // TODO: test what happens if we try to teleport to a region that doesn't exist }
public virtual AgentCircuitData RequestClientInfo() { AgentCircuitData agentData = new AgentCircuitData(); agentData.AgentID = AgentId; agentData.SessionID = UUID.Zero; agentData.SecureSessionID = UUID.Zero; agentData.circuitcode = m_circuitCode; agentData.child = false; agentData.firstname = m_firstName; agentData.lastname = m_lastName; ICapabilitiesModule capsModule = m_scene.RequestModuleInterface <ICapabilitiesModule>(); agentData.CapsPath = capsModule.GetCapsPath(m_agentId); agentData.ChildrenCapSeeds = new Dictionary <ulong, string>(capsModule.GetChildrenSeeds(m_agentId)); return(agentData); }
public void run(object o) { //results.Result = true; log4net.Config.XmlConfigurator.Configure(); UUID sceneAId = UUID.Parse("00000000-0000-0000-0000-000000000100"); UUID sceneBId = UUID.Parse("00000000-0000-0000-0000-000000000200"); // shared module ISharedRegionModule interregionComms = new LocalSimulationConnectorModule(); Scene sceneB = SceneSetupHelpers.SetupScene("sceneB", sceneBId, 1010, 1010, "grid"); SceneSetupHelpers.SetupSceneModules(sceneB, new IniConfigSource(), interregionComms); sceneB.RegisterRegionWithGrid(); Scene sceneA = SceneSetupHelpers.SetupScene("sceneA", sceneAId, 1000, 1000, "grid"); SceneSetupHelpers.SetupSceneModules(sceneA, new IniConfigSource(), interregionComms); sceneA.RegisterRegionWithGrid(); UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000041"); TestClient client = SceneSetupHelpers.AddRootAgent(sceneA, agentId); ICapabilitiesModule sceneACapsModule = sceneA.RequestModuleInterface <ICapabilitiesModule>(); results.Result = (sceneACapsModule.GetCapsPath(agentId) == client.CapsSeedUrl); if (!results.Result) { results.Message = "Incorrect caps object path set up in sceneA"; return; } /* * Assert.That( * sceneACapsModule.GetCapsPath(agentId), * Is.EqualTo(client.CapsSeedUrl), * "Incorrect caps object path set up in sceneA"); */ // FIXME: This is a hack to get the test working - really the normal OpenSim mechanisms should be used. client.TeleportTargetScene = sceneB; client.Teleport(sceneB.RegionInfo.RegionHandle, new Vector3(100, 100, 100), new Vector3(40, 40, 40)); results.Result = (sceneB.GetScenePresence(agentId) != null); if (!results.Result) { results.Message = "Client does not have an agent in sceneB"; return; } //Assert.That(sceneB.GetScenePresence(agentId), Is.Not.Null, "Client does not have an agent in sceneB"); //Assert.That(sceneA.GetScenePresence(agentId), Is.Null, "Client still had an agent in sceneA"); results.Result = (sceneA.GetScenePresence(agentId) == null); if (!results.Result) { results.Message = "Client still had an agent in sceneA"; return; } ICapabilitiesModule sceneBCapsModule = sceneB.RequestModuleInterface <ICapabilitiesModule>(); results.Result = ("http://" + sceneB.RegionInfo.ExternalHostName + ":" + sceneB.RegionInfo.HttpPort + "/CAPS/" + sceneBCapsModule.GetCapsPath(agentId) + "0000/" == client.CapsSeedUrl); if (!results.Result) { results.Message = "Incorrect caps object path set up in sceneB"; return; } // Temporary assertion - caps url construction should at least be doable through a method. /* * Assert.That( * "http://" + sceneB.RegionInfo.ExternalHostName + ":" + sceneB.RegionInfo.HttpPort + "/CAPS/" + sceneBCapsModule.GetCapsPath(agentId) + "0000/", * Is.EqualTo(client.CapsSeedUrl), * "Incorrect caps object path set up in sceneB"); */ // This assertion will currently fail since we don't remove the caps paths when no longer needed //Assert.That(sceneACapsModule.GetCapsPath(agentId), Is.Null, "sceneA still had a caps object path"); // TODO: Check that more of everything is as it should be // TODO: test what happens if we try to teleport to a region that doesn't exist }