29 using System.Collections.Generic;
30 using System.Reflection;
32 using System.Threading;
36 using NUnit.Framework;
38 using OpenSim.Framework;
39 using OpenSim.Region.Framework.Scenes;
40 using OpenSim.Region.Framework.Interfaces;
41 using OpenSim.Region.ClientStack.Linden;
42 using OpenSim.Region.CoreModules.Framework.EntityTransfer;
43 using OpenSim.Region.CoreModules.World.Serialiser;
44 using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation;
45 using OpenSim.Tests.Common;
47 using OpenSim.Services.Interfaces;
49 namespace OpenSim.
Region.Framework.Scenes.Tests
94 TestHelpers.InMethod();
97 UUID spUuid = TestHelpers.ParseTail(0x1);
100 SceneHelpers.AddScenePresence(scene, spUuid);
102 Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(spUuid), Is.Not.Null);
103 Assert.That(scene.AuthenticateHandler.GetAgentCircuits().Count, Is.EqualTo(1));
106 Assert.That(sp, Is.Not.Null);
107 Assert.That(sp.IsChildAgent, Is.False);
108 Assert.That(sp.UUID, Is.EqualTo(spUuid));
110 Assert.That(scene.GetScenePresences().Count, Is.EqualTo(1));
122 TestHelpers.InMethod();
125 UUID spUuid = TestHelpers.ParseTail(0x1);
129 int makeRootAgentEvents = 0;
130 scene.EventManager.OnMakeRootAgent += spi => makeRootAgentEvents++;
132 ScenePresence sp = SceneHelpers.AddScenePresence(scene, spUuid);
134 Assert.That(makeRootAgentEvents, Is.EqualTo(1));
138 sp.CompleteMovement(sp.ControllingClient,
true);
140 Assert.That(makeRootAgentEvents, Is.EqualTo(1));
143 Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(spUuid), Is.Not.Null);
144 Assert.That(scene.AuthenticateHandler.GetAgentCircuits().Count, Is.EqualTo(1));
146 Assert.That(sp.IsChildAgent, Is.False);
147 Assert.That(sp.UUID, Is.EqualTo(spUuid));
149 Assert.That(scene.GetScenePresences().Count, Is.EqualTo(1));
155 TestHelpers.InMethod();
158 UUID spUuid = TestHelpers.ParseTail(0x1);
163 IConfigSource config =
new IniConfigSource();
164 IConfig modulesConfig = config.AddConfig(
"Modules");
165 modulesConfig.Set(
"EntityTransferModule", etm.Name);
166 IConfig entityTransferConfig = config.AddConfig(
"EntityTransfer");
170 entityTransferConfig.Set(
"wait_for_callback",
false);
173 SceneHelpers.SetupSceneModules(scene, config, etm);
174 SceneHelpers.AddScenePresence(scene, spUuid);
175 SceneHelpers.AddScenePresence(scene, spUuid);
177 Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(spUuid), Is.Not.Null);
178 Assert.That(scene.AuthenticateHandler.GetAgentCircuits().Count, Is.EqualTo(1));
181 Assert.That(sp, Is.Not.Null);
182 Assert.That(sp.IsChildAgent, Is.False);
183 Assert.That(sp.UUID, Is.EqualTo(spUuid));
189 TestHelpers.InMethod();
193 ScenePresence sp = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseTail(0x1));
195 scene.CloseAgent(sp.UUID,
false);
197 Assert.That(scene.GetScenePresence(sp.UUID), Is.Null);
198 Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(sp.UUID), Is.Null);
199 Assert.That(scene.AuthenticateHandler.GetAgentCircuits().Count, Is.EqualTo(0));
207 TestHelpers.InMethod();
212 IConfigSource configSource =
new IniConfigSource();
213 IConfig config = configSource.AddConfig(
"Modules");
214 config.Set(
"SimulationServices",
"LocalSimulationConnectorModule");
217 TestScene scene = sceneHelpers.SetupScene();
218 SceneHelpers.SetupSceneModules(scene, configSource, lsc);
220 UUID agentId = TestHelpers.ParseTail(0x01);
224 GridRegion region = scene.GridService.GetRegionByName(UUID.Zero, scene.RegionInfo.RegionName);
231 scene.SimulationService.CreateAgent(null, region, acd, (uint)
TeleportFlags.ViaLogin, ctx, out reason);
233 Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(agentId), Is.Not.Null);
234 Assert.That(scene.AuthenticateHandler.GetAgentCircuits().Count, Is.EqualTo(1));
237 Assert.That(scene.GetScenePresence(agentId), Is.Null);
242 scene.AddNewAgent(client, PresenceType.User);
244 Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(agentId), Is.Not.Null);
245 Assert.That(scene.AuthenticateHandler.GetAgentCircuits().Count, Is.EqualTo(1));
248 Assert.That(sp, Is.Not.Null);
249 Assert.That(sp.UUID, Is.EqualTo(agentId));
250 Assert.That(sp.IsChildAgent, Is.True);
263 TestHelpers.InMethod();
271 IConfigSource configSource =
new IniConfigSource();
272 IConfig config = configSource.AddConfig(
"Startup");
273 config.Set(
"serverside_object_permissions",
true);
274 config.Set(
"EventQueue",
true);
279 SceneHelpers.SetupSceneModules(myScene1, configSource, etm, eqgm1);
282 SceneHelpers.SetupSceneModules(myScene2, configSource, etm, eqgm2);
void TestCreateChildScenePresence()
void TestChildAgentEstablishedInNeighbour()
Test that if a root agent logs into a region, a child agent is also established in the neighbouring r...
OpenSim.Framework.Constants.TeleportFlags TeleportFlags
void TestCreateRootScenePresence()
System.Timers.Timer Timer
Circuit data for an agent. Connection information shared between regions that accept UDP connections ...
OpenSim.Services.Interfaces.GridRegion GridRegion
Helpers for setting up scenes.
void TestCreateDuplicateRootScenePresence()
System.Timers.Timer Timer
void TestDupeCompleteMovementCalls()
Test that duplicate complete movement calls are ignored.