29 using System.Collections.Generic;
30 using System.Reflection;
32 using NUnit.Framework;
34 using OpenSim.Framework;
35 using OpenSim.Region.CoreModules.Framework.EntityTransfer;
36 using OpenSim.Region.CoreModules.Framework.InventoryAccess;
37 using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation;
38 using OpenSim.Region.CoreModules.World.Permissions;
39 using OpenSim.Region.Framework.Scenes;
40 using OpenSim.Services.Interfaces;
41 using OpenSim.Tests.Common;
43 namespace OpenSim.
Region.Framework.Scenes.Tests
61 Util.FireAndForgetMethod = FireAndForgetMethod.RegressionTest;
70 Util.FireAndForgetMethod = Util.DefaultFireAndForgetMethod;
79 TestHelpers.InMethod();
81 UUID userId = UUID.Parse(
"10000000-0000-0000-0000-000000000001");
84 IConfigSource configSource =
new IniConfigSource();
85 IConfig config = configSource.AddConfig(
"Startup");
86 config.Set(
"serverside_object_permissions",
true);
88 IClientAPI client = SceneHelpers.AddScenePresence(scene, userId).ControllingClient;
95 uint soLocalId = so.LocalId;
97 List<uint> localIds =
new List<uint>();
98 localIds.Add(so.LocalId);
99 scene.DeRezObjects(client, localIds, UUID.Zero, DeRezAction.Delete, UUID.Zero);
106 sogd.InventoryDeQueueAndDelete();
109 Assert.That(retrievedPart, Is.Null);
118 TestHelpers.InMethod();
122 TestScene sceneA = sh.SetupScene(
"sceneA", TestHelpers.ParseTail(0x100), 1000, 1000);
123 TestScene sceneB = sh.SetupScene(
"sceneB", TestHelpers.ParseTail(0x200), 1000, 999);
128 IConfigSource config =
new IniConfigSource();
129 IConfig modulesConfig = config.AddConfig(
"Modules");
130 modulesConfig.Set(
"EntityTransferModule", etmB.Name);
131 modulesConfig.Set(
"SimulationServices", lscm.Name);
132 SceneHelpers.SetupSceneModules(
new Scene[] { sceneA, sceneB }, config, lscm);
133 SceneHelpers.SetupSceneModules(sceneB, config, etmB);
138 UserAccount uaA = UserAccountHelpers.CreateUserWithInventory(sceneA,
"Andy",
"AAA", 0x1,
"");
139 UserAccount uaB = UserAccountHelpers.CreateUserWithInventory(sceneA,
"Brian",
"BBB", 0x2,
"");
147 List<TestClient> childClientsB =
new List<TestClient>();
148 EntityTransferHelpers.SetupInformClientOfNeighbourTriggersNeighbourClientCreate(clientB, childClientsB);
150 SceneHelpers.AddScenePresence(sceneB, clientB, acd);
153 uint soLocalId = so.LocalId;
155 sceneA.DeleteSceneObject(so,
false);
167 TestHelpers.InMethod();
170 UUID userId = UUID.Parse(
"10000000-0000-0000-0000-000000000001");
171 UUID objectOwnerId = UUID.Parse(
"20000000-0000-0000-0000-000000000001");
174 IConfigSource configSource =
new IniConfigSource();
175 IConfig config = configSource.AddConfig(
"Startup");
176 config.Set(
"serverside_object_permissions",
true);
178 IClientAPI client = SceneHelpers.AddScenePresence(scene, userId).ControllingClient;
182 sogd.Enabled =
false;
188 List<uint> localIds =
new List<uint>();
189 localIds.Add(part.LocalId);
191 scene.DeRezObjects(client, localIds, UUID.Zero, DeRezAction.Delete, UUID.Zero);
192 sogd.InventoryDeQueueAndDelete();
195 SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId);
196 Assert.That(retrievedPart.UUID, Is.EqualTo(part.UUID));
205 TestHelpers.InMethod();
208 UUID agentId = UUID.Parse(
"00000000-0000-0000-0000-000000000001");
209 string myObjectName =
"Fred";
213 IConfigSource configSource =
new IniConfigSource();
214 IConfig config = configSource.AddConfig(
"Modules");
215 config.Set(
"InventoryAccessModule",
"BasicInventoryAccessModule");
216 SceneHelpers.SetupSceneModules(
219 SceneHelpers.SetupSceneModules(scene,
new object[] { });
223 sogd.Enabled =
false;
225 SceneObjectGroup so = SceneHelpers.AddSceneObject(scene, myObjectName, agentId);
227 UserAccount ua = UserAccountHelpers.CreateUserWithInventory(scene, agentId);
229 = UserInventoryHelpers.CreateInventoryFolder(scene.InventoryService, ua.PrincipalID,
"folder1",
false);
231 IClientAPI client = SceneHelpers.AddScenePresence(scene, agentId).ControllingClient;
232 scene.DeRezObjects(client,
new List<uint>() { so.LocalId }, UUID.Zero, DeRezAction.Take, folder1.ID);
239 sogd.InventoryDeQueueAndDelete();
241 Assert.That(so.IsDeleted, Is.True);
244 Assert.That(retrievedPart2, Is.Null);
249 = UserInventoryHelpers.GetInventoryItem(
250 scene.InventoryService, ua.PrincipalID,
"folder1/" + myObjectName);
253 Assert.That(retrievedItem, Is.Not.Null);
Tests derez of scene objects.
void TestDeRezSceneObjectToAgents()
Test that child and root agents correctly receive KillObject notifications.
static PrimitiveBaseShape Default
Asynchronously derez objects. This is used to derez large number of objects to inventory without hold...
A scene object group is conceptually an object in the scene. The object is constituted of SceneObject...
Circuit data for an agent. Connection information shared between regions that accept UDP connections ...
Inventory Item - contains all the properties associated with an individual inventory piece...
Helpers for setting up scenes.
static ScenePresence AddScenePresence(Scene scene, UUID agentId)
Add a root agent where the details of the agent connection (apart from the id) are unimportant for th...
void TestDeRezSceneObjectNotOwner()
Test deleting an object from a scene where the deleter is not the owner
void TestDeRezSceneObject()
Test deleting an object from a scene.
void TestDeleteSceneObjectAsyncToUserInventory()
Test deleting an object asynchronously to user inventory.