refactor: Change SceneHelpers.AddClient() to AddScenePresence().
This seems to make more sense as we can get SP.ControllingClientbulletsim
parent
83ba35a26b
commit
85e07c78fb
|
@ -52,7 +52,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
|||
AvatarFactoryModule afm = new AvatarFactoryModule();
|
||||
TestScene scene = SceneHelpers.SetupScene();
|
||||
SceneHelpers.SetupSceneModules(scene, afm);
|
||||
TestClient tc = SceneHelpers.AddClient(scene, userId);
|
||||
IClientAPI tc = SceneHelpers.AddScenePresence(scene, userId).ControllingClient;
|
||||
|
||||
byte[] visualParams = new byte[AvatarAppearance.VISUALPARAM_COUNT];
|
||||
for (byte i = 0; i < visualParams.Length; i++)
|
||||
|
|
|
@ -83,7 +83,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
|||
region1 = scene.RegionInfo.RegionHandle;
|
||||
region2 = scene2.RegionInfo.RegionHandle;
|
||||
|
||||
SceneHelpers.AddClient(scene, agent1);
|
||||
SceneHelpers.AddScenePresence(scene, agent1);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
|
|
@ -139,7 +139,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
|||
|
||||
SceneObjectPart part = SceneHelpers.AddSceneObject(scene);
|
||||
|
||||
IClientAPI client = SceneHelpers.AddClient(scene, agentId);
|
||||
IClientAPI client = SceneHelpers.AddScenePresence(scene, agentId).ControllingClient;
|
||||
scene.DeRezObjects(client, new System.Collections.Generic.List<uint>() { part.LocalId }, UUID.Zero, DeRezAction.Delete, UUID.Zero);
|
||||
|
||||
SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId);
|
||||
|
|
|
@ -66,7 +66,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
|||
IConfig config = configSource.AddConfig("Startup");
|
||||
config.Set("serverside_object_permissions", true);
|
||||
SceneHelpers.SetupSceneModules(scene, configSource, new object[] { new PermissionsModule() });
|
||||
TestClient client = SceneHelpers.AddClient(scene, userId);
|
||||
IClientAPI client = SceneHelpers.AddScenePresence(scene, userId).ControllingClient;
|
||||
|
||||
// Turn off the timer on the async sog deleter - we'll crank it by hand for this test.
|
||||
AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter;
|
||||
|
@ -105,7 +105,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
|||
IConfig config = configSource.AddConfig("Startup");
|
||||
config.Set("serverside_object_permissions", true);
|
||||
SceneHelpers.SetupSceneModules(scene, configSource, new object[] { new PermissionsModule() });
|
||||
TestClient client = SceneHelpers.AddClient(scene, userId);
|
||||
IClientAPI client = SceneHelpers.AddScenePresence(scene, userId).ControllingClient;
|
||||
|
||||
// Turn off the timer on the async sog deleter - we'll crank it by hand for this test.
|
||||
AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter;
|
||||
|
|
|
@ -75,7 +75,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
|||
new GroupsModule(),
|
||||
new MockGroupsServicesConnector() });
|
||||
|
||||
TestClient client = SceneHelpers.AddClient(scene, userId);
|
||||
IClientAPI client = SceneHelpers.AddScenePresence(scene, userId).ControllingClient;
|
||||
|
||||
IGroupsModule groupsModule = scene.RequestModuleInterface<IGroupsModule>();
|
||||
|
||||
|
|
|
@ -93,6 +93,47 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
|||
region3 = scene3.RegionInfo.RegionHandle;
|
||||
}
|
||||
|
||||
// [Test]
|
||||
// public void TestLogout()
|
||||
// {
|
||||
// TestHelpers.InMethod();
|
||||
//// log4net.Config.XmlConfigurator.Configure();
|
||||
//
|
||||
// TestScene scene = SceneHelpers.SetupScene();
|
||||
// SceneHelpers.
|
||||
// }
|
||||
|
||||
/// <summary>
|
||||
/// Test that if a root agent logs into a region, a child agent is also established in the neighbouring region
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Please note that unlike the other tests here, this doesn't rely on structures
|
||||
/// </remarks>
|
||||
[Test]
|
||||
public void TestChildAgentEstablished()
|
||||
{
|
||||
TestHelpers.InMethod();
|
||||
// log4net.Config.XmlConfigurator.Configure();
|
||||
|
||||
UUID agent1Id = UUID.Parse("00000000-0000-0000-0000-000000000001");
|
||||
|
||||
TestScene myScene1 = SceneHelpers.SetupScene("Neighbour y", UUID.Random(), 1000, 1000);
|
||||
// TestScene myScene2 = SceneHelpers.SetupScene("Neighbour y + 1", UUID.Random(), 1001, 1000);
|
||||
|
||||
IConfigSource configSource = new IniConfigSource();
|
||||
configSource.AddConfig("Modules").Set("EntityTransferModule", "BasicEntityTransferModule");
|
||||
EntityTransferModule etm = new EntityTransferModule();
|
||||
|
||||
SceneHelpers.SetupSceneModules(myScene1, configSource, etm);
|
||||
|
||||
SceneHelpers.AddScenePresence(myScene1, agent1Id);
|
||||
// ScenePresence childPresence = myScene2.GetScenePresence(agent1);
|
||||
|
||||
// TODO: Need to do a fair amount of work to allow synchronous establishment of child agents
|
||||
// Assert.That(childPresence, Is.Not.Null);
|
||||
// Assert.That(childPresence.IsChildAgent, Is.True);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test adding a root agent to a scene. Doesn't yet actually complete crossing the agent into the scene.
|
||||
/// </summary>
|
||||
|
@ -190,37 +231,6 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
|||
CompleteAvatarMovement
|
||||
*/
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test that if a root agent logs into a region, a child agent is also established in the neighbouring region
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Please note that unlike the other tests here, this doesn't rely on structures
|
||||
/// </remarks>
|
||||
[Test]
|
||||
public void TestChildAgentEstablished()
|
||||
{
|
||||
TestHelpers.InMethod();
|
||||
// log4net.Config.XmlConfigurator.Configure();
|
||||
|
||||
UUID agent1Id = UUID.Parse("00000000-0000-0000-0000-000000000001");
|
||||
|
||||
TestScene myScene1 = SceneHelpers.SetupScene("Neighbour y", UUID.Random(), 1000, 1000);
|
||||
TestScene myScene2 = SceneHelpers.SetupScene("Neighbour y + 1", UUID.Random(), 1001, 1000);
|
||||
|
||||
IConfigSource configSource = new IniConfigSource();
|
||||
configSource.AddConfig("Modules").Set("EntityTransferModule", "BasicEntityTransferModule");
|
||||
EntityTransferModule etm = new EntityTransferModule();
|
||||
|
||||
SceneHelpers.SetupSceneModules(myScene1, configSource, etm);
|
||||
|
||||
SceneHelpers.AddClient(myScene1, agent1Id);
|
||||
ScenePresence childPresence = myScene2.GetScenePresence(agent1);
|
||||
|
||||
// TODO: Need to do a fair amount of work to allow synchronous establishment of child agents
|
||||
// Assert.That(childPresence, Is.Not.Null);
|
||||
// Assert.That(childPresence.IsChildAgent, Is.True);
|
||||
}
|
||||
|
||||
// I'm commenting this test because it does not represent
|
||||
// crossings. The Thread.Sleep's in here are not meaningful mocks,
|
||||
|
|
|
@ -125,7 +125,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
|||
sceneA.RegisterRegionWithGrid();
|
||||
|
||||
UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000041");
|
||||
TestClient client = SceneHelpers.AddClient(sceneA, agentId);
|
||||
TestClient client = (TestClient)SceneHelpers.AddScenePresence(sceneA, agentId).ControllingClient;
|
||||
|
||||
ICapabilitiesModule sceneACapsModule = sceneA.RequestModuleInterface<ICapabilitiesModule>();
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests
|
|||
AvatarFactoryModule afm = new AvatarFactoryModule();
|
||||
TestScene scene = SceneHelpers.SetupScene();
|
||||
SceneHelpers.SetupSceneModules(scene, config, afm, new NPCModule());
|
||||
TestClient originalClient = SceneHelpers.AddClient(scene, TestHelpers.ParseTail(0x1));
|
||||
IClientAPI originalClient = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseTail(0x1)).ControllingClient;
|
||||
// ScenePresence originalAvatar = scene.GetScenePresence(originalClient.AgentId);
|
||||
|
||||
// 8 is the index of the first baked texture in AvatarAppearance
|
||||
|
@ -96,7 +96,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests
|
|||
|
||||
TestScene scene = SceneHelpers.SetupScene();
|
||||
SceneHelpers.SetupSceneModules(scene, config, new NPCModule());
|
||||
TestClient originalClient = SceneHelpers.AddClient(scene, TestHelpers.ParseTail(0x1));
|
||||
IClientAPI originalClient = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseTail(0x1)).ControllingClient;
|
||||
// ScenePresence originalAvatar = scene.GetScenePresence(originalClient.AgentId);
|
||||
|
||||
Vector3 startPos = new Vector3(128, 128, 30);
|
||||
|
|
|
@ -341,9 +341,9 @@ namespace OpenSim.Tests.Common
|
|||
/// <param name="scene"></param>
|
||||
/// <param name="agentId"></param>
|
||||
/// <returns></returns>
|
||||
public static TestClient AddClient(Scene scene, UUID agentId)
|
||||
public static ScenePresence AddScenePresence(Scene scene, UUID agentId)
|
||||
{
|
||||
return AddClient(scene, GenerateAgentData(agentId));
|
||||
return AddScenePresence(scene, GenerateAgentData(agentId));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -364,7 +364,7 @@ namespace OpenSim.Tests.Common
|
|||
/// <param name="scene"></param>
|
||||
/// <param name="agentData"></param>
|
||||
/// <returns></returns>
|
||||
public static TestClient AddClient(Scene scene, AgentCircuitData agentData)
|
||||
public static ScenePresence AddScenePresence(Scene scene, AgentCircuitData agentData)
|
||||
{
|
||||
string reason;
|
||||
|
||||
|
@ -386,7 +386,7 @@ namespace OpenSim.Tests.Common
|
|||
scp.CompleteMovement(client);
|
||||
//scp.MakeRootAgent(new Vector3(90, 90, 90), true);
|
||||
|
||||
return client;
|
||||
return scp;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
Loading…
Reference in New Issue