SceneSetupHelpers.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563
  1. /*
  2. * Copyright (c) Contributors, http://opensimulator.org/
  3. * See CONTRIBUTORS.TXT for a full list of copyright holders.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions are met:
  7. * * Redistributions of source code must retain the above copyright
  8. * notice, this list of conditions and the following disclaimer.
  9. * * Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. * * Neither the name of the OpenSimulator Project nor the
  13. * names of its contributors may be used to endorse or promote products
  14. * derived from this software without specific prior written permission.
  15. *
  16. * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
  17. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  18. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  19. * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
  20. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  21. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  22. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  23. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  24. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  25. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. */
  27. using System;
  28. using System.Net;
  29. using System.Collections.Generic;
  30. using Nini.Config;
  31. using OpenMetaverse;
  32. using OpenSim.Framework;
  33. using OpenSim.Framework.Communications;
  34. using OpenSim.Framework.Console;
  35. using OpenSim.Framework.Servers;
  36. using OpenSim.Framework.Servers.HttpServer;
  37. using OpenSim.Region.Physics.Manager;
  38. using OpenSim.Region.Framework;
  39. using OpenSim.Region.Framework.Interfaces;
  40. using OpenSim.Region.Framework.Scenes;
  41. using OpenSim.Region.CoreModules.Agent.Capabilities;
  42. using OpenSim.Region.CoreModules.Avatar.Gods;
  43. using OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset;
  44. using OpenSim.Region.CoreModules.ServiceConnectorsOut.Authentication;
  45. using OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory;
  46. using OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid;
  47. using OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts;
  48. using OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence;
  49. using OpenSim.Services.Interfaces;
  50. using OpenSim.Tests.Common.Mock;
  51. namespace OpenSim.Tests.Common.Setup
  52. {
  53. /// <summary>
  54. /// Helpers for setting up scenes.
  55. /// </summary>
  56. public class SceneSetupHelpers
  57. {
  58. // These static variables in order to allow regions to be linked by shared modules and same
  59. // CommunicationsManager.
  60. private static ISharedRegionModule m_assetService = null;
  61. // private static ISharedRegionModule m_authenticationService = null;
  62. private static ISharedRegionModule m_inventoryService = null;
  63. private static ISharedRegionModule m_gridService = null;
  64. private static ISharedRegionModule m_userAccountService = null;
  65. private static ISharedRegionModule m_presenceService = null;
  66. /// <summary>
  67. /// Set up a test scene
  68. /// </summary>
  69. ///
  70. /// Automatically starts service threads, as would the normal runtime.
  71. ///
  72. /// <returns></returns>
  73. public static TestScene SetupScene()
  74. {
  75. return SetupScene("");
  76. }
  77. /// <summary>
  78. /// Set up a test scene
  79. /// </summary>
  80. ///
  81. /// <param name="realServices">Starts real inventory and asset services, as opposed to mock ones, if true</param>
  82. /// <returns></returns>
  83. public static TestScene SetupScene(String realServices)
  84. {
  85. return SetupScene(
  86. "Unit test region", UUID.Random(), 1000, 1000, realServices);
  87. }
  88. // REFACTORING PROBLEM. No idea what the difference is with the previous one
  89. ///// <summary>
  90. ///// Set up a test scene
  91. ///// </summary>
  92. /////
  93. ///// <param name="realServices">Starts real inventory and asset services, as opposed to mock ones, if true</param>
  94. ///// <param name="cm">This should be the same if simulating two scenes within a standalone</param>
  95. ///// <returns></returns>
  96. //public static TestScene SetupScene(String realServices)
  97. //{
  98. // return SetupScene(
  99. // "Unit test region", UUID.Random(), 1000, 1000, "");
  100. //}
  101. /// <summary>
  102. /// Set up a test scene
  103. /// </summary>
  104. /// <param name="name">Name of the region</param>
  105. /// <param name="id">ID of the region</param>
  106. /// <param name="x">X co-ordinate of the region</param>
  107. /// <param name="y">Y co-ordinate of the region</param>
  108. /// <param name="cm">This should be the same if simulating two scenes within a standalone</param>
  109. /// <returns></returns>
  110. public static TestScene SetupScene(string name, UUID id, uint x, uint y)
  111. {
  112. return SetupScene(name, id, x, y,"");
  113. }
  114. /// <summary>
  115. /// Set up a scene. If it's more then one scene, use the same CommunicationsManager to link regions
  116. /// or a different, to get a brand new scene with new shared region modules.
  117. /// </summary>
  118. /// <param name="name">Name of the region</param>
  119. /// <param name="id">ID of the region</param>
  120. /// <param name="x">X co-ordinate of the region</param>
  121. /// <param name="y">Y co-ordinate of the region</param>
  122. /// <param name="cm">This should be the same if simulating two scenes within a standalone</param>
  123. /// <param name="realServices">Starts real inventory and asset services, as opposed to mock ones, if true</param>
  124. /// <returns></returns>
  125. public static TestScene SetupScene(
  126. string name, UUID id, uint x, uint y, String realServices)
  127. {
  128. bool newScene = false;
  129. Console.WriteLine("Setting up test scene {0}", name);
  130. // REFACTORING PROBLEM!
  131. //// If cm is the same as our last commsManager used, this means the tester wants to link
  132. //// regions. In this case, don't use the sameshared region modules and dont initialize them again.
  133. //// Also, no need to start another MainServer and MainConsole instance.
  134. //if (cm == null || cm != commsManager)
  135. //{
  136. // System.Console.WriteLine("Starting a brand new scene");
  137. // newScene = true;
  138. MainConsole.Instance = new MockConsole("TEST PROMPT");
  139. // MainServer.Instance = new BaseHttpServer(980);
  140. // commsManager = cm;
  141. //}
  142. // We must set up a console otherwise setup of some modules may fail
  143. RegionInfo regInfo = new RegionInfo(x, y, new IPEndPoint(IPAddress.Loopback, 9000), "127.0.0.1");
  144. regInfo.RegionName = name;
  145. regInfo.RegionID = id;
  146. AgentCircuitManager acm = new AgentCircuitManager();
  147. SceneCommunicationService scs = new SceneCommunicationService();
  148. StorageManager sm = new StorageManager("OpenSim.Data.Null.dll", "", "");
  149. IConfigSource configSource = new IniConfigSource();
  150. TestScene testScene = new TestScene(
  151. regInfo, acm, scs, sm, null, false, false, false, configSource, null);
  152. INonSharedRegionModule capsModule = new CapabilitiesModule();
  153. capsModule.Initialise(new IniConfigSource());
  154. testScene.AddRegionModule(capsModule.Name, capsModule);
  155. capsModule.AddRegion(testScene);
  156. IRegionModule godsModule = new GodsModule();
  157. godsModule.Initialise(testScene, new IniConfigSource());
  158. testScene.AddModule(godsModule.Name, godsModule);
  159. realServices = realServices.ToLower();
  160. // IConfigSource config = new IniConfigSource();
  161. // If we have a brand new scene, need to initialize shared region modules
  162. if ((m_assetService == null && m_inventoryService == null) || newScene)
  163. {
  164. if (realServices.Contains("asset"))
  165. StartAssetService(testScene, true);
  166. else
  167. StartAssetService(testScene, false);
  168. // For now, always started a 'real' authentication service
  169. StartAuthenticationService(testScene, true);
  170. if (realServices.Contains("inventory"))
  171. StartInventoryService(testScene, true);
  172. else
  173. StartInventoryService(testScene, false);
  174. StartGridService(testScene, true);
  175. StartUserAccountService(testScene);
  176. StartPresenceService(testScene);
  177. }
  178. // If not, make sure the shared module gets references to this new scene
  179. else
  180. {
  181. m_assetService.AddRegion(testScene);
  182. m_assetService.RegionLoaded(testScene);
  183. m_inventoryService.AddRegion(testScene);
  184. m_inventoryService.RegionLoaded(testScene);
  185. m_userAccountService.AddRegion(testScene);
  186. m_userAccountService.RegionLoaded(testScene);
  187. m_presenceService.AddRegion(testScene);
  188. m_presenceService.RegionLoaded(testScene);
  189. }
  190. m_inventoryService.PostInitialise();
  191. m_assetService.PostInitialise();
  192. m_userAccountService.PostInitialise();
  193. m_presenceService.PostInitialise();
  194. testScene.RegionInfo.EstateSettings.EstateOwner = UUID.Random();
  195. testScene.SetModuleInterfaces();
  196. testScene.LandChannel = new TestLandChannel(testScene);
  197. testScene.LoadWorldMap();
  198. PhysicsPluginManager physicsPluginManager = new PhysicsPluginManager();
  199. physicsPluginManager.LoadPluginsFromAssembly("Physics/OpenSim.Region.Physics.BasicPhysicsPlugin.dll");
  200. testScene.PhysicsScene
  201. = physicsPluginManager.GetPhysicsScene("basicphysics", "ZeroMesher", new IniConfigSource(), "test");
  202. // It's really not a good idea to use static variables as they carry over between tests, leading to
  203. // problems that are extremely hard to debug. Really, these static fields need to be eliminated -
  204. // tests using multiple regions that need to share modules need to find another solution.
  205. m_assetService = null;
  206. m_inventoryService = null;
  207. m_gridService = null;
  208. m_userAccountService = null;
  209. m_presenceService = null;
  210. testScene.RegionInfo.EstateSettings = new EstateSettings();
  211. testScene.LoginsDisabled = false;
  212. return testScene;
  213. }
  214. private static void StartAssetService(Scene testScene, bool real)
  215. {
  216. ISharedRegionModule assetService = new LocalAssetServicesConnector();
  217. IConfigSource config = new IniConfigSource();
  218. config.AddConfig("Modules");
  219. config.AddConfig("AssetService");
  220. config.Configs["Modules"].Set("AssetServices", "LocalAssetServicesConnector");
  221. if (real)
  222. config.Configs["AssetService"].Set("LocalServiceModule", "OpenSim.Services.AssetService.dll:AssetService");
  223. else
  224. config.Configs["AssetService"].Set("LocalServiceModule", "OpenSim.Tests.Common.dll:MockAssetService");
  225. config.Configs["AssetService"].Set("StorageProvider", "OpenSim.Tests.Common.dll");
  226. assetService.Initialise(config);
  227. assetService.AddRegion(testScene);
  228. assetService.RegionLoaded(testScene);
  229. testScene.AddRegionModule(assetService.Name, assetService);
  230. m_assetService = assetService;
  231. }
  232. private static void StartAuthenticationService(Scene testScene, bool real)
  233. {
  234. ISharedRegionModule service = new LocalAuthenticationServicesConnector();
  235. IConfigSource config = new IniConfigSource();
  236. config.AddConfig("Modules");
  237. config.AddConfig("AuthenticationService");
  238. config.Configs["Modules"].Set("AuthenticationServices", "LocalAuthenticationServicesConnector");
  239. if (real)
  240. config.Configs["AuthenticationService"].Set(
  241. "LocalServiceModule", "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService");
  242. else
  243. config.Configs["AuthenticationService"].Set(
  244. "LocalServiceModule", "OpenSim.Tests.Common.dll:MockAuthenticationService");
  245. config.Configs["AuthenticationService"].Set("StorageProvider", "OpenSim.Data.Null.dll");
  246. service.Initialise(config);
  247. service.AddRegion(testScene);
  248. service.RegionLoaded(testScene);
  249. testScene.AddRegionModule(service.Name, service);
  250. //m_authenticationService = service;
  251. }
  252. private static void StartInventoryService(Scene testScene, bool real)
  253. {
  254. ISharedRegionModule inventoryService = new LocalInventoryServicesConnector();
  255. IConfigSource config = new IniConfigSource();
  256. config.AddConfig("Modules");
  257. config.AddConfig("InventoryService");
  258. config.Configs["Modules"].Set("InventoryServices", "LocalInventoryServicesConnector");
  259. if (real)
  260. {
  261. config.Configs["InventoryService"].Set("LocalServiceModule", "OpenSim.Services.InventoryService.dll:InventoryService");
  262. }
  263. else
  264. {
  265. config.Configs["InventoryService"].Set("LocalServiceModule", "OpenSim.Tests.Common.dll:MockInventoryService");
  266. }
  267. config.Configs["InventoryService"].Set("StorageProvider", "OpenSim.Tests.Common.dll");
  268. inventoryService.Initialise(config);
  269. inventoryService.AddRegion(testScene);
  270. inventoryService.RegionLoaded(testScene);
  271. testScene.AddRegionModule(inventoryService.Name, inventoryService);
  272. m_inventoryService = inventoryService;
  273. }
  274. private static void StartGridService(Scene testScene, bool real)
  275. {
  276. IConfigSource config = new IniConfigSource();
  277. config.AddConfig("Modules");
  278. config.AddConfig("GridService");
  279. config.Configs["Modules"].Set("GridServices", "LocalGridServicesConnector");
  280. config.Configs["GridService"].Set("StorageProvider", "OpenSim.Data.Null.dll:NullRegionData");
  281. if (real)
  282. config.Configs["GridService"].Set("LocalServiceModule", "OpenSim.Services.GridService.dll:GridService");
  283. if (m_gridService == null)
  284. {
  285. ISharedRegionModule gridService = new LocalGridServicesConnector();
  286. gridService.Initialise(config);
  287. m_gridService = gridService;
  288. }
  289. //else
  290. // config.Configs["GridService"].Set("LocalServiceModule", "OpenSim.Tests.Common.dll:TestGridService");
  291. m_gridService.AddRegion(testScene);
  292. m_gridService.RegionLoaded(testScene);
  293. //testScene.AddRegionModule(m_gridService.Name, m_gridService);
  294. }
  295. /// <summary>
  296. /// Start a user account service
  297. /// </summary>
  298. /// <param name="testScene"></param>
  299. private static void StartUserAccountService(Scene testScene)
  300. {
  301. IConfigSource config = new IniConfigSource();
  302. config.AddConfig("Modules");
  303. config.AddConfig("UserAccountService");
  304. config.Configs["Modules"].Set("UserAccountServices", "LocalUserAccountServicesConnector");
  305. config.Configs["UserAccountService"].Set("StorageProvider", "OpenSim.Data.Null.dll");
  306. config.Configs["UserAccountService"].Set(
  307. "LocalServiceModule", "OpenSim.Services.UserAccountService.dll:UserAccountService");
  308. if (m_userAccountService == null)
  309. {
  310. ISharedRegionModule userAccountService = new LocalUserAccountServicesConnector();
  311. userAccountService.Initialise(config);
  312. m_userAccountService = userAccountService;
  313. }
  314. m_userAccountService.AddRegion(testScene);
  315. m_userAccountService.RegionLoaded(testScene);
  316. testScene.AddRegionModule(m_userAccountService.Name, m_userAccountService);
  317. }
  318. /// <summary>
  319. /// Start a presence service
  320. /// </summary>
  321. /// <param name="testScene"></param>
  322. private static void StartPresenceService(Scene testScene)
  323. {
  324. IConfigSource config = new IniConfigSource();
  325. config.AddConfig("Modules");
  326. config.AddConfig("PresenceService");
  327. config.Configs["Modules"].Set("PresenceServices", "LocalPresenceServicesConnector");
  328. config.Configs["PresenceService"].Set("StorageProvider", "OpenSim.Data.Null.dll");
  329. config.Configs["PresenceService"].Set(
  330. "LocalServiceModule", "OpenSim.Services.PresenceService.dll:PresenceService");
  331. if (m_presenceService == null)
  332. {
  333. ISharedRegionModule presenceService = new LocalPresenceServicesConnector();
  334. presenceService.Initialise(config);
  335. m_presenceService = presenceService;
  336. }
  337. m_presenceService.AddRegion(testScene);
  338. m_presenceService.RegionLoaded(testScene);
  339. testScene.AddRegionModule(m_presenceService.Name, m_presenceService);
  340. }
  341. /// <summary>
  342. /// Setup modules for a scene using their default settings.
  343. /// </summary>
  344. /// <param name="scene"></param>
  345. /// <param name="modules"></param>
  346. public static void SetupSceneModules(Scene scene, params object[] modules)
  347. {
  348. SetupSceneModules(scene, new IniConfigSource(), modules);
  349. }
  350. /// <summary>
  351. /// Setup modules for a scene.
  352. /// </summary>
  353. /// <param name="scene"></param>
  354. /// <param name="config"></param>
  355. /// <param name="modules"></param>
  356. public static void SetupSceneModules(Scene scene, IConfigSource config, params object[] modules)
  357. {
  358. List<IRegionModuleBase> newModules = new List<IRegionModuleBase>();
  359. foreach (object module in modules)
  360. {
  361. if (module is IRegionModule)
  362. {
  363. IRegionModule m = (IRegionModule)module;
  364. m.Initialise(scene, config);
  365. scene.AddModule(m.Name, m);
  366. m.PostInitialise();
  367. }
  368. else if (module is IRegionModuleBase)
  369. {
  370. // for the new system, everything has to be initialised first,
  371. // shared modules have to be post-initialised, then all get an AddRegion with the scene
  372. IRegionModuleBase m = (IRegionModuleBase)module;
  373. m.Initialise(config);
  374. newModules.Add(m);
  375. }
  376. }
  377. foreach (IRegionModuleBase module in newModules)
  378. {
  379. if (module is ISharedRegionModule) ((ISharedRegionModule)module).PostInitialise();
  380. }
  381. foreach (IRegionModuleBase module in newModules)
  382. {
  383. module.AddRegion(scene);
  384. module.RegionLoaded(scene);
  385. scene.AddRegionModule(module.Name, module);
  386. }
  387. scene.SetModuleInterfaces();
  388. }
  389. /// <summary>
  390. /// Generate some standard agent connection data.
  391. /// </summary>
  392. /// <param name="agentId"></param>
  393. /// <returns></returns>
  394. public static AgentCircuitData GenerateAgentData(UUID agentId)
  395. {
  396. string firstName = "testfirstname";
  397. AgentCircuitData agentData = new AgentCircuitData();
  398. agentData.AgentID = agentId;
  399. agentData.firstname = firstName;
  400. agentData.lastname = "testlastname";
  401. agentData.SessionID = UUID.Zero;
  402. agentData.SecureSessionID = UUID.Zero;
  403. agentData.circuitcode = 123;
  404. agentData.BaseFolder = UUID.Zero;
  405. agentData.InventoryFolder = UUID.Zero;
  406. agentData.startpos = Vector3.Zero;
  407. agentData.CapsPath = "http://wibble.com";
  408. return agentData;
  409. }
  410. /// <summary>
  411. /// Add a root agent where the details of the agent connection (apart from the id) are unimportant for the test
  412. /// </summary>
  413. /// <param name="scene"></param>
  414. /// <param name="agentId"></param>
  415. /// <returns></returns>
  416. public static TestClient AddRootAgent(Scene scene, UUID agentId)
  417. {
  418. return AddRootAgent(scene, GenerateAgentData(agentId));
  419. }
  420. /// <summary>
  421. /// Add a root agent.
  422. /// </summary>
  423. ///
  424. /// This function
  425. ///
  426. /// 1) Tells the scene that an agent is coming. Normally, the login service (local if standalone, from the
  427. /// userserver if grid) would give initial login data back to the client and separately tell the scene that the
  428. /// agent was coming.
  429. ///
  430. /// 2) Connects the agent with the scene
  431. ///
  432. /// This function performs actions equivalent with notifying the scene that an agent is
  433. /// coming and then actually connecting the agent to the scene. The one step missed out is the very first
  434. ///
  435. /// <param name="scene"></param>
  436. /// <param name="agentData"></param>
  437. /// <returns></returns>
  438. public static TestClient AddRootAgent(Scene scene, AgentCircuitData agentData)
  439. {
  440. string reason;
  441. // We emulate the proper login sequence here by doing things in four stages
  442. // Stage 0: log the presence
  443. scene.PresenceService.LoginAgent(agentData.AgentID.ToString(), agentData.SessionID, agentData.SecureSessionID);
  444. // Stage 1: simulate login by telling the scene to expect a new user connection
  445. if (!scene.NewUserConnection(agentData, (uint)TeleportFlags.ViaLogin, out reason))
  446. Console.WriteLine("NewUserConnection failed: " + reason);
  447. // Stage 2: add the new client as a child agent to the scene
  448. TestClient client = new TestClient(agentData, scene);
  449. scene.AddNewClient(client);
  450. // Stage 3: Invoke agent crossing, which converts the child agent into a root agent (with appearance,
  451. // inventory, etc.)
  452. //scene.AgentCrossing(agentData.AgentID, new Vector3(90, 90, 90), false); OBSOLETE
  453. ScenePresence scp = scene.GetScenePresence(agentData.AgentID);
  454. scp.MakeRootAgent(new Vector3(90, 90, 90), true);
  455. return client;
  456. }
  457. /// <summary>
  458. /// Add a test object
  459. /// </summary>
  460. /// <param name="scene"></param>
  461. /// <returns></returns>
  462. public static SceneObjectPart AddSceneObject(Scene scene)
  463. {
  464. return AddSceneObject(scene, "Test Object");
  465. }
  466. /// <summary>
  467. /// Add a test object
  468. /// </summary>
  469. /// <param name="scene"></param>
  470. /// <param name="name"></param>
  471. /// <returns></returns>
  472. public static SceneObjectPart AddSceneObject(Scene scene, string name)
  473. {
  474. SceneObjectPart part
  475. = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero);
  476. part.Name = name;
  477. //part.UpdatePrimFlags(false, false, true);
  478. //part.ObjectFlags |= (uint)PrimFlags.Phantom;
  479. scene.AddNewSceneObject(new SceneObjectGroup(part), false);
  480. return part;
  481. }
  482. /// <summary>
  483. /// Delete a scene object asynchronously
  484. /// </summary>
  485. /// <param name="scene"></param>
  486. /// <param name="part"></param>
  487. /// <param name="action"></param>
  488. /// <param name="destinationId"></param>
  489. /// <param name="client"></param>
  490. public static void DeleteSceneObjectAsync(
  491. TestScene scene, SceneObjectPart part, DeRezAction action, UUID destinationId, IClientAPI client)
  492. {
  493. // Turn off the timer on the async sog deleter - we'll crank it by hand within a unit test
  494. AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter;
  495. sogd.Enabled = false;
  496. scene.DeRezObject(client, part.LocalId, UUID.Zero, action, destinationId);
  497. sogd.InventoryDeQueueAndDelete();
  498. }
  499. }
  500. }