diff options
author | Melanie | 2012-06-29 22:24:53 +0100 |
---|---|---|
committer | Melanie | 2012-06-29 22:24:53 +0100 |
commit | 6137f37028a798f87af3f8afb71ec4856b2a5ad8 (patch) | |
tree | 39289035f883415b5ccae36a9b2af1ad60c7acf6 /OpenSim | |
parent | Merge branch 'avination' into careminster (diff) | |
parent | Move update of the final optional ODE total frame stat inside the OdeLock rat... (diff) | |
download | opensim-SC_OLD-6137f37028a798f87af3f8afb71ec4856b2a5ad8.zip opensim-SC_OLD-6137f37028a798f87af3f8afb71ec4856b2a5ad8.tar.gz opensim-SC_OLD-6137f37028a798f87af3f8afb71ec4856b2a5ad8.tar.bz2 opensim-SC_OLD-6137f37028a798f87af3f8afb71ec4856b2a5ad8.tar.xz |
Merge branch 'master' into careminster
Conflicts:
OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
OpenSim/Region/Framework/Scenes/Scene.cs
Diffstat (limited to 'OpenSim')
13 files changed, 132 insertions, 124 deletions
diff --git a/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescHandler.cs b/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescHandler.cs index 515637e..9a6ca86 100644 --- a/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescHandler.cs +++ b/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescHandler.cs | |||
@@ -301,7 +301,8 @@ namespace OpenSim.Capabilities.Handlers | |||
301 | InventoryItemBase linkedItem | 301 | InventoryItemBase linkedItem |
302 | = m_InventoryService.GetItem(new InventoryItemBase(link.AssetID)); | 302 | = m_InventoryService.GetItem(new InventoryItemBase(link.AssetID)); |
303 | 303 | ||
304 | itemsToReturn.Insert(0, linkedItem); | 304 | if (linkedItem != null) |
305 | itemsToReturn.Insert(0, linkedItem); | ||
305 | } | 306 | } |
306 | } | 307 | } |
307 | } | 308 | } |
diff --git a/OpenSim/Framework/IScene.cs b/OpenSim/Framework/IScene.cs index b2604f4..a9432c2 100644 --- a/OpenSim/Framework/IScene.cs +++ b/OpenSim/Framework/IScene.cs | |||
@@ -56,6 +56,11 @@ namespace OpenSim.Framework | |||
56 | 56 | ||
57 | public interface IScene | 57 | public interface IScene |
58 | { | 58 | { |
59 | /// <summary> | ||
60 | /// The name of this scene. | ||
61 | /// </summary> | ||
62 | string Name { get; } | ||
63 | |||
59 | RegionInfo RegionInfo { get; } | 64 | RegionInfo RegionInfo { get; } |
60 | RegionStatus RegionStatus { get; set; } | 65 | RegionStatus RegionStatus { get; set; } |
61 | 66 | ||
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/Tests/MockScene.cs b/OpenSim/Region/ClientStack/Linden/UDP/Tests/MockScene.cs index d76927b..119a677 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/Tests/MockScene.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/Tests/MockScene.cs | |||
@@ -44,9 +44,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
44 | } | 44 | } |
45 | protected int m_objectNameCallsReceived; | 45 | protected int m_objectNameCallsReceived; |
46 | 46 | ||
47 | public MockScene() | 47 | public MockScene() : base(new RegionInfo(1000, 1000, null, null)) |
48 | { | 48 | { |
49 | m_regInfo = new RegionInfo(1000, 1000, null, null); | ||
50 | m_regStatus = RegionStatus.Up; | 49 | m_regStatus = RegionStatus.Up; |
51 | } | 50 | } |
52 | 51 | ||
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index fcf682b..1fa5ec0 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |||
@@ -366,10 +366,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
366 | // At the moment we can only deal with a single attachment | 366 | // At the moment we can only deal with a single attachment |
367 | if (attachments.Count != 0) | 367 | if (attachments.Count != 0) |
368 | { | 368 | { |
369 | UUID oldAttachmentItemID = attachments[0].FromItemID; | 369 | if (attachments[0].FromItemID != UUID.Zero) |
370 | 370 | DetachSingleAttachmentToInvInternal(sp, attachments[0]); | |
371 | if (oldAttachmentItemID != UUID.Zero) | ||
372 | DetachSingleAttachmentToInvInternal(sp, oldAttachmentItemID); | ||
373 | else | 371 | else |
374 | m_log.WarnFormat( | 372 | m_log.WarnFormat( |
375 | "[ATTACHMENTS MODULE]: When detaching existing attachment {0} {1} at point {2} to make way for {3} {4} for {5}, couldn't find the associated item ID to adjust inventory attachment record!", | 373 | "[ATTACHMENTS MODULE]: When detaching existing attachment {0} {1} at point {2} to make way for {3} {4} for {5}, couldn't find the associated item ID to adjust inventory attachment record!", |
@@ -434,12 +432,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
434 | return null; | 432 | return null; |
435 | } | 433 | } |
436 | 434 | ||
437 | SceneObjectGroup att = RezSingleAttachmentFromInventoryInternal(sp, itemID, UUID.Zero, AttachmentPt, doc); | 435 | return RezSingleAttachmentFromInventoryInternal(sp, itemID, UUID.Zero, AttachmentPt, doc); |
438 | |||
439 | if (att == null) | ||
440 | DetachSingleAttachmentToInv(sp, itemID); | ||
441 | |||
442 | return att; | ||
443 | } | 436 | } |
444 | 437 | ||
445 | public void RezMultipleAttachmentsFromInventory(IScenePresence sp, List<KeyValuePair<UUID, uint>> rezlist) | 438 | public void RezMultipleAttachmentsFromInventory(IScenePresence sp, List<KeyValuePair<UUID, uint>> rezlist) |
@@ -516,18 +509,27 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
516 | m_scene.EventManager.TriggerOnAttach(so.LocalId, so.UUID, UUID.Zero); | 509 | m_scene.EventManager.TriggerOnAttach(so.LocalId, so.UUID, UUID.Zero); |
517 | } | 510 | } |
518 | 511 | ||
519 | public void DetachSingleAttachmentToInv(IScenePresence sp, UUID itemID) | 512 | public void DetachSingleAttachmentToInv(IScenePresence sp, SceneObjectGroup so) |
520 | { | 513 | { |
521 | lock (sp.AttachmentsSyncLock) | 514 | lock (sp.AttachmentsSyncLock) |
522 | { | 515 | { |
523 | // Save avatar attachment information | 516 | // Save avatar attachment information |
524 | // m_log.Debug("[ATTACHMENTS MODULE]: Detaching from UserID: " + sp.UUID + ", ItemID: " + itemID); | 517 | // m_log.Debug("[ATTACHMENTS MODULE]: Detaching from UserID: " + sp.UUID + ", ItemID: " + itemID); |
525 | 518 | ||
526 | bool changed = sp.Appearance.DetachAttachment(itemID); | 519 | if (so.AttachedAvatar != sp.UUID) |
520 | { | ||
521 | m_log.WarnFormat( | ||
522 | "[ATTACHMENTS MODULE]: Tried to detach object {0} from {1} {2} but attached avatar id was {3} in {4}", | ||
523 | so.Name, sp.Name, sp.UUID, so.AttachedAvatar, m_scene.RegionInfo.RegionName); | ||
524 | |||
525 | return; | ||
526 | } | ||
527 | |||
528 | bool changed = sp.Appearance.DetachAttachment(so.FromItemID); | ||
527 | if (changed && m_scene.AvatarFactory != null) | 529 | if (changed && m_scene.AvatarFactory != null) |
528 | m_scene.AvatarFactory.QueueAppearanceSave(sp.UUID); | 530 | m_scene.AvatarFactory.QueueAppearanceSave(sp.UUID); |
529 | 531 | ||
530 | DetachSingleAttachmentToInvInternal(sp, itemID); | 532 | DetachSingleAttachmentToInvInternal(sp, so); |
531 | } | 533 | } |
532 | } | 534 | } |
533 | 535 | ||
@@ -794,46 +796,21 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
794 | return item; | 796 | return item; |
795 | } | 797 | } |
796 | 798 | ||
797 | // What makes this method odd and unique is it tries to detach using an UUID.... Yay for standards. | 799 | private void DetachSingleAttachmentToInvInternal(IScenePresence sp, SceneObjectGroup so) |
798 | // To LocalId or UUID, *THAT* is the question. How now Brown UUID?? | ||
799 | private void DetachSingleAttachmentToInvInternal(IScenePresence sp, UUID itemID) | ||
800 | { | 800 | { |
801 | // m_log.DebugFormat("[ATTACHMENTS MODULE]: Detaching item {0} to inventory for {1}", itemID, sp.Name); | 801 | // m_log.DebugFormat("[ATTACHMENTS MODULE]: Detaching item {0} to inventory for {1}", itemID, sp.Name); |
802 | 802 | ||
803 | if (itemID == UUID.Zero) // If this happened, someone made a mistake.... | 803 | m_scene.EventManager.TriggerOnAttach(so.LocalId, so.FromItemID, UUID.Zero); |
804 | return; | 804 | sp.RemoveAttachment(so); |
805 | 805 | m_scene.DeleteSceneObject(so, false); | |
806 | // We can NOT use the dictionries here, as we are looking | ||
807 | // for an entity by the fromAssetID, which is NOT the prim UUID | ||
808 | EntityBase[] detachEntities = m_scene.GetEntities(); | ||
809 | SceneObjectGroup group; | ||
810 | |||
811 | lock (sp.AttachmentsSyncLock) | ||
812 | { | ||
813 | foreach (EntityBase entity in detachEntities) | ||
814 | { | ||
815 | if (entity is SceneObjectGroup) | ||
816 | { | ||
817 | group = (SceneObjectGroup)entity; | ||
818 | if (group.FromItemID == itemID) | ||
819 | { | ||
820 | m_scene.EventManager.TriggerOnAttach(group.LocalId, itemID, UUID.Zero); | ||
821 | sp.RemoveAttachment(group); | ||
822 | m_scene.DeleteSceneObject(group, false); | ||
823 | |||
824 | // Prepare sog for storage | ||
825 | group.AttachedAvatar = UUID.Zero; | ||
826 | group.RootPart.SetParentLocalId(0); | ||
827 | group.IsAttachment = false; | ||
828 | group.AbsolutePosition = group.RootPart.AttachedPos; | ||
829 | 806 | ||
830 | UpdateKnownItem(sp, group, true); | 807 | // Prepare sog for storage |
808 | so.AttachedAvatar = UUID.Zero; | ||
809 | so.RootPart.SetParentLocalId(0); | ||
810 | so.IsAttachment = false; | ||
811 | so.AbsolutePosition = so.RootPart.AttachedPos; | ||
831 | 812 | ||
832 | return; | 813 | UpdateKnownItem(sp, so, true); |
833 | } | ||
834 | } | ||
835 | } | ||
836 | } | ||
837 | } | 814 | } |
838 | 815 | ||
839 | protected SceneObjectGroup RezSingleAttachmentFromInventoryInternal( | 816 | protected SceneObjectGroup RezSingleAttachmentFromInventoryInternal( |
@@ -1047,8 +1024,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
1047 | 1024 | ||
1048 | ScenePresence sp = m_scene.GetScenePresence(remoteClient.AgentId); | 1025 | ScenePresence sp = m_scene.GetScenePresence(remoteClient.AgentId); |
1049 | SceneObjectGroup group = m_scene.GetGroupByPrim(objectLocalID); | 1026 | SceneObjectGroup group = m_scene.GetGroupByPrim(objectLocalID); |
1027 | |||
1050 | if (sp != null && group != null) | 1028 | if (sp != null && group != null) |
1051 | DetachSingleAttachmentToInv(sp, group.FromItemID); | 1029 | DetachSingleAttachmentToInv(sp, group); |
1052 | } | 1030 | } |
1053 | 1031 | ||
1054 | private void Client_OnDetachAttachmentIntoInv(UUID itemID, IClientAPI remoteClient) | 1032 | private void Client_OnDetachAttachmentIntoInv(UUID itemID, IClientAPI remoteClient) |
@@ -1058,7 +1036,21 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
1058 | 1036 | ||
1059 | ScenePresence sp = m_scene.GetScenePresence(remoteClient.AgentId); | 1037 | ScenePresence sp = m_scene.GetScenePresence(remoteClient.AgentId); |
1060 | if (sp != null) | 1038 | if (sp != null) |
1061 | DetachSingleAttachmentToInv(sp, itemID); | 1039 | { |
1040 | lock (sp.AttachmentsSyncLock) | ||
1041 | { | ||
1042 | List<SceneObjectGroup> attachments = sp.GetAttachments(); | ||
1043 | |||
1044 | foreach (SceneObjectGroup group in attachments) | ||
1045 | { | ||
1046 | if (group.FromItemID == itemID) | ||
1047 | { | ||
1048 | DetachSingleAttachmentToInv(sp, group); | ||
1049 | return; | ||
1050 | } | ||
1051 | } | ||
1052 | } | ||
1053 | } | ||
1062 | } | 1054 | } |
1063 | 1055 | ||
1064 | private void Client_OnObjectDrop(uint soLocalId, IClientAPI remoteClient) | 1056 | private void Client_OnObjectDrop(uint soLocalId, IClientAPI remoteClient) |
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs index 1c10422..df99d0c 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs | |||
@@ -227,9 +227,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests | |||
227 | 227 | ||
228 | InventoryItemBase attItem = CreateAttachmentItem(scene, ua1.PrincipalID, "att", 0x10, 0x20); | 228 | InventoryItemBase attItem = CreateAttachmentItem(scene, ua1.PrincipalID, "att", 0x10, 0x20); |
229 | 229 | ||
230 | scene.AttachmentsModule.RezSingleAttachmentFromInventory( | 230 | SceneObjectGroup so |
231 | sp, attItem.ID, (uint)AttachmentPoint.Chest); | 231 | = (SceneObjectGroup)scene.AttachmentsModule.RezSingleAttachmentFromInventory( |
232 | scene.AttachmentsModule.DetachSingleAttachmentToInv(sp, attItem.ID); | 232 | sp, attItem.ID, (uint)AttachmentPoint.Chest); |
233 | scene.AttachmentsModule.DetachSingleAttachmentToInv(sp, so); | ||
233 | 234 | ||
234 | // Check status on scene presence | 235 | // Check status on scene presence |
235 | Assert.That(sp.HasAttachments(), Is.False); | 236 | Assert.That(sp.HasAttachments(), Is.False); |
diff --git a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs index 7446530..e7b9ba5 100644 --- a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs | |||
@@ -114,11 +114,11 @@ namespace OpenSim.Region.Framework.Interfaces | |||
114 | void DetachSingleAttachmentToGround(IScenePresence sp, uint objectLocalID); | 114 | void DetachSingleAttachmentToGround(IScenePresence sp, uint objectLocalID); |
115 | 115 | ||
116 | /// <summary> | 116 | /// <summary> |
117 | /// Detach the given item so that it remains in the user's inventory. | 117 | /// Detach the given attachment so that it remains in the user's inventory. |
118 | /// </summary> | 118 | /// </summary> |
119 | /// <param name="sp">/param> | 119 | /// <param name="sp">/param> |
120 | /// <param name="itemID"></param> | 120 | /// <param name="grp">The attachment to detach.</param> |
121 | void DetachSingleAttachmentToInv(IScenePresence sp, UUID itemID); | 121 | void DetachSingleAttachmentToInv(IScenePresence sp, SceneObjectGroup grp); |
122 | 122 | ||
123 | /// Update the position of an attachment. | 123 | /// Update the position of an attachment. |
124 | /// </summary> | 124 | /// </summary> |
diff --git a/OpenSim/Region/Framework/Interfaces/IScenePresence.cs b/OpenSim/Region/Framework/Interfaces/IScenePresence.cs index 19a8236..e6b926c 100644 --- a/OpenSim/Region/Framework/Interfaces/IScenePresence.cs +++ b/OpenSim/Region/Framework/Interfaces/IScenePresence.cs | |||
@@ -72,6 +72,10 @@ namespace OpenSim.Region.Framework.Interfaces | |||
72 | /// <returns></returns> | 72 | /// <returns></returns> |
73 | List<SceneObjectGroup> GetAttachments(uint attachmentPoint); | 73 | List<SceneObjectGroup> GetAttachments(uint attachmentPoint); |
74 | 74 | ||
75 | /// <summary> | ||
76 | /// Does this avatar have any attachments? | ||
77 | /// </summary> | ||
78 | /// <returns></returns> | ||
75 | bool HasAttachments(); | 79 | bool HasAttachments(); |
76 | 80 | ||
77 | // Don't use these methods directly. Instead, use the AttachmentsModule | 81 | // Don't use these methods directly. Instead, use the AttachmentsModule |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 8591b09..8c76b82 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -637,7 +637,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
637 | m_SimulationDataService = simDataService; | 637 | m_SimulationDataService = simDataService; |
638 | m_EstateDataService = estateDataService; | 638 | m_EstateDataService = estateDataService; |
639 | m_regionHandle = m_regInfo.RegionHandle; | 639 | m_regionHandle = m_regInfo.RegionHandle; |
640 | m_regionName = m_regInfo.RegionName; | ||
641 | m_lastIncoming = 0; | 640 | m_lastIncoming = 0; |
642 | m_lastOutgoing = 0; | 641 | m_lastOutgoing = 0; |
643 | 642 | ||
@@ -654,7 +653,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
654 | // resave. | 653 | // resave. |
655 | // FIXME: It shouldn't be up to the database plugins to create this data - we should do it when a new | 654 | // FIXME: It shouldn't be up to the database plugins to create this data - we should do it when a new |
656 | // region is set up and avoid these gyrations. | 655 | // region is set up and avoid these gyrations. |
657 | RegionSettings rs = simDataService.LoadRegionSettings(m_regInfo.RegionID); | 656 | RegionSettings rs = simDataService.LoadRegionSettings(RegionInfo.RegionID); |
658 | bool updatedTerrainTextures = false; | 657 | bool updatedTerrainTextures = false; |
659 | if (rs.TerrainTexture1 == UUID.Zero) | 658 | if (rs.TerrainTexture1 == UUID.Zero) |
660 | { | 659 | { |
@@ -683,10 +682,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
683 | if (updatedTerrainTextures) | 682 | if (updatedTerrainTextures) |
684 | rs.Save(); | 683 | rs.Save(); |
685 | 684 | ||
686 | m_regInfo.RegionSettings = rs; | 685 | RegionInfo.RegionSettings = rs; |
687 | 686 | ||
688 | if (estateDataService != null) | 687 | if (estateDataService != null) |
689 | m_regInfo.EstateSettings = estateDataService.LoadEstateSettings(m_regInfo.RegionID, false); | 688 | RegionInfo.EstateSettings = estateDataService.LoadEstateSettings(RegionInfo.RegionID, false); |
690 | 689 | ||
691 | #endregion Region Settings | 690 | #endregion Region Settings |
692 | 691 | ||
@@ -861,7 +860,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
861 | StatsReporter.OnStatsIncorrect += m_sceneGraph.RecalculateStats; | 860 | StatsReporter.OnStatsIncorrect += m_sceneGraph.RecalculateStats; |
862 | } | 861 | } |
863 | 862 | ||
864 | public Scene(RegionInfo regInfo) | 863 | public Scene(RegionInfo regInfo) : base(regInfo) |
865 | { | 864 | { |
866 | PhysicalPrims = true; | 865 | PhysicalPrims = true; |
867 | CollidablePrims = true; | 866 | CollidablePrims = true; |
@@ -888,7 +887,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
888 | WestBorders.Add(westBorder); | 887 | WestBorders.Add(westBorder); |
889 | BordersLocked = false; | 888 | BordersLocked = false; |
890 | 889 | ||
891 | m_regInfo = regInfo; | ||
892 | m_eventManager = new EventManager(); | 890 | m_eventManager = new EventManager(); |
893 | 891 | ||
894 | m_permissions = new ScenePermissions(this); | 892 | m_permissions = new ScenePermissions(this); |
@@ -1232,8 +1230,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1232 | 1230 | ||
1233 | m_sceneGraph.Close(); | 1231 | m_sceneGraph.Close(); |
1234 | 1232 | ||
1235 | if (!GridService.DeregisterRegion(m_regInfo.RegionID)) | 1233 | if (!GridService.DeregisterRegion(RegionInfo.RegionID)) |
1236 | m_log.WarnFormat("[SCENE]: Deregister from grid failed for region {0}", m_regInfo.RegionName); | 1234 | m_log.WarnFormat("[SCENE]: Deregister from grid failed for region {0}", Name); |
1237 | 1235 | ||
1238 | // call the base class Close method. | 1236 | // call the base class Close method. |
1239 | base.Close(); | 1237 | base.Close(); |
@@ -1770,14 +1768,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
1770 | 1768 | ||
1771 | public void StoreWindlightProfile(RegionLightShareData wl) | 1769 | public void StoreWindlightProfile(RegionLightShareData wl) |
1772 | { | 1770 | { |
1773 | m_regInfo.WindlightSettings = wl; | 1771 | RegionInfo.WindlightSettings = wl; |
1774 | SimulationDataService.StoreRegionWindlightSettings(wl); | 1772 | SimulationDataService.StoreRegionWindlightSettings(wl); |
1775 | m_eventManager.TriggerOnSaveNewWindlightProfile(); | 1773 | m_eventManager.TriggerOnSaveNewWindlightProfile(); |
1776 | } | 1774 | } |
1777 | 1775 | ||
1778 | public void LoadWindlightProfile() | 1776 | public void LoadWindlightProfile() |
1779 | { | 1777 | { |
1780 | m_regInfo.WindlightSettings = SimulationDataService.LoadRegionWindlightSettings(RegionInfo.RegionID); | 1778 | RegionInfo.WindlightSettings = SimulationDataService.LoadRegionWindlightSettings(RegionInfo.RegionID); |
1781 | m_eventManager.TriggerOnSaveNewWindlightProfile(); | 1779 | m_eventManager.TriggerOnSaveNewWindlightProfile(); |
1782 | } | 1780 | } |
1783 | 1781 | ||
@@ -2318,7 +2316,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2318 | ForceSceneObjectBackup(so); | 2316 | ForceSceneObjectBackup(so); |
2319 | 2317 | ||
2320 | so.DetachFromBackup(); | 2318 | so.DetachFromBackup(); |
2321 | SimulationDataService.RemoveObject(so.UUID, m_regInfo.RegionID); | 2319 | SimulationDataService.RemoveObject(so.UUID, RegionInfo.RegionID); |
2322 | } | 2320 | } |
2323 | 2321 | ||
2324 | // We need to keep track of this state in case this group is still queued for further backup. | 2322 | // We need to keep track of this state in case this group is still queued for further backup. |
@@ -2662,7 +2660,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2662 | // enter. Period. | 2660 | // enter. Period. |
2663 | // | 2661 | // |
2664 | int flags = GetUserFlags(sceneObject.OwnerID); | 2662 | int flags = GetUserFlags(sceneObject.OwnerID); |
2665 | if (m_regInfo.EstateSettings.IsBanned(sceneObject.OwnerID, flags)) | 2663 | if (RegionInfo.EstateSettings.IsBanned(sceneObject.OwnerID, flags)) |
2666 | { | 2664 | { |
2667 | m_log.InfoFormat("[INTERREGION]: Denied prim crossing for banned avatar {0}", sceneObject.OwnerID); | 2665 | m_log.InfoFormat("[INTERREGION]: Denied prim crossing for banned avatar {0}", sceneObject.OwnerID); |
2668 | 2666 | ||
@@ -3908,9 +3906,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
3908 | } | 3906 | } |
3909 | } | 3907 | } |
3910 | 3908 | ||
3911 | if (m_regInfo.EstateSettings != null) | 3909 | if (RegionInfo.EstateSettings != null) |
3912 | { | 3910 | { |
3913 | if (m_regInfo.EstateSettings.IsBanned(agent.AgentID,0)) | 3911 | if (RegionInfo.EstateSettings.IsBanned(agent.AgentID, 0)) |
3914 | { | 3912 | { |
3915 | m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user is on the banlist", | 3913 | m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user is on the banlist", |
3916 | agent.AgentID, agent.firstname, agent.lastname, RegionInfo.RegionName); | 3914 | agent.AgentID, agent.firstname, agent.lastname, RegionInfo.RegionName); |
@@ -3942,7 +3940,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3942 | } | 3940 | } |
3943 | 3941 | ||
3944 | bool groupAccess = false; | 3942 | bool groupAccess = false; |
3945 | UUID[] estateGroups = m_regInfo.EstateSettings.EstateGroups; | 3943 | UUID[] estateGroups = RegionInfo.EstateSettings.EstateGroups; |
3946 | 3944 | ||
3947 | if (estateGroups != null) | 3945 | if (estateGroups != null) |
3948 | { | 3946 | { |
@@ -3960,8 +3958,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
3960 | m_log.ErrorFormat("[CONNECTION BEGIN]: EstateGroups is null!"); | 3958 | m_log.ErrorFormat("[CONNECTION BEGIN]: EstateGroups is null!"); |
3961 | } | 3959 | } |
3962 | 3960 | ||
3963 | if (!m_regInfo.EstateSettings.PublicAccess && | 3961 | if (!RegionInfo.EstateSettings.PublicAccess && |
3964 | !m_regInfo.EstateSettings.HasAccess(agent.AgentID) && | 3962 | !RegionInfo.EstateSettings.HasAccess(agent.AgentID) && |
3965 | !groupAccess) | 3963 | !groupAccess) |
3966 | { | 3964 | { |
3967 | m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user does not have access to the estate", | 3965 | m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user does not have access to the estate", |
@@ -4034,7 +4032,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4034 | // if (loggingOffUser != null) | 4032 | // if (loggingOffUser != null) |
4035 | // { | 4033 | // { |
4036 | // UUID localRegionSecret = UUID.Zero; | 4034 | // UUID localRegionSecret = UUID.Zero; |
4037 | // bool parsedsecret = UUID.TryParse(m_regInfo.regionSecret, out localRegionSecret); | 4035 | // bool parsedsecret = UUID.TryParse(RegionInfo.regionSecret, out localRegionSecret); |
4038 | // | 4036 | // |
4039 | // // Region Secret is used here in case a new sessionid overwrites an old one on the user server. | 4037 | // // Region Secret is used here in case a new sessionid overwrites an old one on the user server. |
4040 | // // Will update the user server in a few revisions to use it. | 4038 | // // Will update the user server in a few revisions to use it. |
@@ -4272,13 +4270,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
4272 | ScenePresence sp = GetScenePresence(remoteClient.AgentId); | 4270 | ScenePresence sp = GetScenePresence(remoteClient.AgentId); |
4273 | if (sp != null) | 4271 | if (sp != null) |
4274 | { | 4272 | { |
4275 | uint regionX = m_regInfo.RegionLocX; | 4273 | uint regionX = RegionInfo.RegionLocX; |
4276 | uint regionY = m_regInfo.RegionLocY; | 4274 | uint regionY = RegionInfo.RegionLocY; |
4277 | 4275 | ||
4278 | Utils.LongToUInts(regionHandle, out regionX, out regionY); | 4276 | Utils.LongToUInts(regionHandle, out regionX, out regionY); |
4279 | 4277 | ||
4280 | int shiftx = (int) regionX - (int) m_regInfo.RegionLocX * (int)Constants.RegionSize; | 4278 | int shiftx = (int) regionX - (int) RegionInfo.RegionLocX * (int)Constants.RegionSize; |
4281 | int shifty = (int) regionY - (int) m_regInfo.RegionLocY * (int)Constants.RegionSize; | 4279 | int shifty = (int) regionY - (int) RegionInfo.RegionLocY * (int)Constants.RegionSize; |
4282 | 4280 | ||
4283 | position.X += shiftx; | 4281 | position.X += shiftx; |
4284 | position.Y += shifty; | 4282 | position.Y += shifty; |
@@ -4301,7 +4299,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4301 | 4299 | ||
4302 | if (!result) | 4300 | if (!result) |
4303 | { | 4301 | { |
4304 | regionHandle = m_regInfo.RegionHandle; | 4302 | regionHandle = RegionInfo.RegionHandle; |
4305 | } | 4303 | } |
4306 | else | 4304 | else |
4307 | { | 4305 | { |
@@ -4807,7 +4805,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4807 | 4805 | ||
4808 | public void DeleteFromStorage(UUID uuid) | 4806 | public void DeleteFromStorage(UUID uuid) |
4809 | { | 4807 | { |
4810 | SimulationDataService.RemoveObject(uuid, m_regInfo.RegionID); | 4808 | SimulationDataService.RemoveObject(uuid, RegionInfo.RegionID); |
4811 | } | 4809 | } |
4812 | 4810 | ||
4813 | public int GetHealth(out int flags, out string message) | 4811 | public int GetHealth(out int flags, out string message) |
@@ -5288,7 +5286,7 @@ Environment.Exit(1); | |||
5288 | IEstateDataService estateDataService = EstateDataService; | 5286 | IEstateDataService estateDataService = EstateDataService; |
5289 | if (estateDataService != null) | 5287 | if (estateDataService != null) |
5290 | { | 5288 | { |
5291 | m_regInfo.EstateSettings = estateDataService.LoadEstateSettings(m_regInfo.RegionID, false); | 5289 | RegionInfo.EstateSettings = estateDataService.LoadEstateSettings(RegionInfo.RegionID, false); |
5292 | TriggerEstateSunUpdate(); | 5290 | TriggerEstateSunUpdate(); |
5293 | } | 5291 | } |
5294 | } | 5292 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneBase.cs b/OpenSim/Region/Framework/Scenes/SceneBase.cs index 9b8a3ae..e8134cd 100644 --- a/OpenSim/Region/Framework/Scenes/SceneBase.cs +++ b/OpenSim/Region/Framework/Scenes/SceneBase.cs | |||
@@ -51,6 +51,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
51 | #endregion | 51 | #endregion |
52 | 52 | ||
53 | #region Fields | 53 | #region Fields |
54 | |||
55 | public string Name { get { return RegionInfo.RegionName; } } | ||
54 | 56 | ||
55 | public IConfigSource Config | 57 | public IConfigSource Config |
56 | { | 58 | { |
@@ -148,6 +150,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
148 | 150 | ||
149 | #endregion | 151 | #endregion |
150 | 152 | ||
153 | public SceneBase(RegionInfo regInfo) | ||
154 | { | ||
155 | RegionInfo = regInfo; | ||
156 | } | ||
157 | |||
151 | #region Update Methods | 158 | #region Update Methods |
152 | 159 | ||
153 | /// <summary> | 160 | /// <summary> |
@@ -211,10 +218,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
211 | /// | 218 | /// |
212 | /// </summary> | 219 | /// </summary> |
213 | /// <returns></returns> | 220 | /// <returns></returns> |
214 | public virtual RegionInfo RegionInfo | 221 | public virtual RegionInfo RegionInfo { get; private set; } |
215 | { | ||
216 | get { return m_regInfo; } | ||
217 | } | ||
218 | 222 | ||
219 | #region admin stuff | 223 | #region admin stuff |
220 | 224 | ||
diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index 54b69a2..f3b0630 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | |||
@@ -1270,7 +1270,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1270 | 1270 | ||
1271 | public override void UnSubscribeEvents() | 1271 | public override void UnSubscribeEvents() |
1272 | { | 1272 | { |
1273 | CollisionEventsThisFrame.Clear(); | 1273 | _parent_scene.RemoveCollisionEventReporting(this); |
1274 | 1274 | ||
1275 | // Don't clear collision event reporting here. This is called directly from scene code and so can lead | 1275 | // Don't clear collision event reporting here. This is called directly from scene code and so can lead |
1276 | // to a race condition with the simulate loop | 1276 | // to a race condition with the simulate loop |
diff --git a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs index c6ecc68..32e81e2 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs | |||
@@ -387,12 +387,12 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
387 | /// <summary> | 387 | /// <summary> |
388 | /// A dictionary of actors that should receive collision events. | 388 | /// A dictionary of actors that should receive collision events. |
389 | /// </summary> | 389 | /// </summary> |
390 | private readonly Dictionary<uint, PhysicsActor> _collisionEventPrim = new Dictionary<uint, PhysicsActor>(); | 390 | private readonly Dictionary<uint, PhysicsActor> m_collisionEventActors = new Dictionary<uint, PhysicsActor>(); |
391 | 391 | ||
392 | /// <summary> | 392 | /// <summary> |
393 | /// A dictionary of collision event changes that are waiting to be processed. | 393 | /// A dictionary of collision event changes that are waiting to be processed. |
394 | /// </summary> | 394 | /// </summary> |
395 | private readonly Dictionary<uint, PhysicsActor> _collisionEventPrimChanges = new Dictionary<uint, PhysicsActor>(); | 395 | private readonly Dictionary<uint, PhysicsActor> m_collisionEventActorsChanges = new Dictionary<uint, PhysicsActor>(); |
396 | 396 | ||
397 | /// <summary> | 397 | /// <summary> |
398 | /// Maps a unique geometry id (a memory location) to a physics actor name. | 398 | /// Maps a unique geometry id (a memory location) to a physics actor name. |
@@ -1908,8 +1908,8 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1908 | { | 1908 | { |
1909 | // m_log.DebugFormat("[PHYSICS]: Adding {0} {1} to collision event reporting", obj.SOPName, obj.LocalID); | 1909 | // m_log.DebugFormat("[PHYSICS]: Adding {0} {1} to collision event reporting", obj.SOPName, obj.LocalID); |
1910 | 1910 | ||
1911 | lock (_collisionEventPrimChanges) | 1911 | lock (m_collisionEventActorsChanges) |
1912 | _collisionEventPrimChanges[obj.LocalID] = obj; | 1912 | m_collisionEventActorsChanges[obj.LocalID] = obj; |
1913 | } | 1913 | } |
1914 | 1914 | ||
1915 | /// <summary> | 1915 | /// <summary> |
@@ -1920,8 +1920,8 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1920 | { | 1920 | { |
1921 | // m_log.DebugFormat("[PHYSICS]: Removing {0} {1} from collision event reporting", obj.SOPName, obj.LocalID); | 1921 | // m_log.DebugFormat("[PHYSICS]: Removing {0} {1} from collision event reporting", obj.SOPName, obj.LocalID); |
1922 | 1922 | ||
1923 | lock (_collisionEventPrimChanges) | 1923 | lock (m_collisionEventActorsChanges) |
1924 | _collisionEventPrimChanges[obj.LocalID] = null; | 1924 | m_collisionEventActorsChanges[obj.LocalID] = null; |
1925 | } | 1925 | } |
1926 | 1926 | ||
1927 | #region Add/Remove Entities | 1927 | #region Add/Remove Entities |
@@ -2930,17 +2930,17 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
2930 | // We change _collisionEventPrimChanges to avoid locking _collisionEventPrim itself and causing potential | 2930 | // We change _collisionEventPrimChanges to avoid locking _collisionEventPrim itself and causing potential |
2931 | // deadlock if the collision event tries to lock something else later on which is already locked by a | 2931 | // deadlock if the collision event tries to lock something else later on which is already locked by a |
2932 | // caller that is adding or removing the collision event. | 2932 | // caller that is adding or removing the collision event. |
2933 | lock (_collisionEventPrimChanges) | 2933 | lock (m_collisionEventActorsChanges) |
2934 | { | 2934 | { |
2935 | foreach (KeyValuePair<uint, PhysicsActor> kvp in _collisionEventPrimChanges) | 2935 | foreach (KeyValuePair<uint, PhysicsActor> kvp in m_collisionEventActorsChanges) |
2936 | { | 2936 | { |
2937 | if (kvp.Value == null) | 2937 | if (kvp.Value == null) |
2938 | _collisionEventPrim.Remove(kvp.Key); | 2938 | m_collisionEventActors.Remove(kvp.Key); |
2939 | else | 2939 | else |
2940 | _collisionEventPrim[kvp.Key] = kvp.Value; | 2940 | m_collisionEventActors[kvp.Key] = kvp.Value; |
2941 | } | 2941 | } |
2942 | 2942 | ||
2943 | _collisionEventPrimChanges.Clear(); | 2943 | m_collisionEventActorsChanges.Clear(); |
2944 | } | 2944 | } |
2945 | 2945 | ||
2946 | if (SupportsNINJAJoints) | 2946 | if (SupportsNINJAJoints) |
@@ -3092,7 +3092,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
3092 | tempTick = tempTick2; | 3092 | tempTick = tempTick2; |
3093 | } | 3093 | } |
3094 | 3094 | ||
3095 | foreach (PhysicsActor obj in _collisionEventPrim.Values) | 3095 | foreach (PhysicsActor obj in m_collisionEventActors.Values) |
3096 | { | 3096 | { |
3097 | // m_log.DebugFormat("[PHYSICS]: Assessing {0} {1} for collision events", obj.SOPName, obj.LocalID); | 3097 | // m_log.DebugFormat("[PHYSICS]: Assessing {0} {1} for collision events", obj.SOPName, obj.LocalID); |
3098 | 3098 | ||
@@ -3227,10 +3227,10 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
3227 | } | 3227 | } |
3228 | 3228 | ||
3229 | tickCountFrameRun = Util.EnvironmentTickCount(); | 3229 | tickCountFrameRun = Util.EnvironmentTickCount(); |
3230 | } | ||
3231 | 3230 | ||
3232 | if (CollectStats) | 3231 | if (CollectStats) |
3233 | m_stats[ODETotalFrameMsStatName] += Util.EnvironmentTickCountSubtract(startFrameTick); | 3232 | m_stats[ODETotalFrameMsStatName] += Util.EnvironmentTickCountSubtract(startFrameTick); |
3233 | } | ||
3234 | 3234 | ||
3235 | return fps; | 3235 | return fps; |
3236 | } | 3236 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 389980e..04c4c00 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -3267,15 +3267,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3267 | 3267 | ||
3268 | private void DetachWrapper(object o) | 3268 | private void DetachWrapper(object o) |
3269 | { | 3269 | { |
3270 | SceneObjectPart host = (SceneObjectPart)o; | 3270 | if (World.AttachmentsModule != null) |
3271 | 3271 | { | |
3272 | SceneObjectGroup grp = host.ParentGroup; | 3272 | SceneObjectPart host = (SceneObjectPart)o; |
3273 | UUID itemID = grp.FromItemID; | 3273 | ScenePresence presence = World.GetScenePresence(host.OwnerID); |
3274 | ScenePresence presence = World.GetScenePresence(host.OwnerID); | 3274 | World.AttachmentsModule.DetachSingleAttachmentToInv(presence, host.ParentGroup); |
3275 | 3275 | } | |
3276 | IAttachmentsModule attachmentsModule = m_ScriptEngine.World.AttachmentsModule; | ||
3277 | if (attachmentsModule != null) | ||
3278 | attachmentsModule.DetachSingleAttachmentToInv(presence, itemID); | ||
3279 | } | 3276 | } |
3280 | 3277 | ||
3281 | public void llAttachToAvatar(int attachmentPoint) | 3278 | public void llAttachToAvatar(int attachmentPoint) |
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 79d1944..7364b19 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -847,27 +847,34 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
847 | if (engine == ScriptEngineName) | 847 | if (engine == ScriptEngineName) |
848 | { | 848 | { |
849 | // If we are falling back on XEngine as the default engine, then only complain to the user | 849 | // If we are falling back on XEngine as the default engine, then only complain to the user |
850 | // if a script language has been explicitly set and it's one that we recognize. If it's | 850 | // if a script language has been explicitly set and it's one that we recognize or there are |
851 | // no non-whitespace characters after the colon. | ||
852 | // | ||
853 | // If the script is | ||
851 | // explicitly not allowed or the script is not in LSL then the user will be informed by a later compiler message. | 854 | // explicitly not allowed or the script is not in LSL then the user will be informed by a later compiler message. |
852 | // | 855 | // |
856 | // If the colon ends the line then we'll risk the false positive as this is more likely | ||
857 | // to signal a real scriptengine line where the user wants to use the default compile language. | ||
858 | // | ||
853 | // This avoids the overwhelming number of false positives where we're in this code because | 859 | // This avoids the overwhelming number of false positives where we're in this code because |
854 | // there's a colon in a comment in the first line of a script for entirely | 860 | // there's a colon in a comment in the first line of a script for entirely |
855 | // unrelated reasons (e.g. vim settings). | 861 | // unrelated reasons (e.g. vim settings). |
856 | // | 862 | // |
857 | // TODO: A better fix would be to deprecate simple : detection and look for some less likely | 863 | // TODO: A better fix would be to deprecate simple : detection and look for some less likely |
858 | // string to begin the comment (like #! in unix shell scripts). | 864 | // string to begin the comment (like #! in unix shell scripts). |
859 | bool scriptExplicitlyInXEngineLanguage = false; | 865 | bool warnRunningInXEngine = false; |
860 | string restOfScript = script.Substring(colon + 1); | 866 | string restOfFirstLine = firstline.Substring(colon + 1); |
861 | 867 | ||
862 | // FIXME: These are hardcoded because they are currently hardcoded in Compiler.cs | 868 | // FIXME: These are hardcoded because they are currently hardcoded in Compiler.cs |
863 | if (restOfScript.StartsWith("c#") | 869 | if (restOfFirstLine.StartsWith("c#") |
864 | || restOfScript.StartsWith("vb") | 870 | || restOfFirstLine.StartsWith("vb") |
865 | || restOfScript.StartsWith("lsl") | 871 | || restOfFirstLine.StartsWith("lsl") |
866 | || restOfScript.StartsWith("js") | 872 | || restOfFirstLine.StartsWith("js") |
867 | || restOfScript.StartsWith("yp")) | 873 | || restOfFirstLine.StartsWith("yp") |
868 | scriptExplicitlyInXEngineLanguage = true; | 874 | || restOfFirstLine.Length == 0) |
869 | 875 | warnRunningInXEngine = true; | |
870 | if (scriptExplicitlyInXEngineLanguage) | 876 | |
877 | if (warnRunningInXEngine) | ||
871 | { | 878 | { |
872 | SceneObjectPart part = | 879 | SceneObjectPart part = |
873 | m_Scene.GetSceneObjectPart( | 880 | m_Scene.GetSceneObjectPart( |