diff options
author | Justin Clark-Casey (justincc) | 2010-02-16 19:08:06 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2010-02-16 19:08:06 +0000 |
commit | 4c90ee29432539efbf5942010dd574822235ed57 (patch) | |
tree | d159f72df97dfef5719221301009e90f375f2ef2 /OpenSim/Region/CoreModules | |
parent | minor: Make SOG.DelinkFromGroup() return the newly delinked scene object inst... (diff) | |
parent | Formatting cleanup. (diff) | |
download | opensim-SC_OLD-4c90ee29432539efbf5942010dd574822235ed57.zip opensim-SC_OLD-4c90ee29432539efbf5942010dd574822235ed57.tar.gz opensim-SC_OLD-4c90ee29432539efbf5942010dd574822235ed57.tar.bz2 opensim-SC_OLD-4c90ee29432539efbf5942010dd574822235ed57.tar.xz |
Merge branch 'master' of ssh://justincc@opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Region/CoreModules')
7 files changed, 76 insertions, 23 deletions
diff --git a/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs b/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs index 1903eb9..b1b7b27 100644 --- a/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs | |||
@@ -330,7 +330,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
330 | //m_log.DebugFormat("[XXX] name = {0} (this module's name: {1}", name, Name); | 330 | //m_log.DebugFormat("[XXX] name = {0} (this module's name: {1}", name, Name); |
331 | 331 | ||
332 | if (name != Name) | 332 | if (name != Name) |
333 | return; | 333 | return; |
334 | 334 | ||
335 | long maxSize = DefaultMaxSize; | 335 | long maxSize = DefaultMaxSize; |
336 | int maxCount = DefaultMaxCount; | 336 | int maxCount = DefaultMaxCount; |
diff --git a/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs b/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs index 61b6d65..4069991 100644 --- a/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs | |||
@@ -148,13 +148,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule | |||
148 | private void AvatarEnteringParcel(ScenePresence avatar, int localLandID, UUID regionID) | 148 | private void AvatarEnteringParcel(ScenePresence avatar, int localLandID, UUID regionID) |
149 | { | 149 | { |
150 | ILandObject obj = avatar.Scene.LandChannel.GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); | 150 | ILandObject obj = avatar.Scene.LandChannel.GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); |
151 | if ((obj.LandData.Flags & (uint)ParcelFlags.AllowDamage) != 0) | 151 | try |
152 | { | 152 | { |
153 | avatar.Invulnerable = false; | 153 | if ((obj.LandData.Flags & (uint)ParcelFlags.AllowDamage) != 0) |
154 | { | ||
155 | avatar.Invulnerable = false; | ||
156 | } | ||
157 | else | ||
158 | { | ||
159 | avatar.Invulnerable = true; | ||
160 | } | ||
154 | } | 161 | } |
155 | else | 162 | catch (Exception ex) |
156 | { | 163 | { |
157 | avatar.Invulnerable = true; | ||
158 | } | 164 | } |
159 | } | 165 | } |
160 | } | 166 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs index 2f21e6d..50348da 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs | |||
@@ -224,7 +224,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
224 | m_Cache.Cache(a); | 224 | m_Cache.Cache(a); |
225 | 225 | ||
226 | // if (null == a) | 226 | // if (null == a) |
227 | // m_log.WarnFormat("[LOCAL ASSET SERVICES CONNECTOR]: Could not asynchronously find asset with id {0}", id); | 227 | // m_log.WarnFormat("[LOCAL ASSET SERVICES CONNECTOR]: Could not asynchronously find asset with id {0}", id); |
228 | 228 | ||
229 | Util.FireAndForget(delegate { handler(assetID, s, a); }); | 229 | Util.FireAndForget(delegate { handler(assetID, s, a); }); |
230 | }); | 230 | }); |
diff --git a/OpenSim/Region/CoreModules/World/Access/AccessModule.cs b/OpenSim/Region/CoreModules/World/Access/AccessModule.cs index 73f7ae3..e4fe352 100644 --- a/OpenSim/Region/CoreModules/World/Access/AccessModule.cs +++ b/OpenSim/Region/CoreModules/World/Access/AccessModule.cs | |||
@@ -109,7 +109,7 @@ namespace OpenSim.Region.CoreModules.World | |||
109 | { | 109 | { |
110 | foreach (Scene s in m_SceneList) | 110 | foreach (Scene s in m_SceneList) |
111 | { | 111 | { |
112 | if(!ProcessCommand(s, cmd)) | 112 | if (!ProcessCommand(s, cmd)) |
113 | break; | 113 | break; |
114 | } | 114 | } |
115 | } | 115 | } |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs index c3e57f0..e77a23b 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs | |||
@@ -99,7 +99,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
99 | Quaternion rotationOffset = new Quaternion(20, 30, 40, 50); | 99 | Quaternion rotationOffset = new Quaternion(20, 30, 40, 50); |
100 | Vector3 offsetPosition = new Vector3(5, 10, 15); | 100 | Vector3 offsetPosition = new Vector3(5, 10, 15); |
101 | 101 | ||
102 | return new SceneObjectPart(ownerId, shape, groupPosition, rotationOffset, offsetPosition) { Name = partName }; | 102 | return new SceneObjectPart(ownerId, shape, groupPosition, rotationOffset, offsetPosition) { Name = partName }; |
103 | } | 103 | } |
104 | 104 | ||
105 | protected SceneObjectPart CreateSceneObjectPart2() | 105 | protected SceneObjectPart CreateSceneObjectPart2() |
@@ -112,7 +112,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
112 | Vector3 offsetPosition = new Vector3(20, 25, 30); | 112 | Vector3 offsetPosition = new Vector3(20, 25, 30); |
113 | 113 | ||
114 | return new SceneObjectPart(ownerId, shape, groupPosition, rotationOffset, offsetPosition) { Name = partName }; | 114 | return new SceneObjectPart(ownerId, shape, groupPosition, rotationOffset, offsetPosition) { Name = partName }; |
115 | } | 115 | } |
116 | 116 | ||
117 | /// <summary> | 117 | /// <summary> |
118 | /// Test saving a V0.2 OpenSim Region Archive. | 118 | /// Test saving a V0.2 OpenSim Region Archive. |
@@ -231,7 +231,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
231 | foreach (string name in names) | 231 | foreach (string name in names) |
232 | { | 232 | { |
233 | if (name.EndsWith(".Resources.test-sound.wav")) | 233 | if (name.EndsWith(".Resources.test-sound.wav")) |
234 | soundDataResourceName = name; | 234 | soundDataResourceName = name; |
235 | } | 235 | } |
236 | Assert.That(soundDataResourceName, Is.Not.Null); | 236 | Assert.That(soundDataResourceName, Is.Not.Null); |
237 | 237 | ||
@@ -259,7 +259,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
259 | = new TaskInventoryItem { AssetID = soundUuid, ItemID = soundItemUuid, Name = soundItemName }; | 259 | = new TaskInventoryItem { AssetID = soundUuid, ItemID = soundItemUuid, Name = soundItemName }; |
260 | part1.Inventory.AddInventoryItem(item1, true); | 260 | part1.Inventory.AddInventoryItem(item1, true); |
261 | } | 261 | } |
262 | } | 262 | } |
263 | 263 | ||
264 | m_scene.AddNewSceneObject(object1, false); | 264 | m_scene.AddNewSceneObject(object1, false); |
265 | 265 | ||
@@ -306,15 +306,15 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
306 | /// Test loading the region settings of a V0.2 OpenSim Region Archive. | 306 | /// Test loading the region settings of a V0.2 OpenSim Region Archive. |
307 | /// </summary> | 307 | /// </summary> |
308 | [Test] | 308 | [Test] |
309 | public void TestLoadOarV0_2RegionSettings() | 309 | public void TestLoadOarV0_2RegionSettings() |
310 | { | 310 | { |
311 | TestHelper.InMethod(); | 311 | TestHelper.InMethod(); |
312 | //log4net.Config.XmlConfigurator.Configure(); | 312 | //log4net.Config.XmlConfigurator.Configure(); |
313 | 313 | ||
314 | MemoryStream archiveWriteStream = new MemoryStream(); | 314 | MemoryStream archiveWriteStream = new MemoryStream(); |
315 | TarArchiveWriter tar = new TarArchiveWriter(archiveWriteStream); | 315 | TarArchiveWriter tar = new TarArchiveWriter(archiveWriteStream); |
316 | 316 | ||
317 | tar.WriteDir(ArchiveConstants.TERRAINS_PATH); | 317 | tar.WriteDir(ArchiveConstants.TERRAINS_PATH); |
318 | tar.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, ArchiveWriteRequestExecution.Create0p2ControlFile()); | 318 | tar.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, ArchiveWriteRequestExecution.Create0p2ControlFile()); |
319 | 319 | ||
320 | RegionSettings rs = new RegionSettings(); | 320 | RegionSettings rs = new RegionSettings(); |
@@ -329,11 +329,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
329 | rs.DisablePhysics = true; | 329 | rs.DisablePhysics = true; |
330 | rs.DisableScripts = true; | 330 | rs.DisableScripts = true; |
331 | rs.Elevation1NW = 15.9; | 331 | rs.Elevation1NW = 15.9; |
332 | rs.Elevation1NE = 45.3; | 332 | rs.Elevation1NE = 45.3; |
333 | rs.Elevation1SE = 49; | 333 | rs.Elevation1SE = 49; |
334 | rs.Elevation1SW = 1.9; | 334 | rs.Elevation1SW = 1.9; |
335 | rs.Elevation2NW = 4.5; | 335 | rs.Elevation2NW = 4.5; |
336 | rs.Elevation2NE = 19.2; | 336 | rs.Elevation2NE = 19.2; |
337 | rs.Elevation2SE = 9.2; | 337 | rs.Elevation2SE = 9.2; |
338 | rs.Elevation2SW = 2.1; | 338 | rs.Elevation2SW = 2.1; |
339 | rs.FixedSun = true; | 339 | rs.FixedSun = true; |
@@ -411,7 +411,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
411 | // Quaternion part2RotationOffset = new Quaternion(60, 70, 80, 90); | 411 | // Quaternion part2RotationOffset = new Quaternion(60, 70, 80, 90); |
412 | // Vector3 part2OffsetPosition = new Vector3(20, 25, 30); | 412 | // Vector3 part2OffsetPosition = new Vector3(20, 25, 30); |
413 | 413 | ||
414 | SceneObjectPart part2 = CreateSceneObjectPart2(); | 414 | SceneObjectPart part2 = CreateSceneObjectPart2(); |
415 | 415 | ||
416 | // Create an oar file that we can use for the merge | 416 | // Create an oar file that we can use for the merge |
417 | { | 417 | { |
@@ -420,9 +420,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
420 | TerrainModule terrainModule = new TerrainModule(); | 420 | TerrainModule terrainModule = new TerrainModule(); |
421 | 421 | ||
422 | Scene scene = SceneSetupHelpers.SetupScene(); | 422 | Scene scene = SceneSetupHelpers.SetupScene(); |
423 | SceneSetupHelpers.SetupSceneModules(scene, archiverModule, serialiserModule, terrainModule); | 423 | SceneSetupHelpers.SetupSceneModules(scene, archiverModule, serialiserModule, terrainModule); |
424 | 424 | ||
425 | m_scene.AddNewSceneObject(new SceneObjectGroup(part2), false); | 425 | m_scene.AddNewSceneObject(new SceneObjectGroup(part2), false); |
426 | 426 | ||
427 | // Write out this scene | 427 | // Write out this scene |
428 | scene.EventManager.OnOarFileSaved += SaveCompleted; | 428 | scene.EventManager.OnOarFileSaved += SaveCompleted; |
diff --git a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs index 37f1f2e..1f5a4ff 100644 --- a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs +++ b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs | |||
@@ -60,7 +60,7 @@ namespace OpenSim.Region.CoreModules.World.Sound | |||
60 | } | 60 | } |
61 | 61 | ||
62 | public virtual void PlayAttachedSound( | 62 | public virtual void PlayAttachedSound( |
63 | UUID soundID, UUID ownerID, UUID objectID, double gain, Vector3 position, byte flags) | 63 | UUID soundID, UUID ownerID, UUID objectID, double gain, Vector3 position, byte flags, float radius) |
64 | { | 64 | { |
65 | foreach (ScenePresence p in m_scene.GetAvatars()) | 65 | foreach (ScenePresence p in m_scene.GetAvatars()) |
66 | { | 66 | { |
@@ -69,14 +69,17 @@ namespace OpenSim.Region.CoreModules.World.Sound | |||
69 | continue; | 69 | continue; |
70 | 70 | ||
71 | // Scale by distance | 71 | // Scale by distance |
72 | gain = (float)((double)gain*((100.0 - dis) / 100.0)); | 72 | if (radius == 0) |
73 | gain = (float)((double)gain * ((100.0 - dis) / 100.0)); | ||
74 | else | ||
75 | gain = (float)((double)gain * ((radius - dis) / radius)); | ||
73 | 76 | ||
74 | p.ControllingClient.SendPlayAttachedSound(soundID, objectID, ownerID, (float)gain, flags); | 77 | p.ControllingClient.SendPlayAttachedSound(soundID, objectID, ownerID, (float)gain, flags); |
75 | } | 78 | } |
76 | } | 79 | } |
77 | 80 | ||
78 | public virtual void TriggerSound( | 81 | public virtual void TriggerSound( |
79 | UUID soundId, UUID ownerID, UUID objectID, UUID parentID, double gain, Vector3 position, UInt64 handle) | 82 | UUID soundId, UUID ownerID, UUID objectID, UUID parentID, double gain, Vector3 position, UInt64 handle, float radius) |
80 | { | 83 | { |
81 | foreach (ScenePresence p in m_scene.GetAvatars()) | 84 | foreach (ScenePresence p in m_scene.GetAvatars()) |
82 | { | 85 | { |
@@ -85,7 +88,10 @@ namespace OpenSim.Region.CoreModules.World.Sound | |||
85 | continue; | 88 | continue; |
86 | 89 | ||
87 | // Scale by distance | 90 | // Scale by distance |
88 | gain = (float)((double)gain*((100.0 - dis) / 100.0)); | 91 | if (radius == 0) |
92 | gain = (float)((double)gain * ((100.0 - dis) / 100.0)); | ||
93 | else | ||
94 | gain = (float)((double)gain * ((radius - dis) / radius)); | ||
89 | 95 | ||
90 | p.ControllingClient.SendTriggeredSound( | 96 | p.ControllingClient.SendTriggeredSound( |
91 | soundId, ownerID, objectID, parentID, handle, position, (float)gain); | 97 | soundId, ownerID, objectID, parentID, handle, position, (float)gain); |
diff --git a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs index a40828b..1e7ea7b 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs | |||
@@ -84,6 +84,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
84 | private ITerrainChannel m_revert; | 84 | private ITerrainChannel m_revert; |
85 | private Scene m_scene; | 85 | private Scene m_scene; |
86 | private volatile bool m_tainted; | 86 | private volatile bool m_tainted; |
87 | private readonly UndoStack<LandUndoState> m_undo = new UndoStack<LandUndoState>(5); | ||
87 | 88 | ||
88 | #region ICommandableModule Members | 89 | #region ICommandableModule Members |
89 | 90 | ||
@@ -174,6 +175,11 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
174 | 175 | ||
175 | #region ITerrainModule Members | 176 | #region ITerrainModule Members |
176 | 177 | ||
178 | public void UndoTerrain(ITerrainChannel channel) | ||
179 | { | ||
180 | m_channel = channel; | ||
181 | } | ||
182 | |||
177 | /// <summary> | 183 | /// <summary> |
178 | /// Loads a terrain file from disk and installs it in the scene. | 184 | /// Loads a terrain file from disk and installs it in the scene. |
179 | /// </summary> | 185 | /// </summary> |
@@ -574,6 +580,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
574 | { | 580 | { |
575 | client.OnModifyTerrain += client_OnModifyTerrain; | 581 | client.OnModifyTerrain += client_OnModifyTerrain; |
576 | client.OnBakeTerrain += client_OnBakeTerrain; | 582 | client.OnBakeTerrain += client_OnBakeTerrain; |
583 | client.OnLandUndo += client_OnLandUndo; | ||
577 | } | 584 | } |
578 | 585 | ||
579 | /// <summary> | 586 | /// <summary> |
@@ -664,6 +671,19 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
664 | return changesLimited; | 671 | return changesLimited; |
665 | } | 672 | } |
666 | 673 | ||
674 | private void client_OnLandUndo(IClientAPI client) | ||
675 | { | ||
676 | lock (m_undo) | ||
677 | { | ||
678 | if (m_undo.Count > 0) | ||
679 | { | ||
680 | LandUndoState goback = m_undo.Pop(); | ||
681 | if (goback != null) | ||
682 | goback.PlaybackState(); | ||
683 | } | ||
684 | } | ||
685 | } | ||
686 | |||
667 | /// <summary> | 687 | /// <summary> |
668 | /// Sends a copy of the current terrain to the scenes clients | 688 | /// Sends a copy of the current terrain to the scenes clients |
669 | /// </summary> | 689 | /// </summary> |
@@ -718,6 +738,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
718 | } | 738 | } |
719 | if (allowed) | 739 | if (allowed) |
720 | { | 740 | { |
741 | StoreUndoState(); | ||
721 | m_painteffects[(StandardTerrainEffects) action].PaintEffect( | 742 | m_painteffects[(StandardTerrainEffects) action].PaintEffect( |
722 | m_channel, allowMask, west, south, height, size, seconds); | 743 | m_channel, allowMask, west, south, height, size, seconds); |
723 | 744 | ||
@@ -758,6 +779,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
758 | 779 | ||
759 | if (allowed) | 780 | if (allowed) |
760 | { | 781 | { |
782 | StoreUndoState(); | ||
761 | m_floodeffects[(StandardTerrainEffects) action].FloodEffect( | 783 | m_floodeffects[(StandardTerrainEffects) action].FloodEffect( |
762 | m_channel, fillArea, size); | 784 | m_channel, fillArea, size); |
763 | 785 | ||
@@ -782,6 +804,25 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
782 | } | 804 | } |
783 | } | 805 | } |
784 | 806 | ||
807 | private void StoreUndoState() | ||
808 | { | ||
809 | lock (m_undo) | ||
810 | { | ||
811 | if (m_undo.Count > 0) | ||
812 | { | ||
813 | LandUndoState last = m_undo.Peek(); | ||
814 | if (last != null) | ||
815 | { | ||
816 | if (last.Compare(m_channel)) | ||
817 | return; | ||
818 | } | ||
819 | } | ||
820 | |||
821 | LandUndoState nUndo = new LandUndoState(this, m_channel); | ||
822 | m_undo.Push(nUndo); | ||
823 | } | ||
824 | } | ||
825 | |||
785 | #region Console Commands | 826 | #region Console Commands |
786 | 827 | ||
787 | private void InterfaceLoadFile(Object[] args) | 828 | private void InterfaceLoadFile(Object[] args) |