diff options
author | BlueWall | 2012-11-25 17:03:14 -0500 |
---|---|---|
committer | BlueWall | 2012-11-25 17:03:14 -0500 |
commit | c754003944d0166bf50b4f94b0c0eea642503bb0 (patch) | |
tree | dfa1c2020d5500d510519d5b2b3236600692f277 /OpenSim/Region/Framework/Scenes | |
parent | Merge branch 'master' into connector_plugin (diff) | |
parent | Combine TestDeleteSceneObjectAsync() with TestDeRezSceneObject() as they are ... (diff) | |
download | opensim-SC-c754003944d0166bf50b4f94b0c0eea642503bb0.zip opensim-SC-c754003944d0166bf50b4f94b0c0eea642503bb0.tar.gz opensim-SC-c754003944d0166bf50b4f94b0c0eea642503bb0.tar.bz2 opensim-SC-c754003944d0166bf50b4f94b0c0eea642503bb0.tar.xz |
Merge branch 'master' into connector_plugin
Conflicts:
OpenSim/Server/Base/ServicesServerBase.cs
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
29 files changed, 425 insertions, 402 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs b/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs index ad421ee..65ae445 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs | |||
@@ -41,6 +41,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
41 | { | 41 | { |
42 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 42 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
43 | 43 | ||
44 | private OpenSim.Framework.Animation m_implicitDefaultAnimation = new OpenSim.Framework.Animation(); | ||
44 | private OpenSim.Framework.Animation m_defaultAnimation = new OpenSim.Framework.Animation(); | 45 | private OpenSim.Framework.Animation m_defaultAnimation = new OpenSim.Framework.Animation(); |
45 | private List<OpenSim.Framework.Animation> m_animations = new List<OpenSim.Framework.Animation>(); | 46 | private List<OpenSim.Framework.Animation> m_animations = new List<OpenSim.Framework.Animation>(); |
46 | 47 | ||
@@ -49,6 +50,11 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
49 | get { return m_defaultAnimation; } | 50 | get { return m_defaultAnimation; } |
50 | } | 51 | } |
51 | 52 | ||
53 | public OpenSim.Framework.Animation ImplicitDefaultAnimation | ||
54 | { | ||
55 | get { return m_implicitDefaultAnimation; } | ||
56 | } | ||
57 | |||
52 | public AnimationSet() | 58 | public AnimationSet() |
53 | { | 59 | { |
54 | ResetDefaultAnimation(); | 60 | ResetDefaultAnimation(); |
@@ -119,11 +125,18 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
119 | if (m_defaultAnimation.AnimID != animID) | 125 | if (m_defaultAnimation.AnimID != animID) |
120 | { | 126 | { |
121 | m_defaultAnimation = new OpenSim.Framework.Animation(animID, sequenceNum, objectID); | 127 | m_defaultAnimation = new OpenSim.Framework.Animation(animID, sequenceNum, objectID); |
128 | m_implicitDefaultAnimation = m_defaultAnimation; | ||
122 | return true; | 129 | return true; |
123 | } | 130 | } |
124 | return false; | 131 | return false; |
125 | } | 132 | } |
126 | 133 | ||
134 | // Called from serialization only | ||
135 | public void SetImplicitDefaultAnimation(UUID animID, int sequenceNum, UUID objectID) | ||
136 | { | ||
137 | m_implicitDefaultAnimation = new OpenSim.Framework.Animation(animID, sequenceNum, objectID); | ||
138 | } | ||
139 | |||
127 | protected bool ResetDefaultAnimation() | 140 | protected bool ResetDefaultAnimation() |
128 | { | 141 | { |
129 | return TrySetDefaultAnimation("STAND", 1, UUID.Zero); | 142 | return TrySetDefaultAnimation("STAND", 1, UUID.Zero); |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index b23ddb4..ad40d6b 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -1909,8 +1909,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
1909 | } | 1909 | } |
1910 | } | 1910 | } |
1911 | 1911 | ||
1912 | public virtual void DeRezObjects(IClientAPI remoteClient, List<uint> localIDs, | 1912 | /// <summary> |
1913 | UUID groupID, DeRezAction action, UUID destinationID) | 1913 | /// Derez one or more objects from the scene. |
1914 | /// </summary> | ||
1915 | /// <remarks> | ||
1916 | /// Won't actually remove the scene object in the case where the object is being copied to a user inventory. | ||
1917 | /// </remarks> | ||
1918 | /// <param name='remoteClient'>Client requesting derez</param> | ||
1919 | /// <param name='localIDs'>Local ids of root parts of objects to delete.</param> | ||
1920 | /// <param name='groupID'>Not currently used. Here because the client passes this to us.</param> | ||
1921 | /// <param name='action'>DeRezAction</param> | ||
1922 | /// <param name='destinationID'>User folder ID to place derezzed object</param> | ||
1923 | public virtual void DeRezObjects( | ||
1924 | IClientAPI remoteClient, List<uint> localIDs, UUID groupID, DeRezAction action, UUID destinationID) | ||
1914 | { | 1925 | { |
1915 | // First, see of we can perform the requested action and | 1926 | // First, see of we can perform the requested action and |
1916 | // build a list of eligible objects | 1927 | // build a list of eligible objects |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index 6e53951..df43271 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs | |||
@@ -38,7 +38,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
38 | { | 38 | { |
39 | public partial class Scene | 39 | public partial class Scene |
40 | { | 40 | { |
41 | 41 | /// <summary> | |
42 | /// Send chat to listeners. | ||
43 | /// </summary> | ||
44 | /// <param name='message'></param> | ||
45 | /// <param name='type'>/param> | ||
46 | /// <param name='channel'></param> | ||
47 | /// <param name='fromPos'></param> | ||
48 | /// <param name='fromName'></param> | ||
49 | /// <param name='fromID'></param> | ||
50 | /// <param name='targetID'></param> | ||
51 | /// <param name='fromAgent'></param> | ||
52 | /// <param name='broadcast'></param> | ||
42 | protected void SimChat(byte[] message, ChatTypeEnum type, int channel, Vector3 fromPos, string fromName, | 53 | protected void SimChat(byte[] message, ChatTypeEnum type, int channel, Vector3 fromPos, string fromName, |
43 | UUID fromID, UUID targetID, bool fromAgent, bool broadcast) | 54 | UUID fromID, UUID targetID, bool fromAgent, bool broadcast) |
44 | { | 55 | { |
@@ -66,6 +77,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
66 | args.From = fromName; | 77 | args.From = fromName; |
67 | args.TargetUUID = targetID; | 78 | args.TargetUUID = targetID; |
68 | 79 | ||
80 | // m_log.DebugFormat( | ||
81 | // "[SCENE]: Sending message {0} on channel {1}, type {2} from {3}, broadcast {4}", | ||
82 | // args.Message.Replace("\n", "\\n"), args.Channel, args.Type, fromName, broadcast); | ||
83 | |||
69 | if (broadcast) | 84 | if (broadcast) |
70 | EventManager.TriggerOnChatBroadcast(this, args); | 85 | EventManager.TriggerOnChatBroadcast(this, args); |
71 | else | 86 | else |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 5f45529..1ad5edd 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -176,7 +176,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
176 | protected List<RegionInfo> m_regionRestartNotifyList = new List<RegionInfo>(); | 176 | protected List<RegionInfo> m_regionRestartNotifyList = new List<RegionInfo>(); |
177 | protected List<RegionInfo> m_neighbours = new List<RegionInfo>(); | 177 | protected List<RegionInfo> m_neighbours = new List<RegionInfo>(); |
178 | protected string m_simulatorVersion = "OpenSimulator Server"; | 178 | protected string m_simulatorVersion = "OpenSimulator Server"; |
179 | protected ModuleLoader m_moduleLoader; | ||
180 | protected AgentCircuitManager m_authenticateHandler; | 179 | protected AgentCircuitManager m_authenticateHandler; |
181 | protected SceneCommunicationService m_sceneGridService; | 180 | protected SceneCommunicationService m_sceneGridService; |
182 | 181 | ||
@@ -659,7 +658,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
659 | public Scene(RegionInfo regInfo, AgentCircuitManager authen, | 658 | public Scene(RegionInfo regInfo, AgentCircuitManager authen, |
660 | SceneCommunicationService sceneGridService, | 659 | SceneCommunicationService sceneGridService, |
661 | ISimulationDataService simDataService, IEstateDataService estateDataService, | 660 | ISimulationDataService simDataService, IEstateDataService estateDataService, |
662 | ModuleLoader moduleLoader, bool dumpAssetsToFile, | 661 | bool dumpAssetsToFile, |
663 | IConfigSource config, string simulatorVersion) | 662 | IConfigSource config, string simulatorVersion) |
664 | : this(regInfo) | 663 | : this(regInfo) |
665 | { | 664 | { |
@@ -670,7 +669,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
670 | Random random = new Random(); | 669 | Random random = new Random(); |
671 | 670 | ||
672 | m_lastAllocatedLocalId = (uint)(random.NextDouble() * (double)(uint.MaxValue / 2)) + (uint)(uint.MaxValue / 4); | 671 | m_lastAllocatedLocalId = (uint)(random.NextDouble() * (double)(uint.MaxValue / 2)) + (uint)(uint.MaxValue / 4); |
673 | m_moduleLoader = moduleLoader; | ||
674 | m_authenticateHandler = authen; | 672 | m_authenticateHandler = authen; |
675 | m_sceneGridService = sceneGridService; | 673 | m_sceneGridService = sceneGridService; |
676 | m_SimulationDataService = simDataService; | 674 | m_SimulationDataService = simDataService; |
@@ -742,7 +740,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
742 | // | 740 | // |
743 | // Out of memory | 741 | // Out of memory |
744 | // Operating system has killed the plugin | 742 | // Operating system has killed the plugin |
745 | m_sceneGraph.UnRecoverableError += RestartNow; | 743 | m_sceneGraph.UnRecoverableError |
744 | += () => | ||
745 | { | ||
746 | m_log.ErrorFormat("[SCENE]: Restarting region {0} due to unrecoverable physics crash", Name); | ||
747 | RestartNow(); | ||
748 | }; | ||
746 | 749 | ||
747 | RegisterDefaultSceneEvents(); | 750 | RegisterDefaultSceneEvents(); |
748 | 751 | ||
@@ -1136,15 +1139,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1136 | } | 1139 | } |
1137 | } | 1140 | } |
1138 | 1141 | ||
1139 | m_log.Error("[REGION]: Closing"); | 1142 | m_log.InfoFormat("[REGION]: Restarting region {0}", Name); |
1140 | Close(); | ||
1141 | 1143 | ||
1142 | if (PhysicsScene != null) | 1144 | Close(); |
1143 | { | ||
1144 | PhysicsScene.Dispose(); | ||
1145 | } | ||
1146 | |||
1147 | m_log.Error("[REGION]: Firing Region Restart Message"); | ||
1148 | 1145 | ||
1149 | base.Restart(); | 1146 | base.Restart(); |
1150 | } | 1147 | } |
@@ -1267,6 +1264,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
1267 | // This is the method that shuts down the scene. | 1264 | // This is the method that shuts down the scene. |
1268 | public override void Close() | 1265 | public override void Close() |
1269 | { | 1266 | { |
1267 | if (m_shuttingDown) | ||
1268 | { | ||
1269 | m_log.WarnFormat("[SCENE]: Ignoring close request because already closing {0}", Name); | ||
1270 | return; | ||
1271 | } | ||
1272 | |||
1270 | m_log.InfoFormat("[SCENE]: Closing down the single simulator: {0}", RegionInfo.RegionName); | 1273 | m_log.InfoFormat("[SCENE]: Closing down the single simulator: {0}", RegionInfo.RegionName); |
1271 | 1274 | ||
1272 | StatsReporter.Close(); | 1275 | StatsReporter.Close(); |
@@ -1310,6 +1313,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
1310 | 1313 | ||
1311 | m_sceneGraph.Close(); | 1314 | m_sceneGraph.Close(); |
1312 | 1315 | ||
1316 | if (!GridService.DeregisterRegion(RegionInfo.RegionID)) | ||
1317 | m_log.WarnFormat("[SCENE]: Deregister from grid failed for region {0}", Name); | ||
1318 | |||
1319 | base.Close(); | ||
1320 | |||
1321 | // XEngine currently listens to the EventManager.OnShutdown event to trigger script stop and persistence. | ||
1322 | // Therefore. we must dispose of the PhysicsScene after this to prevent a window where script code can | ||
1323 | // attempt to reference a null or disposed physics scene. | ||
1313 | if (PhysicsScene != null) | 1324 | if (PhysicsScene != null) |
1314 | { | 1325 | { |
1315 | PhysicsScene phys = PhysicsScene; | 1326 | PhysicsScene phys = PhysicsScene; |
@@ -1318,12 +1329,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1318 | phys.Dispose(); | 1329 | phys.Dispose(); |
1319 | phys = null; | 1330 | phys = null; |
1320 | } | 1331 | } |
1321 | |||
1322 | if (!GridService.DeregisterRegion(RegionInfo.RegionID)) | ||
1323 | m_log.WarnFormat("[SCENE]: Deregister from grid failed for region {0}", Name); | ||
1324 | |||
1325 | // call the base class Close method. | ||
1326 | base.Close(); | ||
1327 | } | 1332 | } |
1328 | 1333 | ||
1329 | /// <summary> | 1334 | /// <summary> |
@@ -1684,12 +1689,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
1684 | 1689 | ||
1685 | private void CheckAtTargets() | 1690 | private void CheckAtTargets() |
1686 | { | 1691 | { |
1687 | Dictionary<UUID, SceneObjectGroup>.ValueCollection objs; | 1692 | List<SceneObjectGroup> objs = null; |
1693 | |||
1688 | lock (m_groupsWithTargets) | 1694 | lock (m_groupsWithTargets) |
1689 | objs = m_groupsWithTargets.Values; | 1695 | { |
1696 | if (m_groupsWithTargets.Count != 0) | ||
1697 | objs = new List<SceneObjectGroup>(m_groupsWithTargets.Values); | ||
1698 | } | ||
1690 | 1699 | ||
1691 | foreach (SceneObjectGroup entry in objs) | 1700 | if (objs != null) |
1692 | entry.checkAtTargets(); | 1701 | { |
1702 | foreach (SceneObjectGroup entry in objs) | ||
1703 | entry.checkAtTargets(); | ||
1704 | } | ||
1693 | } | 1705 | } |
1694 | 1706 | ||
1695 | /// <summary> | 1707 | /// <summary> |
@@ -3373,9 +3385,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
3373 | } | 3385 | } |
3374 | else | 3386 | else |
3375 | { | 3387 | { |
3376 | // We remove the acd up here to avoid later raec conditions if two RemoveClient() calls occurred | 3388 | // We remove the acd up here to avoid later race conditions if two RemoveClient() calls occurred |
3377 | // simultaneously. | 3389 | // simultaneously. |
3378 | m_authenticateHandler.RemoveCircuit(acd.circuitcode); | 3390 | // We also need to remove by agent ID since NPCs will have no circuit code. |
3391 | m_authenticateHandler.RemoveCircuit(agentID); | ||
3379 | } | 3392 | } |
3380 | } | 3393 | } |
3381 | 3394 | ||
@@ -3427,9 +3440,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
3427 | if (closeChildAgents && CapsModule != null) | 3440 | if (closeChildAgents && CapsModule != null) |
3428 | CapsModule.RemoveCaps(agentID); | 3441 | CapsModule.RemoveCaps(agentID); |
3429 | 3442 | ||
3430 | // REFACTORING PROBLEM -- well not really a problem, but just to point out that whatever | 3443 | // // REFACTORING PROBLEM -- well not really a problem, but just to point out that whatever |
3431 | // this method is doing is HORRIBLE!!! | 3444 | // // this method is doing is HORRIBLE!!! |
3432 | avatar.Scene.NeedSceneCacheClear(avatar.UUID); | 3445 | // Commented pending deletion since this method no longer appears to do anything at all |
3446 | // avatar.Scene.NeedSceneCacheClear(avatar.UUID); | ||
3433 | 3447 | ||
3434 | if (closeChildAgents && !isChildAgent) | 3448 | if (closeChildAgents && !isChildAgent) |
3435 | { | 3449 | { |
@@ -4688,13 +4702,24 @@ namespace OpenSim.Region.Framework.Scenes | |||
4688 | /// Get a group via its UUID | 4702 | /// Get a group via its UUID |
4689 | /// </summary> | 4703 | /// </summary> |
4690 | /// <param name="fullID"></param> | 4704 | /// <param name="fullID"></param> |
4691 | /// <returns>null if no group with that name exists</returns> | 4705 | /// <returns>null if no group with that id exists</returns> |
4692 | public SceneObjectGroup GetSceneObjectGroup(UUID fullID) | 4706 | public SceneObjectGroup GetSceneObjectGroup(UUID fullID) |
4693 | { | 4707 | { |
4694 | return m_sceneGraph.GetSceneObjectGroup(fullID); | 4708 | return m_sceneGraph.GetSceneObjectGroup(fullID); |
4695 | } | 4709 | } |
4696 | 4710 | ||
4697 | /// <summary> | 4711 | /// <summary> |
4712 | /// Get a group via its local ID | ||
4713 | /// </summary> | ||
4714 | /// <remarks>This will only return a group if the local ID matches a root part</remarks> | ||
4715 | /// <param name="localID"></param> | ||
4716 | /// <returns>null if no group with that id exists</returns> | ||
4717 | public SceneObjectGroup GetSceneObjectGroup(uint localID) | ||
4718 | { | ||
4719 | return m_sceneGraph.GetSceneObjectGroup(localID); | ||
4720 | } | ||
4721 | |||
4722 | /// <summary> | ||
4698 | /// Get a group by name from the scene (will return the first | 4723 | /// Get a group by name from the scene (will return the first |
4699 | /// found, if there are more than one prim with the same name) | 4724 | /// found, if there are more than one prim with the same name) |
4700 | /// </summary> | 4725 | /// </summary> |
@@ -4854,14 +4879,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
4854 | client.SendRegionHandle(regionID, handle); | 4879 | client.SendRegionHandle(regionID, handle); |
4855 | } | 4880 | } |
4856 | 4881 | ||
4857 | public bool NeedSceneCacheClear(UUID agentID) | 4882 | // Commented pending deletion since this method no longer appears to do anything at all |
4858 | { | 4883 | // public bool NeedSceneCacheClear(UUID agentID) |
4859 | IInventoryTransferModule inv = RequestModuleInterface<IInventoryTransferModule>(); | 4884 | // { |
4860 | if (inv == null) | 4885 | // IInventoryTransferModule inv = RequestModuleInterface<IInventoryTransferModule>(); |
4861 | return true; | 4886 | // if (inv == null) |
4862 | 4887 | // return true; | |
4863 | return inv.NeedSceneCacheClear(agentID, this); | 4888 | // |
4864 | } | 4889 | // return inv.NeedSceneCacheClear(agentID, this); |
4890 | // } | ||
4865 | 4891 | ||
4866 | public void CleanTempObjects() | 4892 | public void CleanTempObjects() |
4867 | { | 4893 | { |
diff --git a/OpenSim/Region/Framework/Scenes/SceneBase.cs b/OpenSim/Region/Framework/Scenes/SceneBase.cs index b87a38a..d3e968e 100644 --- a/OpenSim/Region/Framework/Scenes/SceneBase.cs +++ b/OpenSim/Region/Framework/Scenes/SceneBase.cs | |||
@@ -67,12 +67,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
67 | /// <value> | 67 | /// <value> |
68 | /// All the region modules attached to this scene. | 68 | /// All the region modules attached to this scene. |
69 | /// </value> | 69 | /// </value> |
70 | public Dictionary<string, IRegionModule> Modules | ||
71 | { | ||
72 | get { return m_modules; } | ||
73 | } | ||
74 | protected Dictionary<string, IRegionModule> m_modules = new Dictionary<string, IRegionModule>(); | ||
75 | |||
76 | public Dictionary<string, IRegionModuleBase> RegionModules | 70 | public Dictionary<string, IRegionModuleBase> RegionModules |
77 | { | 71 | { |
78 | get { return m_regionModules; } | 72 | get { return m_regionModules; } |
@@ -272,16 +266,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
272 | /// </summary> | 266 | /// </summary> |
273 | public virtual void Close() | 267 | public virtual void Close() |
274 | { | 268 | { |
275 | // Shut down all non shared modules. | ||
276 | foreach (IRegionModule module in Modules.Values) | ||
277 | { | ||
278 | if (!module.IsSharedModule) | ||
279 | { | ||
280 | module.Close(); | ||
281 | } | ||
282 | } | ||
283 | Modules.Clear(); | ||
284 | |||
285 | try | 269 | try |
286 | { | 270 | { |
287 | EventManager.TriggerShutdown(); | 271 | EventManager.TriggerShutdown(); |
@@ -312,19 +296,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
312 | #region Module Methods | 296 | #region Module Methods |
313 | 297 | ||
314 | /// <summary> | 298 | /// <summary> |
315 | /// Add a module to this scene. | ||
316 | /// </summary> | ||
317 | /// <param name="name"></param> | ||
318 | /// <param name="module"></param> | ||
319 | public void AddModule(string name, IRegionModule module) | ||
320 | { | ||
321 | if (!Modules.ContainsKey(name)) | ||
322 | { | ||
323 | Modules.Add(name, module); | ||
324 | } | ||
325 | } | ||
326 | |||
327 | /// <summary> | ||
328 | /// Add a region-module to this scene. TODO: This will replace AddModule in the future. | 299 | /// Add a region-module to this scene. TODO: This will replace AddModule in the future. |
329 | /// </summary> | 300 | /// </summary> |
330 | /// <param name="name"></param> | 301 | /// <param name="name"></param> |
@@ -508,9 +479,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
508 | /// <param name="shorthelp"></param> | 479 | /// <param name="shorthelp"></param> |
509 | /// <param name="longhelp"></param> | 480 | /// <param name="longhelp"></param> |
510 | /// <param name="callback"></param> | 481 | /// <param name="callback"></param> |
511 | public void AddCommand(object mod, string command, string shorthelp, string longhelp, CommandDelegate callback) | 482 | public void AddCommand(IRegionModuleBase module, string command, string shorthelp, string longhelp, CommandDelegate callback) |
512 | { | 483 | { |
513 | AddCommand(mod, command, shorthelp, longhelp, string.Empty, callback); | 484 | AddCommand(module, command, shorthelp, longhelp, string.Empty, callback); |
514 | } | 485 | } |
515 | 486 | ||
516 | /// <summary> | 487 | /// <summary> |
@@ -528,9 +499,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
528 | /// <param name="longhelp"></param> | 499 | /// <param name="longhelp"></param> |
529 | /// <param name="callback"></param> | 500 | /// <param name="callback"></param> |
530 | public void AddCommand( | 501 | public void AddCommand( |
531 | string category, object mod, string command, string shorthelp, string longhelp, CommandDelegate callback) | 502 | string category, IRegionModuleBase module, string command, string shorthelp, string longhelp, CommandDelegate callback) |
532 | { | 503 | { |
533 | AddCommand(category, mod, command, shorthelp, longhelp, string.Empty, callback); | 504 | AddCommand(category, module, command, shorthelp, longhelp, string.Empty, callback); |
534 | } | 505 | } |
535 | 506 | ||
536 | /// <summary> | 507 | /// <summary> |
@@ -542,29 +513,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
542 | /// <param name="longhelp"></param> | 513 | /// <param name="longhelp"></param> |
543 | /// <param name="descriptivehelp"></param> | 514 | /// <param name="descriptivehelp"></param> |
544 | /// <param name="callback"></param> | 515 | /// <param name="callback"></param> |
545 | public void AddCommand(object mod, string command, string shorthelp, string longhelp, string descriptivehelp, CommandDelegate callback) | 516 | public void AddCommand(IRegionModuleBase module, string command, string shorthelp, string longhelp, string descriptivehelp, CommandDelegate callback) |
546 | { | 517 | { |
547 | string moduleName = ""; | 518 | string moduleName = ""; |
548 | 519 | ||
549 | if (mod != null) | 520 | if (module != null) |
550 | { | 521 | moduleName = module.Name; |
551 | if (mod is IRegionModule) | ||
552 | { | ||
553 | IRegionModule module = (IRegionModule)mod; | ||
554 | moduleName = module.Name; | ||
555 | } | ||
556 | else if (mod is IRegionModuleBase) | ||
557 | { | ||
558 | IRegionModuleBase module = (IRegionModuleBase)mod; | ||
559 | moduleName = module.Name; | ||
560 | } | ||
561 | else | ||
562 | { | ||
563 | throw new Exception("AddCommand module parameter must be IRegionModule or IRegionModuleBase"); | ||
564 | } | ||
565 | } | ||
566 | 522 | ||
567 | AddCommand(moduleName, mod, command, shorthelp, longhelp, descriptivehelp, callback); | 523 | AddCommand(moduleName, module, command, shorthelp, longhelp, descriptivehelp, callback); |
568 | } | 524 | } |
569 | 525 | ||
570 | /// <summary> | 526 | /// <summary> |
@@ -580,7 +536,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
580 | /// <param name="descriptivehelp"></param> | 536 | /// <param name="descriptivehelp"></param> |
581 | /// <param name="callback"></param> | 537 | /// <param name="callback"></param> |
582 | public void AddCommand( | 538 | public void AddCommand( |
583 | string category, object mod, string command, | 539 | string category, IRegionModuleBase module, string command, |
584 | string shorthelp, string longhelp, string descriptivehelp, CommandDelegate callback) | 540 | string shorthelp, string longhelp, string descriptivehelp, CommandDelegate callback) |
585 | { | 541 | { |
586 | if (MainConsole.Instance == null) | 542 | if (MainConsole.Instance == null) |
@@ -588,22 +544,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
588 | 544 | ||
589 | bool shared = false; | 545 | bool shared = false; |
590 | 546 | ||
591 | if (mod != null) | 547 | if (module != null) |
592 | { | 548 | shared = module is ISharedRegionModule; |
593 | if (mod is IRegionModule) | ||
594 | { | ||
595 | IRegionModule module = (IRegionModule)mod; | ||
596 | shared = module.IsSharedModule; | ||
597 | } | ||
598 | else if (mod is IRegionModuleBase) | ||
599 | { | ||
600 | shared = mod is ISharedRegionModule; | ||
601 | } | ||
602 | else | ||
603 | { | ||
604 | throw new Exception("AddCommand module parameter must be IRegionModule or IRegionModuleBase"); | ||
605 | } | ||
606 | } | ||
607 | 549 | ||
608 | MainConsole.Instance.Commands.AddCommand( | 550 | MainConsole.Instance.Commands.AddCommand( |
609 | category, shared, command, shorthelp, longhelp, descriptivehelp, callback); | 551 | category, shared, command, shorthelp, longhelp, descriptivehelp, callback); |
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 209a770..a4383fd 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs | |||
@@ -983,6 +983,30 @@ namespace OpenSim.Region.Framework.Scenes | |||
983 | } | 983 | } |
984 | 984 | ||
985 | /// <summary> | 985 | /// <summary> |
986 | /// Get a group in the scene | ||
987 | /// </summary> | ||
988 | /// <remarks> | ||
989 | /// This will only return a group if the local ID matches the root part, not other parts. | ||
990 | /// </remarks> | ||
991 | /// <param name="localID">Local id of the root part of the group</param> | ||
992 | /// <returns>null if no such group was found</returns> | ||
993 | protected internal SceneObjectGroup GetSceneObjectGroup(uint localID) | ||
994 | { | ||
995 | lock (SceneObjectGroupsByLocalPartID) | ||
996 | { | ||
997 | if (SceneObjectGroupsByLocalPartID.ContainsKey(localID)) | ||
998 | { | ||
999 | SceneObjectGroup so = SceneObjectGroupsByLocalPartID[localID]; | ||
1000 | |||
1001 | if (so.LocalId == localID) | ||
1002 | return so; | ||
1003 | } | ||
1004 | } | ||
1005 | |||
1006 | return null; | ||
1007 | } | ||
1008 | |||
1009 | /// <summary> | ||
986 | /// Get a group by name from the scene (will return the first | 1010 | /// Get a group by name from the scene (will return the first |
987 | /// found, if there are more than one prim with the same name) | 1011 | /// found, if there are more than one prim with the same name) |
988 | /// </summary> | 1012 | /// </summary> |
diff --git a/OpenSim/Region/Framework/Scenes/SceneManager.cs b/OpenSim/Region/Framework/Scenes/SceneManager.cs index cb5b2ba..1e2e973 100644 --- a/OpenSim/Region/Framework/Scenes/SceneManager.cs +++ b/OpenSim/Region/Framework/Scenes/SceneManager.cs | |||
@@ -100,23 +100,25 @@ namespace OpenSim.Region.Framework.Scenes | |||
100 | } | 100 | } |
101 | 101 | ||
102 | private readonly List<Scene> m_localScenes = new List<Scene>(); | 102 | private readonly List<Scene> m_localScenes = new List<Scene>(); |
103 | private Scene m_currentScene = null; | ||
104 | 103 | ||
105 | public List<Scene> Scenes | 104 | public List<Scene> Scenes |
106 | { | 105 | { |
107 | get { return new List<Scene>(m_localScenes); } | 106 | get { return new List<Scene>(m_localScenes); } |
108 | } | 107 | } |
109 | 108 | ||
110 | public Scene CurrentScene | 109 | /// <summary> |
111 | { | 110 | /// Scene selected from the console. |
112 | get { return m_currentScene; } | 111 | /// </summary> |
113 | } | 112 | /// <value> |
113 | /// If null, then all scenes are considered selected (signalled as "Root" on the console). | ||
114 | /// </value> | ||
115 | public Scene CurrentScene { get; private set; } | ||
114 | 116 | ||
115 | public Scene CurrentOrFirstScene | 117 | public Scene CurrentOrFirstScene |
116 | { | 118 | { |
117 | get | 119 | get |
118 | { | 120 | { |
119 | if (m_currentScene == null) | 121 | if (CurrentScene == null) |
120 | { | 122 | { |
121 | lock (m_localScenes) | 123 | lock (m_localScenes) |
122 | { | 124 | { |
@@ -128,7 +130,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
128 | } | 130 | } |
129 | else | 131 | else |
130 | { | 132 | { |
131 | return m_currentScene; | 133 | return CurrentScene; |
132 | } | 134 | } |
133 | } | 135 | } |
134 | } | 136 | } |
@@ -141,31 +143,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
141 | 143 | ||
142 | public void Close() | 144 | public void Close() |
143 | { | 145 | { |
144 | // collect known shared modules in sharedModules | ||
145 | Dictionary<string, IRegionModule> sharedModules = new Dictionary<string, IRegionModule>(); | ||
146 | |||
147 | lock (m_localScenes) | 146 | lock (m_localScenes) |
148 | { | 147 | { |
149 | for (int i = 0; i < m_localScenes.Count; i++) | 148 | for (int i = 0; i < m_localScenes.Count; i++) |
150 | { | 149 | { |
151 | // extract known shared modules from scene | ||
152 | foreach (string k in m_localScenes[i].Modules.Keys) | ||
153 | { | ||
154 | if (m_localScenes[i].Modules[k].IsSharedModule && | ||
155 | !sharedModules.ContainsKey(k)) | ||
156 | sharedModules[k] = m_localScenes[i].Modules[k]; | ||
157 | } | ||
158 | // close scene/region | ||
159 | m_localScenes[i].Close(); | 150 | m_localScenes[i].Close(); |
160 | } | 151 | } |
161 | } | 152 | } |
162 | |||
163 | // all regions/scenes are now closed, we can now safely | ||
164 | // close all shared modules | ||
165 | foreach (IRegionModule mod in sharedModules.Values) | ||
166 | { | ||
167 | mod.Close(); | ||
168 | } | ||
169 | } | 153 | } |
170 | 154 | ||
171 | public void Close(Scene cscene) | 155 | public void Close(Scene cscene) |
@@ -196,8 +180,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
196 | 180 | ||
197 | public void HandleRestart(RegionInfo rdata) | 181 | public void HandleRestart(RegionInfo rdata) |
198 | { | 182 | { |
199 | m_log.Error("[SCENEMANAGER]: Got Restart message for region:" + rdata.RegionName + " Sending up to main"); | 183 | Scene restartedScene = null; |
200 | int RegionSceneElement = -1; | ||
201 | 184 | ||
202 | lock (m_localScenes) | 185 | lock (m_localScenes) |
203 | { | 186 | { |
@@ -205,19 +188,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
205 | { | 188 | { |
206 | if (rdata.RegionName == m_localScenes[i].RegionInfo.RegionName) | 189 | if (rdata.RegionName == m_localScenes[i].RegionInfo.RegionName) |
207 | { | 190 | { |
208 | RegionSceneElement = i; | 191 | restartedScene = m_localScenes[i]; |
192 | m_localScenes.RemoveAt(i); | ||
193 | break; | ||
209 | } | 194 | } |
210 | } | 195 | } |
211 | |||
212 | // Now we make sure the region is no longer known about by the SceneManager | ||
213 | // Prevents duplicates. | ||
214 | |||
215 | if (RegionSceneElement >= 0) | ||
216 | { | ||
217 | m_localScenes.RemoveAt(RegionSceneElement); | ||
218 | } | ||
219 | } | 196 | } |
220 | 197 | ||
198 | // If the currently selected scene has been restarted, then we can't reselect here since we the scene | ||
199 | // hasn't yet been recreated. We will have to leave this to the caller. | ||
200 | if (CurrentScene == restartedScene) | ||
201 | CurrentScene = null; | ||
202 | |||
221 | // Send signal to main that we're restarting this sim. | 203 | // Send signal to main that we're restarting this sim. |
222 | OnRestartSim(rdata); | 204 | OnRestartSim(rdata); |
223 | } | 205 | } |
@@ -359,14 +341,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
359 | 341 | ||
360 | private void ForEachCurrentScene(Action<Scene> func) | 342 | private void ForEachCurrentScene(Action<Scene> func) |
361 | { | 343 | { |
362 | if (m_currentScene == null) | 344 | if (CurrentScene == null) |
363 | { | 345 | { |
364 | lock (m_localScenes) | 346 | lock (m_localScenes) |
365 | m_localScenes.ForEach(func); | 347 | m_localScenes.ForEach(func); |
366 | } | 348 | } |
367 | else | 349 | else |
368 | { | 350 | { |
369 | func(m_currentScene); | 351 | func(CurrentScene); |
370 | } | 352 | } |
371 | } | 353 | } |
372 | 354 | ||
@@ -386,7 +368,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
386 | || (String.Compare(regionName, "..") == 0) | 368 | || (String.Compare(regionName, "..") == 0) |
387 | || (String.Compare(regionName, "/") == 0)) | 369 | || (String.Compare(regionName, "/") == 0)) |
388 | { | 370 | { |
389 | m_currentScene = null; | 371 | CurrentScene = null; |
390 | return true; | 372 | return true; |
391 | } | 373 | } |
392 | else | 374 | else |
@@ -397,7 +379,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
397 | { | 379 | { |
398 | if (String.Compare(scene.RegionInfo.RegionName, regionName, true) == 0) | 380 | if (String.Compare(scene.RegionInfo.RegionName, regionName, true) == 0) |
399 | { | 381 | { |
400 | m_currentScene = scene; | 382 | CurrentScene = scene; |
401 | return true; | 383 | return true; |
402 | } | 384 | } |
403 | } | 385 | } |
@@ -417,7 +399,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
417 | { | 399 | { |
418 | if (scene.RegionInfo.RegionID == regionID) | 400 | if (scene.RegionInfo.RegionID == regionID) |
419 | { | 401 | { |
420 | m_currentScene = scene; | 402 | CurrentScene = scene; |
421 | return true; | 403 | return true; |
422 | } | 404 | } |
423 | } | 405 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 27ef4c9..f79ac96 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -2239,7 +2239,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
2239 | 2239 | ||
2240 | // play the sound. | 2240 | // play the sound. |
2241 | if (startedColliders.Count > 0 && CollisionSound != UUID.Zero && CollisionSoundVolume > 0.0f) | 2241 | if (startedColliders.Count > 0 && CollisionSound != UUID.Zero && CollisionSoundVolume > 0.0f) |
2242 | SendSound(CollisionSound.ToString(), CollisionSoundVolume, true, (byte)0, 0, false, false); | 2242 | { |
2243 | ISoundModule soundModule = ParentGroup.Scene.RequestModuleInterface<ISoundModule>(); | ||
2244 | if (soundModule != null) | ||
2245 | { | ||
2246 | soundModule.SendSound(UUID, CollisionSound, | ||
2247 | CollisionSoundVolume, true, (byte)0, 0, false, | ||
2248 | false); | ||
2249 | } | ||
2250 | } | ||
2243 | 2251 | ||
2244 | SendCollisionEvent(scriptEvents.collision_start, startedColliders, ParentGroup.Scene.EventManager.TriggerScriptCollidingStart); | 2252 | SendCollisionEvent(scriptEvents.collision_start, startedColliders, ParentGroup.Scene.EventManager.TriggerScriptCollidingStart); |
2245 | SendCollisionEvent(scriptEvents.collision , m_lastColliders , ParentGroup.Scene.EventManager.TriggerScriptColliding); | 2253 | SendCollisionEvent(scriptEvents.collision , m_lastColliders , ParentGroup.Scene.EventManager.TriggerScriptColliding); |
@@ -2287,37 +2295,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2287 | ScheduleTerseUpdate(); | 2295 | ScheduleTerseUpdate(); |
2288 | } | 2296 | } |
2289 | 2297 | ||
2290 | public void PreloadSound(string sound) | ||
2291 | { | ||
2292 | // UUID ownerID = OwnerID; | ||
2293 | UUID objectID = ParentGroup.RootPart.UUID; | ||
2294 | UUID soundID = UUID.Zero; | ||
2295 | |||
2296 | if (!UUID.TryParse(sound, out soundID)) | ||
2297 | { | ||
2298 | //Trys to fetch sound id from prim's inventory. | ||
2299 | //Prim's inventory doesn't support non script items yet | ||
2300 | |||
2301 | lock (TaskInventory) | ||
2302 | { | ||
2303 | foreach (KeyValuePair<UUID, TaskInventoryItem> item in TaskInventory) | ||
2304 | { | ||
2305 | if (item.Value.Name == sound) | ||
2306 | { | ||
2307 | soundID = item.Value.ItemID; | ||
2308 | break; | ||
2309 | } | ||
2310 | } | ||
2311 | } | ||
2312 | } | ||
2313 | |||
2314 | ParentGroup.Scene.ForEachRootScenePresence(delegate(ScenePresence sp) | ||
2315 | { | ||
2316 | if (!(Util.GetDistanceTo(sp.AbsolutePosition, AbsolutePosition) >= 100)) | ||
2317 | sp.ControllingClient.SendPreLoadSound(objectID, objectID, soundID); | ||
2318 | }); | ||
2319 | } | ||
2320 | |||
2321 | public void RemFlag(PrimFlags flag) | 2298 | public void RemFlag(PrimFlags flag) |
2322 | { | 2299 | { |
2323 | // PrimFlags prevflag = Flags; | 2300 | // PrimFlags prevflag = Flags; |
@@ -2676,98 +2653,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2676 | } | 2653 | } |
2677 | 2654 | ||
2678 | /// <summary> | 2655 | /// <summary> |
2679 | /// Trigger or play an attached sound in this part's inventory. | ||
2680 | /// </summary> | ||
2681 | /// <param name="sound"></param> | ||
2682 | /// <param name="volume"></param> | ||
2683 | /// <param name="triggered"></param> | ||
2684 | /// <param name="flags"></param> | ||
2685 | public void SendSound(string sound, double volume, bool triggered, byte flags, float radius, bool useMaster, bool isMaster) | ||
2686 | { | ||
2687 | if (volume > 1) | ||
2688 | volume = 1; | ||
2689 | if (volume < 0) | ||
2690 | volume = 0; | ||
2691 | |||
2692 | UUID ownerID = OwnerID; | ||
2693 | UUID objectID = ParentGroup.RootPart.UUID; | ||
2694 | UUID parentID = ParentGroup.UUID; | ||
2695 | |||
2696 | UUID soundID = UUID.Zero; | ||
2697 | Vector3 position = AbsolutePosition; // region local | ||
2698 | ulong regionHandle = ParentGroup.Scene.RegionInfo.RegionHandle; | ||
2699 | |||
2700 | if (!UUID.TryParse(sound, out soundID)) | ||
2701 | { | ||
2702 | // search sound file from inventory | ||
2703 | lock (TaskInventory) | ||
2704 | { | ||
2705 | foreach (KeyValuePair<UUID, TaskInventoryItem> item in TaskInventory) | ||
2706 | { | ||
2707 | if (item.Value.Name == sound && item.Value.Type == (int)AssetType.Sound) | ||
2708 | { | ||
2709 | soundID = item.Value.ItemID; | ||
2710 | break; | ||
2711 | } | ||
2712 | } | ||
2713 | } | ||
2714 | } | ||
2715 | |||
2716 | if (soundID == UUID.Zero) | ||
2717 | return; | ||
2718 | |||
2719 | ISoundModule soundModule = ParentGroup.Scene.RequestModuleInterface<ISoundModule>(); | ||
2720 | if (soundModule != null) | ||
2721 | { | ||
2722 | if (useMaster) | ||
2723 | { | ||
2724 | if (isMaster) | ||
2725 | { | ||
2726 | if (triggered) | ||
2727 | soundModule.TriggerSound(soundID, ownerID, objectID, parentID, volume, position, regionHandle, radius); | ||
2728 | else | ||
2729 | soundModule.PlayAttachedSound(soundID, ownerID, objectID, volume, position, flags, radius); | ||
2730 | ParentGroup.PlaySoundMasterPrim = this; | ||
2731 | ownerID = OwnerID; | ||
2732 | objectID = ParentGroup.RootPart.UUID; | ||
2733 | parentID = ParentGroup.UUID; | ||
2734 | position = AbsolutePosition; // region local | ||
2735 | regionHandle = ParentGroup.Scene.RegionInfo.RegionHandle; | ||
2736 | if (triggered) | ||
2737 | soundModule.TriggerSound(soundID, ownerID, objectID, parentID, volume, position, regionHandle, radius); | ||
2738 | else | ||
2739 | soundModule.PlayAttachedSound(soundID, ownerID, objectID, volume, position, flags, radius); | ||
2740 | foreach (SceneObjectPart prim in ParentGroup.PlaySoundSlavePrims) | ||
2741 | { | ||
2742 | ownerID = prim.OwnerID; | ||
2743 | objectID = prim.ParentGroup.RootPart.UUID; | ||
2744 | parentID = prim.ParentGroup.UUID; | ||
2745 | position = prim.AbsolutePosition; // region local | ||
2746 | regionHandle = prim.ParentGroup.Scene.RegionInfo.RegionHandle; | ||
2747 | if (triggered) | ||
2748 | soundModule.TriggerSound(soundID, ownerID, objectID, parentID, volume, position, regionHandle, radius); | ||
2749 | else | ||
2750 | soundModule.PlayAttachedSound(soundID, ownerID, objectID, volume, position, flags, radius); | ||
2751 | } | ||
2752 | ParentGroup.PlaySoundSlavePrims.Clear(); | ||
2753 | ParentGroup.PlaySoundMasterPrim = null; | ||
2754 | } | ||
2755 | else | ||
2756 | { | ||
2757 | ParentGroup.PlaySoundSlavePrims.Add(this); | ||
2758 | } | ||
2759 | } | ||
2760 | else | ||
2761 | { | ||
2762 | if (triggered) | ||
2763 | soundModule.TriggerSound(soundID, ownerID, objectID, parentID, volume, position, regionHandle, radius); | ||
2764 | else | ||
2765 | soundModule.PlayAttachedSound(soundID, ownerID, objectID, volume, position, flags, radius); | ||
2766 | } | ||
2767 | } | ||
2768 | } | ||
2769 | |||
2770 | /// <summary> | ||
2771 | /// Send a terse update to all clients | 2656 | /// Send a terse update to all clients |
2772 | /// </summary> | 2657 | /// </summary> |
2773 | public void SendTerseUpdateToAllClients() | 2658 | public void SendTerseUpdateToAllClients() |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index bdb0446..db723fa 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |||
@@ -232,31 +232,49 @@ namespace OpenSim.Region.Framework.Scenes | |||
232 | if (m_part == null || m_part.ParentGroup == null || m_part.ParentGroup.Scene == null) | 232 | if (m_part == null || m_part.ParentGroup == null || m_part.ParentGroup.Scene == null) |
233 | return; | 233 | return; |
234 | 234 | ||
235 | IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>(); | ||
236 | if (engines == null) // No engine at all | ||
237 | return; | ||
238 | |||
239 | lock (Items) | 235 | lock (Items) |
240 | { | 236 | { |
241 | foreach (TaskInventoryItem item in Items.Values) | 237 | foreach (TaskInventoryItem item in Items.Values) |
242 | { | 238 | { |
243 | if (item.InvType == (int)InventoryType.LSL) | 239 | bool running; |
244 | { | 240 | if (TryGetScriptInstanceRunning(m_part.ParentGroup.Scene, item, out running)) |
245 | foreach (IScriptModule e in engines) | 241 | item.ScriptRunning = running; |
246 | { | ||
247 | bool running; | ||
248 | |||
249 | if (e.HasScript(item.ItemID, out running)) | ||
250 | { | ||
251 | item.ScriptRunning = running; | ||
252 | break; | ||
253 | } | ||
254 | } | ||
255 | } | ||
256 | } | 242 | } |
257 | } | 243 | } |
258 | } | 244 | } |
259 | 245 | ||
246 | public bool TryGetScriptInstanceRunning(UUID itemId, out bool running) | ||
247 | { | ||
248 | running = false; | ||
249 | |||
250 | TaskInventoryItem item = GetInventoryItem(itemId); | ||
251 | |||
252 | if (item == null) | ||
253 | return false; | ||
254 | |||
255 | return TryGetScriptInstanceRunning(m_part.ParentGroup.Scene, item, out running); | ||
256 | } | ||
257 | |||
258 | public static bool TryGetScriptInstanceRunning(Scene scene, TaskInventoryItem item, out bool running) | ||
259 | { | ||
260 | running = false; | ||
261 | |||
262 | if (item.InvType != (int)InventoryType.LSL) | ||
263 | return false; | ||
264 | |||
265 | IScriptModule[] engines = scene.RequestModuleInterfaces<IScriptModule>(); | ||
266 | if (engines == null) // No engine at all | ||
267 | return false; | ||
268 | |||
269 | foreach (IScriptModule e in engines) | ||
270 | { | ||
271 | if (e.HasScript(item.ItemID, out running)) | ||
272 | return true; | ||
273 | } | ||
274 | |||
275 | return false; | ||
276 | } | ||
277 | |||
260 | public int CreateScriptInstances(int startParam, bool postOnRez, string engine, int stateSource) | 278 | public int CreateScriptInstances(int startParam, bool postOnRez, string engine, int stateSource) |
261 | { | 279 | { |
262 | int scriptsValidForStarting = 0; | 280 | int scriptsValidForStarting = 0; |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 1222ac6..6f36c0b 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
@@ -68,14 +68,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
68 | public ScriptControlled eventControls; | 68 | public ScriptControlled eventControls; |
69 | } | 69 | } |
70 | 70 | ||
71 | public delegate void SendCourseLocationsMethod(UUID scene, ScenePresence presence, List<Vector3> coarseLocations, List<UUID> avatarUUIDs); | 71 | public delegate void SendCoarseLocationsMethod(UUID scene, ScenePresence presence, List<Vector3> coarseLocations, List<UUID> avatarUUIDs); |
72 | 72 | ||
73 | public class ScenePresence : EntityBase, IScenePresence | 73 | public class ScenePresence : EntityBase, IScenePresence |
74 | { | 74 | { |
75 | // ~ScenePresence() | 75 | // ~ScenePresence() |
76 | // { | 76 | // { |
77 | // m_log.Debug("[SCENE PRESENCE] Destructor called"); | 77 | // m_log.DebugFormat("[SCENE PRESENCE]: Destructor called on {0}", Name); |
78 | // } | 78 | // } |
79 | |||
79 | private void TriggerScenePresenceUpdated() | 80 | private void TriggerScenePresenceUpdated() |
80 | { | 81 | { |
81 | if (m_scene != null) | 82 | if (m_scene != null) |
@@ -186,7 +187,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
186 | /// </summary> | 187 | /// </summary> |
187 | public bool SitGround { get; private set; } | 188 | public bool SitGround { get; private set; } |
188 | 189 | ||
189 | private SendCourseLocationsMethod m_sendCourseLocationsMethod; | 190 | private SendCoarseLocationsMethod m_sendCoarseLocationsMethod; |
190 | 191 | ||
191 | //private Vector3 m_requestedSitOffset = new Vector3(); | 192 | //private Vector3 m_requestedSitOffset = new Vector3(); |
192 | 193 | ||
@@ -537,7 +538,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
537 | { | 538 | { |
538 | try | 539 | try |
539 | { | 540 | { |
540 | PhysicsActor.Velocity = value; | 541 | PhysicsActor.TargetVelocity = value; |
541 | } | 542 | } |
542 | catch (Exception e) | 543 | catch (Exception e) |
543 | { | 544 | { |
@@ -695,7 +696,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
695 | AttachmentsSyncLock = new Object(); | 696 | AttachmentsSyncLock = new Object(); |
696 | AllowMovement = true; | 697 | AllowMovement = true; |
697 | IsChildAgent = true; | 698 | IsChildAgent = true; |
698 | m_sendCourseLocationsMethod = SendCoarseLocationsDefault; | 699 | m_sendCoarseLocationsMethod = SendCoarseLocationsDefault; |
699 | Animator = new ScenePresenceAnimator(this); | 700 | Animator = new ScenePresenceAnimator(this); |
700 | PresenceType = type; | 701 | PresenceType = type; |
701 | DrawDistance = world.DefaultDrawDistance; | 702 | DrawDistance = world.DefaultDrawDistance; |
@@ -1697,8 +1698,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
1697 | // "[SCENE PRESENCE]: Avatar {0} received request to move to position {1} in {2}", | 1698 | // "[SCENE PRESENCE]: Avatar {0} received request to move to position {1} in {2}", |
1698 | // Name, pos, m_scene.RegionInfo.RegionName); | 1699 | // Name, pos, m_scene.RegionInfo.RegionName); |
1699 | 1700 | ||
1700 | if (pos.X < 0 || pos.X >= Constants.RegionSize | 1701 | // Allow move to another sub-region within a megaregion |
1701 | || pos.Y < 0 || pos.Y >= Constants.RegionSize | 1702 | Vector2 regionSize; |
1703 | IRegionCombinerModule regionCombinerModule = m_scene.RequestModuleInterface<IRegionCombinerModule>(); | ||
1704 | if (regionCombinerModule != null) | ||
1705 | regionSize = regionCombinerModule.GetSizeOfMegaregion(m_scene.RegionInfo.RegionID); | ||
1706 | else | ||
1707 | regionSize = new Vector2(Constants.RegionSize); | ||
1708 | |||
1709 | if (pos.X < 0 || pos.X >= regionSize.X | ||
1710 | || pos.Y < 0 || pos.Y >= regionSize.Y | ||
1702 | || pos.Z < 0) | 1711 | || pos.Z < 0) |
1703 | return; | 1712 | return; |
1704 | 1713 | ||
@@ -1712,7 +1721,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
1712 | // pos.Z = AbsolutePosition.Z; | 1721 | // pos.Z = AbsolutePosition.Z; |
1713 | // } | 1722 | // } |
1714 | 1723 | ||
1715 | float terrainHeight = (float)m_scene.Heightmap[(int)pos.X, (int)pos.Y]; | 1724 | // Get terrain height for sub-region in a megaregion if necessary |
1725 | int X = (int)((m_scene.RegionInfo.RegionLocX * Constants.RegionSize) + pos.X); | ||
1726 | int Y = (int)((m_scene.RegionInfo.RegionLocY * Constants.RegionSize) + pos.Y); | ||
1727 | UUID target_regionID = m_scene.GridService.GetRegionByPosition(m_scene.RegionInfo.ScopeID, X, Y).RegionID; | ||
1728 | Scene targetScene = m_scene; | ||
1729 | |||
1730 | if (!SceneManager.Instance.TryGetScene(target_regionID, out targetScene)) | ||
1731 | targetScene = m_scene; | ||
1732 | |||
1733 | float terrainHeight = (float)targetScene.Heightmap[(int)(pos.X % Constants.RegionSize), (int)(pos.Y % Constants.RegionSize)]; | ||
1716 | pos.Z = Math.Max(terrainHeight, pos.Z); | 1734 | pos.Z = Math.Max(terrainHeight, pos.Z); |
1717 | 1735 | ||
1718 | // Fudge factor. It appears that if one clicks "go here" on a piece of ground, the go here request is | 1736 | // Fudge factor. It appears that if one clicks "go here" on a piece of ground, the go here request is |
@@ -2432,17 +2450,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
2432 | 2450 | ||
2433 | public void SendCoarseLocations(List<Vector3> coarseLocations, List<UUID> avatarUUIDs) | 2451 | public void SendCoarseLocations(List<Vector3> coarseLocations, List<UUID> avatarUUIDs) |
2434 | { | 2452 | { |
2435 | SendCourseLocationsMethod d = m_sendCourseLocationsMethod; | 2453 | SendCoarseLocationsMethod d = m_sendCoarseLocationsMethod; |
2436 | if (d != null) | 2454 | if (d != null) |
2437 | { | 2455 | { |
2438 | d.Invoke(m_scene.RegionInfo.originRegionID, this, coarseLocations, avatarUUIDs); | 2456 | d.Invoke(m_scene.RegionInfo.originRegionID, this, coarseLocations, avatarUUIDs); |
2439 | } | 2457 | } |
2440 | } | 2458 | } |
2441 | 2459 | ||
2442 | public void SetSendCourseLocationMethod(SendCourseLocationsMethod d) | 2460 | public void SetSendCoarseLocationMethod(SendCoarseLocationsMethod d) |
2443 | { | 2461 | { |
2444 | if (d != null) | 2462 | if (d != null) |
2445 | m_sendCourseLocationsMethod = d; | 2463 | m_sendCoarseLocationsMethod = d; |
2446 | } | 2464 | } |
2447 | 2465 | ||
2448 | public void SendCoarseLocationsDefault(UUID sceneId, ScenePresence p, List<Vector3> coarseLocations, List<UUID> avatarUUIDs) | 2466 | public void SendCoarseLocationsDefault(UUID sceneId, ScenePresence p, List<Vector3> coarseLocations, List<UUID> avatarUUIDs) |
@@ -2646,7 +2664,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2646 | #region Significant Movement Method | 2664 | #region Significant Movement Method |
2647 | 2665 | ||
2648 | /// <summary> | 2666 | /// <summary> |
2649 | /// This checks for a significant movement and sends a courselocationchange update | 2667 | /// This checks for a significant movement and sends a coarselocationchange update |
2650 | /// </summary> | 2668 | /// </summary> |
2651 | protected void CheckForSignificantMovement() | 2669 | protected void CheckForSignificantMovement() |
2652 | { | 2670 | { |
@@ -3074,6 +3092,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
3074 | cAgent.Anims = Animator.Animations.ToArray(); | 3092 | cAgent.Anims = Animator.Animations.ToArray(); |
3075 | } | 3093 | } |
3076 | catch { } | 3094 | catch { } |
3095 | cAgent.DefaultAnim = Animator.Animations.DefaultAnimation; | ||
3096 | cAgent.AnimState = Animator.Animations.ImplicitDefaultAnimation; | ||
3077 | 3097 | ||
3078 | if (Scene.AttachmentsModule != null) | 3098 | if (Scene.AttachmentsModule != null) |
3079 | Scene.AttachmentsModule.CopyAttachments(this, cAgent); | 3099 | Scene.AttachmentsModule.CopyAttachments(this, cAgent); |
@@ -3145,6 +3165,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
3145 | // FIXME: Why is this null check necessary? Where are the cases where we get a null Anims object? | 3165 | // FIXME: Why is this null check necessary? Where are the cases where we get a null Anims object? |
3146 | if (cAgent.Anims != null) | 3166 | if (cAgent.Anims != null) |
3147 | Animator.Animations.FromArray(cAgent.Anims); | 3167 | Animator.Animations.FromArray(cAgent.Anims); |
3168 | if (cAgent.DefaultAnim != null) | ||
3169 | Animator.Animations.SetDefaultAnimation(cAgent.DefaultAnim.AnimID, cAgent.DefaultAnim.SequenceNum, UUID.Zero); | ||
3170 | if (cAgent.AnimState != null) | ||
3171 | Animator.Animations.SetImplicitDefaultAnimation(cAgent.AnimState.AnimID, cAgent.AnimState.SequenceNum, UUID.Zero); | ||
3148 | 3172 | ||
3149 | if (Scene.AttachmentsModule != null) | 3173 | if (Scene.AttachmentsModule != null) |
3150 | Scene.AttachmentsModule.CopyAttachments(cAgent, this); | 3174 | Scene.AttachmentsModule.CopyAttachments(cAgent, this); |
diff --git a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs index 2addb5b..b9d615e 100644 --- a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs +++ b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs | |||
@@ -245,11 +245,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
245 | = new Stat( | 245 | = new Stat( |
246 | "SlowFrames", | 246 | "SlowFrames", |
247 | "Slow Frames", | 247 | "Slow Frames", |
248 | "Number of frames where frame time has been significantly longer than the desired frame time.", | ||
248 | " frames", | 249 | " frames", |
249 | "scene", | 250 | "scene", |
250 | m_scene.Name, | 251 | m_scene.Name, |
251 | StatVerbosity.Info, | 252 | StatType.Push, |
252 | "Number of frames where frame time has been significantly longer than the desired frame time."); | 253 | null, |
254 | StatVerbosity.Info); | ||
253 | 255 | ||
254 | StatsManager.RegisterStat(SlowFramesStat); | 256 | StatsManager.RegisterStat(SlowFramesStat); |
255 | } | 257 | } |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/BorderTests.cs b/OpenSim/Region/Framework/Scenes/Tests/BorderTests.cs index 4a21dc9..e209221 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/BorderTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/BorderTests.cs | |||
@@ -37,7 +37,7 @@ using OpenSim.Tests.Common; | |||
37 | namespace OpenSim.Region.Framework.Scenes.Tests | 37 | namespace OpenSim.Region.Framework.Scenes.Tests |
38 | { | 38 | { |
39 | [TestFixture] | 39 | [TestFixture] |
40 | public class BorderTests | 40 | public class BorderTests : OpenSimTestCase |
41 | { | 41 | { |
42 | [Test] | 42 | [Test] |
43 | public void TestCross() | 43 | public void TestCross() |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs b/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs index ea9fc93..766ce83 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs | |||
@@ -41,7 +41,7 @@ using OpenSim.Tests.Common; | |||
41 | namespace OpenSim.Region.Framework.Scenes.Tests | 41 | namespace OpenSim.Region.Framework.Scenes.Tests |
42 | { | 42 | { |
43 | [TestFixture, LongRunning] | 43 | [TestFixture, LongRunning] |
44 | public class EntityManagerTests | 44 | public class EntityManagerTests : OpenSimTestCase |
45 | { | 45 | { |
46 | static public Random random; | 46 | static public Random random; |
47 | SceneObjectGroup found; | 47 | SceneObjectGroup found; |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs index d23c965..575a081 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs | |||
@@ -40,7 +40,7 @@ using OpenSim.Tests.Common.Mock; | |||
40 | namespace OpenSim.Region.Framework.Scenes.Tests | 40 | namespace OpenSim.Region.Framework.Scenes.Tests |
41 | { | 41 | { |
42 | [TestFixture] | 42 | [TestFixture] |
43 | public class SceneGraphTests | 43 | public class SceneGraphTests : OpenSimTestCase |
44 | { | 44 | { |
45 | [Test] | 45 | [Test] |
46 | public void TestDuplicateObject() | 46 | public void TestDuplicateObject() |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneManagerTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneManagerTests.cs new file mode 100644 index 0000000..2d831fa --- /dev/null +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneManagerTests.cs | |||
@@ -0,0 +1,58 @@ | |||
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 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Reflection; | ||
31 | using System.Threading; | ||
32 | using NUnit.Framework; | ||
33 | using OpenMetaverse; | ||
34 | using OpenSim.Framework; | ||
35 | using OpenSim.Framework.Communications; | ||
36 | using OpenSim.Region.Framework.Scenes; | ||
37 | using OpenSim.Services.Interfaces; | ||
38 | using OpenSim.Tests.Common; | ||
39 | using OpenSim.Tests.Common.Mock; | ||
40 | |||
41 | namespace OpenSim.Region.Framework.Scenes.Tests | ||
42 | { | ||
43 | [TestFixture] | ||
44 | public class SceneManagerTests : OpenSimTestCase | ||
45 | { | ||
46 | [Test] | ||
47 | public void TestClose() | ||
48 | { | ||
49 | TestHelpers.InMethod(); | ||
50 | |||
51 | SceneHelpers sh = new SceneHelpers(); | ||
52 | Scene scene = sh.SetupScene(); | ||
53 | |||
54 | sh.SceneManager.Close(); | ||
55 | Assert.That(scene.ShuttingDown, Is.True); | ||
56 | } | ||
57 | } | ||
58 | } \ No newline at end of file | ||
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs index 3398a53..a07d64c 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs | |||
@@ -26,13 +26,16 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | ||
29 | using System.Reflection; | 30 | using System.Reflection; |
30 | using System.Threading; | 31 | using System.Threading; |
32 | using Nini.Config; | ||
31 | using NUnit.Framework; | 33 | using NUnit.Framework; |
32 | using OpenMetaverse; | 34 | using OpenMetaverse; |
33 | using OpenSim.Framework; | 35 | using OpenSim.Framework; |
34 | using OpenSim.Framework.Communications; | 36 | using OpenSim.Framework.Communications; |
35 | using OpenSim.Region.Framework.Scenes; | 37 | using OpenSim.Region.Framework.Scenes; |
38 | using OpenSim.Services.Interfaces; | ||
36 | using OpenSim.Tests.Common; | 39 | using OpenSim.Tests.Common; |
37 | using OpenSim.Tests.Common.Mock; | 40 | using OpenSim.Tests.Common.Mock; |
38 | 41 | ||
@@ -42,7 +45,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
42 | /// Basic scene object tests (create, read and delete but not update). | 45 | /// Basic scene object tests (create, read and delete but not update). |
43 | /// </summary> | 46 | /// </summary> |
44 | [TestFixture] | 47 | [TestFixture] |
45 | public class SceneObjectBasicTests | 48 | public class SceneObjectBasicTests : OpenSimTestCase |
46 | { | 49 | { |
47 | // [TearDown] | 50 | // [TearDown] |
48 | // public void TearDown() | 51 | // public void TearDown() |
@@ -180,6 +183,10 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
180 | /// <summary> | 183 | /// <summary> |
181 | /// Test deleting an object from a scene. | 184 | /// Test deleting an object from a scene. |
182 | /// </summary> | 185 | /// </summary> |
186 | /// <remarks> | ||
187 | /// This is the most basic form of delete. For all more sophisticated forms of derez (done asynchrnously | ||
188 | /// and where object can be taken to user inventory, etc.), see SceneObjectDeRezTests. | ||
189 | /// </remarks> | ||
183 | [Test] | 190 | [Test] |
184 | public void TestDeleteSceneObject() | 191 | public void TestDeleteSceneObject() |
185 | { | 192 | { |
@@ -199,78 +206,6 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
199 | } | 206 | } |
200 | 207 | ||
201 | /// <summary> | 208 | /// <summary> |
202 | /// Test deleting an object asynchronously | ||
203 | /// </summary> | ||
204 | [Test] | ||
205 | public void TestDeleteSceneObjectAsync() | ||
206 | { | ||
207 | TestHelpers.InMethod(); | ||
208 | //log4net.Config.XmlConfigurator.Configure(); | ||
209 | |||
210 | UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000001"); | ||
211 | |||
212 | TestScene scene = new SceneHelpers().SetupScene(); | ||
213 | |||
214 | // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. | ||
215 | AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; | ||
216 | sogd.Enabled = false; | ||
217 | |||
218 | SceneObjectGroup so = SceneHelpers.AddSceneObject(scene); | ||
219 | |||
220 | IClientAPI client = SceneHelpers.AddScenePresence(scene, agentId).ControllingClient; | ||
221 | scene.DeRezObjects(client, new System.Collections.Generic.List<uint>() { so.LocalId }, UUID.Zero, DeRezAction.Delete, UUID.Zero); | ||
222 | |||
223 | SceneObjectPart retrievedPart = scene.GetSceneObjectPart(so.LocalId); | ||
224 | |||
225 | Assert.That(retrievedPart, Is.Not.Null); | ||
226 | |||
227 | Assert.That(so.IsDeleted, Is.False); | ||
228 | |||
229 | sogd.InventoryDeQueueAndDelete(); | ||
230 | |||
231 | Assert.That(so.IsDeleted, Is.True); | ||
232 | |||
233 | SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(so.LocalId); | ||
234 | Assert.That(retrievedPart2, Is.Null); | ||
235 | } | ||
236 | |||
237 | /// <summary> | ||
238 | /// Test deleting an object asynchronously to user inventory. | ||
239 | /// </summary> | ||
240 | //[Test] | ||
241 | //public void TestDeleteSceneObjectAsyncToUserInventory() | ||
242 | //{ | ||
243 | // TestHelper.InMethod(); | ||
244 | // //log4net.Config.XmlConfigurator.Configure(); | ||
245 | |||
246 | // UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000001"); | ||
247 | // string myObjectName = "Fred"; | ||
248 | |||
249 | // TestScene scene = SceneSetupHelpers.SetupScene(); | ||
250 | // SceneObjectPart part = SceneSetupHelpers.AddSceneObject(scene, myObjectName); | ||
251 | |||
252 | // Assert.That( | ||
253 | // scene.CommsManager.UserAdminService.AddUser( | ||
254 | // "Bob", "Hoskins", "test", "test@test.com", 1000, 1000, agentId), | ||
255 | // Is.EqualTo(agentId)); | ||
256 | |||
257 | // IClientAPI client = SceneSetupHelpers.AddRootAgent(scene, agentId); | ||
258 | |||
259 | // CachedUserInfo userInfo = scene.CommsManager.UserProfileCacheService.GetUserDetails(agentId); | ||
260 | // Assert.That(userInfo, Is.Not.Null); | ||
261 | // Assert.That(userInfo.RootFolder, Is.Not.Null); | ||
262 | |||
263 | // SceneSetupHelpers.DeleteSceneObjectAsync(scene, part, DeRezAction.Take, userInfo.RootFolder.ID, client); | ||
264 | |||
265 | // // Check that we now have the taken part in our inventory | ||
266 | // Assert.That(myObjectName, Is.EqualTo(userInfo.RootFolder.FindItemByPath(myObjectName).Name)); | ||
267 | |||
268 | // // Check that the taken part has actually disappeared | ||
269 | // SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); | ||
270 | // Assert.That(retrievedPart, Is.Null); | ||
271 | //} | ||
272 | |||
273 | /// <summary> | ||
274 | /// Changing a scene object uuid changes the root part uuid. This is a valid operation if the object is not | 209 | /// Changing a scene object uuid changes the root part uuid. This is a valid operation if the object is not |
275 | /// in a scene and is useful if one wants to supply a UUID directly rather than use the one generated by | 210 | /// in a scene and is useful if one wants to supply a UUID directly rather than use the one generated by |
276 | /// OpenSim. | 211 | /// OpenSim. |
@@ -305,4 +240,4 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
305 | Assert.That(sog.Parts.Length, Is.EqualTo(2)); | 240 | Assert.That(sog.Parts.Length, Is.EqualTo(2)); |
306 | } | 241 | } |
307 | } | 242 | } |
308 | } | 243 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs index 0076f41..c1522e7 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs | |||
@@ -33,22 +33,24 @@ using NUnit.Framework; | |||
33 | using OpenMetaverse; | 33 | using OpenMetaverse; |
34 | using OpenSim.Framework; | 34 | using OpenSim.Framework; |
35 | using OpenSim.Framework.Communications; | 35 | using OpenSim.Framework.Communications; |
36 | using OpenSim.Region.CoreModules.Framework.InventoryAccess; | ||
36 | using OpenSim.Region.CoreModules.World.Permissions; | 37 | using OpenSim.Region.CoreModules.World.Permissions; |
37 | using OpenSim.Region.Framework.Scenes; | 38 | using OpenSim.Region.Framework.Scenes; |
39 | using OpenSim.Services.Interfaces; | ||
38 | using OpenSim.Tests.Common; | 40 | using OpenSim.Tests.Common; |
39 | using OpenSim.Tests.Common.Mock; | 41 | using OpenSim.Tests.Common.Mock; |
40 | 42 | ||
41 | namespace OpenSim.Region.Framework.Scenes.Tests | 43 | namespace OpenSim.Region.Framework.Scenes.Tests |
42 | { | 44 | { |
43 | /// <summary> | 45 | /// <summary> |
44 | /// Tests derez of scene objects by users. | 46 | /// Tests derez of scene objects. |
45 | /// </summary> | 47 | /// </summary> |
46 | /// <remarks> | 48 | /// <remarks> |
47 | /// This is at a level above the SceneObjectBasicTests, which act on the scene directly. | 49 | /// This is at a level above the SceneObjectBasicTests, which act on the scene directly. |
48 | /// TODO: These tests are very incomplete - they only test for a few conditions. | 50 | /// TODO: These tests are incomplete - need to test more kinds of derez (e.g. return object). |
49 | /// </remarks> | 51 | /// </remarks> |
50 | [TestFixture] | 52 | [TestFixture] |
51 | public class SceneObjectDeRezTests | 53 | public class SceneObjectDeRezTests : OpenSimTestCase |
52 | { | 54 | { |
53 | /// <summary> | 55 | /// <summary> |
54 | /// Test deleting an object from a scene. | 56 | /// Test deleting an object from a scene. |
@@ -76,14 +78,20 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
76 | = new SceneObjectPart(userId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero); | 78 | = new SceneObjectPart(userId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero); |
77 | part.Name = "obj1"; | 79 | part.Name = "obj1"; |
78 | scene.AddNewSceneObject(new SceneObjectGroup(part), false); | 80 | scene.AddNewSceneObject(new SceneObjectGroup(part), false); |
81 | |||
79 | List<uint> localIds = new List<uint>(); | 82 | List<uint> localIds = new List<uint>(); |
80 | localIds.Add(part.LocalId); | 83 | localIds.Add(part.LocalId); |
81 | |||
82 | scene.DeRezObjects(client, localIds, UUID.Zero, DeRezAction.Delete, UUID.Zero); | 84 | scene.DeRezObjects(client, localIds, UUID.Zero, DeRezAction.Delete, UUID.Zero); |
85 | |||
86 | // Check that object isn't deleted until we crank the sogd handle. | ||
87 | SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); | ||
88 | Assert.That(retrievedPart, Is.Not.Null); | ||
89 | Assert.That(retrievedPart.ParentGroup.IsDeleted, Is.False); | ||
90 | |||
83 | sogd.InventoryDeQueueAndDelete(); | 91 | sogd.InventoryDeQueueAndDelete(); |
84 | 92 | ||
85 | SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); | 93 | SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(part.LocalId); |
86 | Assert.That(retrievedPart, Is.Null); | 94 | Assert.That(retrievedPart2, Is.Null); |
87 | } | 95 | } |
88 | 96 | ||
89 | /// <summary> | 97 | /// <summary> |
@@ -124,6 +132,67 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
124 | // Object should still be in the scene. | 132 | // Object should still be in the scene. |
125 | SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); | 133 | SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); |
126 | Assert.That(retrievedPart.UUID, Is.EqualTo(part.UUID)); | 134 | Assert.That(retrievedPart.UUID, Is.EqualTo(part.UUID)); |
127 | } | 135 | } |
136 | |||
137 | /// <summary> | ||
138 | /// Test deleting an object asynchronously to user inventory. | ||
139 | /// </summary> | ||
140 | [Test] | ||
141 | public void TestDeleteSceneObjectAsyncToUserInventory() | ||
142 | { | ||
143 | TestHelpers.InMethod(); | ||
144 | // TestHelpers.EnableLogging(); | ||
145 | |||
146 | UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000001"); | ||
147 | string myObjectName = "Fred"; | ||
148 | |||
149 | TestScene scene = new SceneHelpers().SetupScene(); | ||
150 | |||
151 | IConfigSource configSource = new IniConfigSource(); | ||
152 | IConfig config = configSource.AddConfig("Modules"); | ||
153 | config.Set("InventoryAccessModule", "BasicInventoryAccessModule"); | ||
154 | SceneHelpers.SetupSceneModules( | ||
155 | scene, configSource, new object[] { new BasicInventoryAccessModule() }); | ||
156 | |||
157 | SceneHelpers.SetupSceneModules(scene, new object[] { }); | ||
158 | |||
159 | // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. | ||
160 | AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; | ||
161 | sogd.Enabled = false; | ||
162 | |||
163 | SceneObjectGroup so = SceneHelpers.AddSceneObject(scene, myObjectName, agentId); | ||
164 | |||
165 | UserAccount ua = UserAccountHelpers.CreateUserWithInventory(scene, agentId); | ||
166 | InventoryFolderBase folder1 | ||
167 | = UserInventoryHelpers.CreateInventoryFolder(scene.InventoryService, ua.PrincipalID, "folder1"); | ||
168 | |||
169 | IClientAPI client = SceneHelpers.AddScenePresence(scene, agentId).ControllingClient; | ||
170 | scene.DeRezObjects(client, new List<uint>() { so.LocalId }, UUID.Zero, DeRezAction.Take, folder1.ID); | ||
171 | |||
172 | SceneObjectPart retrievedPart = scene.GetSceneObjectPart(so.LocalId); | ||
173 | |||
174 | Assert.That(retrievedPart, Is.Not.Null); | ||
175 | Assert.That(so.IsDeleted, Is.False); | ||
176 | |||
177 | sogd.InventoryDeQueueAndDelete(); | ||
178 | |||
179 | Assert.That(so.IsDeleted, Is.True); | ||
180 | |||
181 | SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(so.LocalId); | ||
182 | Assert.That(retrievedPart2, Is.Null); | ||
183 | |||
184 | // SceneSetupHelpers.DeleteSceneObjectAsync(scene, part, DeRezAction.Take, userInfo.RootFolder.ID, client); | ||
185 | |||
186 | InventoryItemBase retrievedItem | ||
187 | = UserInventoryHelpers.GetInventoryItem( | ||
188 | scene.InventoryService, ua.PrincipalID, "folder1/" + myObjectName); | ||
189 | |||
190 | // Check that we now have the taken part in our inventory | ||
191 | Assert.That(retrievedItem, Is.Not.Null); | ||
192 | |||
193 | // Check that the taken part has actually disappeared | ||
194 | // SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); | ||
195 | // Assert.That(retrievedPart, Is.Null); | ||
196 | } | ||
128 | } | 197 | } |
129 | } \ No newline at end of file | 198 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs index 0e525c9..9378e20 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs | |||
@@ -40,7 +40,7 @@ using log4net; | |||
40 | namespace OpenSim.Region.Framework.Scenes.Tests | 40 | namespace OpenSim.Region.Framework.Scenes.Tests |
41 | { | 41 | { |
42 | [TestFixture] | 42 | [TestFixture] |
43 | public class SceneObjectLinkingTests | 43 | public class SceneObjectLinkingTests : OpenSimTestCase |
44 | { | 44 | { |
45 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 45 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
46 | 46 | ||
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectResizeTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectResizeTests.cs index 89647d6..c264433 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectResizeTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectResizeTests.cs | |||
@@ -41,7 +41,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
41 | /// Basic scene object resize tests | 41 | /// Basic scene object resize tests |
42 | /// </summary> | 42 | /// </summary> |
43 | [TestFixture] | 43 | [TestFixture] |
44 | public class SceneObjectResizeTests | 44 | public class SceneObjectResizeTests : OpenSimTestCase |
45 | { | 45 | { |
46 | /// <summary> | 46 | /// <summary> |
47 | /// Test resizing an object | 47 | /// Test resizing an object |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectScriptTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectScriptTests.cs index d2361f8..a58e735 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectScriptTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectScriptTests.cs | |||
@@ -40,7 +40,7 @@ using OpenSim.Tests.Common.Mock; | |||
40 | namespace OpenSim.Region.Framework.Scenes.Tests | 40 | namespace OpenSim.Region.Framework.Scenes.Tests |
41 | { | 41 | { |
42 | [TestFixture] | 42 | [TestFixture] |
43 | public class SceneObjectScriptTests | 43 | public class SceneObjectScriptTests : OpenSimTestCase |
44 | { | 44 | { |
45 | [Test] | 45 | [Test] |
46 | public void TestAddScript() | 46 | public void TestAddScript() |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs index 6d255aa..abaa1d1 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs | |||
@@ -42,14 +42,16 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
42 | /// Spatial scene object tests (will eventually cover root and child part position, rotation properties, etc.) | 42 | /// Spatial scene object tests (will eventually cover root and child part position, rotation properties, etc.) |
43 | /// </summary> | 43 | /// </summary> |
44 | [TestFixture] | 44 | [TestFixture] |
45 | public class SceneObjectSpatialTests | 45 | public class SceneObjectSpatialTests : OpenSimTestCase |
46 | { | 46 | { |
47 | TestScene m_scene; | 47 | TestScene m_scene; |
48 | UUID m_ownerId = TestHelpers.ParseTail(0x1); | 48 | UUID m_ownerId = TestHelpers.ParseTail(0x1); |
49 | 49 | ||
50 | [SetUp] | 50 | [SetUp] |
51 | public void SetUp() | 51 | public override void SetUp() |
52 | { | 52 | { |
53 | base.SetUp(); | ||
54 | |||
53 | m_scene = new SceneHelpers().SetupScene(); | 55 | m_scene = new SceneHelpers().SetupScene(); |
54 | } | 56 | } |
55 | 57 | ||
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs index 742c769..093cbd2 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs | |||
@@ -42,7 +42,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
42 | /// Basic scene object status tests | 42 | /// Basic scene object status tests |
43 | /// </summary> | 43 | /// </summary> |
44 | [TestFixture] | 44 | [TestFixture] |
45 | public class SceneObjectStatusTests | 45 | public class SceneObjectStatusTests : OpenSimTestCase |
46 | { | 46 | { |
47 | private TestScene m_scene; | 47 | private TestScene m_scene; |
48 | private UUID m_ownerId = TestHelpers.ParseTail(0x1); | 48 | private UUID m_ownerId = TestHelpers.ParseTail(0x1); |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAnimationTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAnimationTests.cs index 646e5fa..1cd8ae9 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAnimationTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAnimationTests.cs | |||
@@ -51,7 +51,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
51 | /// Scene presence animation tests | 51 | /// Scene presence animation tests |
52 | /// </summary> | 52 | /// </summary> |
53 | [TestFixture] | 53 | [TestFixture] |
54 | public class ScenePresenceAnimationTests | 54 | public class ScenePresenceAnimationTests : OpenSimTestCase |
55 | { | 55 | { |
56 | [Test] | 56 | [Test] |
57 | public void TestFlyingAnimation() | 57 | public void TestFlyingAnimation() |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAutopilotTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAutopilotTests.cs index 1d1ff88..d80afd3 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAutopilotTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAutopilotTests.cs | |||
@@ -42,7 +42,7 @@ using OpenSim.Tests.Common.Mock; | |||
42 | namespace OpenSim.Region.Framework.Scenes.Tests | 42 | namespace OpenSim.Region.Framework.Scenes.Tests |
43 | { | 43 | { |
44 | [TestFixture] | 44 | [TestFixture] |
45 | public class ScenePresenceAutopilotTests | 45 | public class ScenePresenceAutopilotTests : OpenSimTestCase |
46 | { | 46 | { |
47 | private TestScene m_scene; | 47 | private TestScene m_scene; |
48 | 48 | ||
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceSitTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceSitTests.cs index 493ab70..acaeb90 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceSitTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceSitTests.cs | |||
@@ -43,7 +43,7 @@ using System.Threading; | |||
43 | namespace OpenSim.Region.Framework.Scenes.Tests | 43 | namespace OpenSim.Region.Framework.Scenes.Tests |
44 | { | 44 | { |
45 | [TestFixture] | 45 | [TestFixture] |
46 | public class ScenePresenceSitTests | 46 | public class ScenePresenceSitTests : OpenSimTestCase |
47 | { | 47 | { |
48 | private TestScene m_scene; | 48 | private TestScene m_scene; |
49 | private ScenePresence m_sp; | 49 | private ScenePresence m_sp; |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs index 37b5184..8dd1f3d 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs | |||
@@ -49,7 +49,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
49 | /// Teleport tests in a standalone OpenSim | 49 | /// Teleport tests in a standalone OpenSim |
50 | /// </summary> | 50 | /// </summary> |
51 | [TestFixture] | 51 | [TestFixture] |
52 | public class ScenePresenceTeleportTests | 52 | public class ScenePresenceTeleportTests : OpenSimTestCase |
53 | { | 53 | { |
54 | [TestFixtureSetUp] | 54 | [TestFixtureSetUp] |
55 | public void FixtureInit() | 55 | public void FixtureInit() |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs index d722a09..9d8eb0b 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs | |||
@@ -50,7 +50,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
50 | /// Scene presence tests | 50 | /// Scene presence tests |
51 | /// </summary> | 51 | /// </summary> |
52 | [TestFixture] | 52 | [TestFixture] |
53 | public class SceneTests | 53 | public class SceneTests : OpenSimTestCase |
54 | { | 54 | { |
55 | /// <summary> | 55 | /// <summary> |
56 | /// Very basic scene update test. Should become more elaborate with time. | 56 | /// Very basic scene update test. Should become more elaborate with time. |
@@ -65,5 +65,22 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
65 | 65 | ||
66 | Assert.That(scene.Frame, Is.EqualTo(1)); | 66 | Assert.That(scene.Frame, Is.EqualTo(1)); |
67 | } | 67 | } |
68 | |||
69 | [Test] | ||
70 | public void TestShutdownScene() | ||
71 | { | ||
72 | TestHelpers.InMethod(); | ||
73 | |||
74 | Scene scene = new SceneHelpers().SetupScene(); | ||
75 | scene.Close(); | ||
76 | |||
77 | Assert.That(scene.ShuttingDown, Is.True); | ||
78 | Assert.That(scene.Active, Is.False); | ||
79 | |||
80 | // Trying to update a shutdown scene should result in no update | ||
81 | scene.Update(1); | ||
82 | |||
83 | Assert.That(scene.Frame, Is.EqualTo(0)); | ||
84 | } | ||
68 | } | 85 | } |
69 | } \ No newline at end of file | 86 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs index a51e4e3..0b461f5 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs | |||
@@ -50,7 +50,7 @@ using OpenSim.Tests.Common.Mock; | |||
50 | namespace OpenSim.Region.Framework.Tests | 50 | namespace OpenSim.Region.Framework.Tests |
51 | { | 51 | { |
52 | [TestFixture] | 52 | [TestFixture] |
53 | public class TaskInventoryTests | 53 | public class TaskInventoryTests : OpenSimTestCase |
54 | { | 54 | { |
55 | [Test] | 55 | [Test] |
56 | public void TestAddTaskInventoryItem() | 56 | public void TestAddTaskInventoryItem() |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs b/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs index 198e487..dd27294 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs | |||
@@ -38,7 +38,7 @@ using OpenSim.Tests.Common.Mock; | |||
38 | namespace OpenSim.Region.Framework.Scenes.Tests | 38 | namespace OpenSim.Region.Framework.Scenes.Tests |
39 | { | 39 | { |
40 | [TestFixture] | 40 | [TestFixture] |
41 | public class UuidGathererTests | 41 | public class UuidGathererTests : OpenSimTestCase |
42 | { | 42 | { |
43 | protected IAssetService m_assetService; | 43 | protected IAssetService m_assetService; |
44 | protected UuidGatherer m_uuidGatherer; | 44 | protected UuidGatherer m_uuidGatherer; |