diff options
author | Melanie | 2010-03-03 02:07:03 +0000 |
---|---|---|
committer | Melanie | 2010-03-03 02:07:03 +0000 |
commit | 028a87fe37002e7a0611f66babf1deee46c83804 (patch) | |
tree | 387aec499fd60c2012bed8148e6a2ddc847c3d95 /OpenSim/Region/CoreModules/World | |
parent | Revert "test" (diff) | |
parent | Fixes Region.Framework tests. Although these tests don't fail, they need to b... (diff) | |
download | opensim-SC_OLD-028a87fe37002e7a0611f66babf1deee46c83804.zip opensim-SC_OLD-028a87fe37002e7a0611f66babf1deee46c83804.tar.gz opensim-SC_OLD-028a87fe37002e7a0611f66babf1deee46c83804.tar.bz2 opensim-SC_OLD-028a87fe37002e7a0611f66babf1deee46c83804.tar.xz |
Merge branch 'master' into careminster-presence-refactor
This brings careminster on the level of master. To be tested
Diffstat (limited to 'OpenSim/Region/CoreModules/World')
13 files changed, 154 insertions, 128 deletions
diff --git a/OpenSim/Region/CoreModules/World/Access/AccessModule.cs b/OpenSim/Region/CoreModules/World/Access/AccessModule.cs index 73f7ae3..c355b13 100644 --- a/OpenSim/Region/CoreModules/World/Access/AccessModule.cs +++ b/OpenSim/Region/CoreModules/World/Access/AccessModule.cs | |||
@@ -33,7 +33,6 @@ using Nini.Config; | |||
33 | using OpenMetaverse; | 33 | using OpenMetaverse; |
34 | using OpenSim.Framework; | 34 | using OpenSim.Framework; |
35 | using OpenSim.Framework.Console; | 35 | using OpenSim.Framework.Console; |
36 | using OpenSim.Framework.Communications.Cache; | ||
37 | using OpenSim.Region.Framework.Interfaces; | 36 | using OpenSim.Region.Framework.Interfaces; |
38 | using OpenSim.Region.Framework.Scenes; | 37 | using OpenSim.Region.Framework.Scenes; |
39 | using OpenSim.Services.Interfaces; | 38 | using OpenSim.Services.Interfaces; |
@@ -109,7 +108,7 @@ namespace OpenSim.Region.CoreModules.World | |||
109 | { | 108 | { |
110 | foreach (Scene s in m_SceneList) | 109 | foreach (Scene s in m_SceneList) |
111 | { | 110 | { |
112 | if(!ProcessCommand(s, cmd)) | 111 | if (!ProcessCommand(s, cmd)) |
113 | break; | 112 | break; |
114 | } | 113 | } |
115 | } | 114 | } |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index c7c9778..14bab6e 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | |||
@@ -38,10 +38,11 @@ using OpenMetaverse; | |||
38 | using OpenSim.Framework; | 38 | using OpenSim.Framework; |
39 | using OpenSim.Framework.Serialization; | 39 | using OpenSim.Framework.Serialization; |
40 | using OpenSim.Framework.Serialization.External; | 40 | using OpenSim.Framework.Serialization.External; |
41 | using OpenSim.Framework.Communications.Cache; | 41 | |
42 | using OpenSim.Region.CoreModules.World.Terrain; | 42 | using OpenSim.Region.CoreModules.World.Terrain; |
43 | using OpenSim.Region.Framework.Interfaces; | 43 | using OpenSim.Region.Framework.Interfaces; |
44 | using OpenSim.Region.Framework.Scenes; | 44 | using OpenSim.Region.Framework.Scenes; |
45 | using OpenSim.Services.Interfaces; | ||
45 | 46 | ||
46 | namespace OpenSim.Region.CoreModules.World.Archiver | 47 | namespace OpenSim.Region.CoreModules.World.Archiver |
47 | { | 48 | { |
@@ -73,7 +74,19 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
73 | public ArchiveReadRequest(Scene scene, string loadPath, bool merge, Guid requestId) | 74 | public ArchiveReadRequest(Scene scene, string loadPath, bool merge, Guid requestId) |
74 | { | 75 | { |
75 | m_scene = scene; | 76 | m_scene = scene; |
76 | m_loadStream = new GZipStream(GetStream(loadPath), CompressionMode.Decompress); | 77 | |
78 | try | ||
79 | { | ||
80 | m_loadStream = new GZipStream(GetStream(loadPath), CompressionMode.Decompress); | ||
81 | } | ||
82 | catch (EntryPointNotFoundException e) | ||
83 | { | ||
84 | m_log.ErrorFormat( | ||
85 | "[ARCHIVER]: Mismatch between Mono and zlib1g library version when trying to create compression stream." | ||
86 | + "If you've manually installed Mono, have you appropriately updated zlib1g as well?"); | ||
87 | m_log.Error(e); | ||
88 | } | ||
89 | |||
77 | m_errorMessage = String.Empty; | 90 | m_errorMessage = String.Empty; |
78 | m_merge = merge; | 91 | m_merge = merge; |
79 | m_requestId = requestId; | 92 | m_requestId = requestId; |
@@ -181,10 +194,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
181 | 194 | ||
182 | // Try to retain the original creator/owner/lastowner if their uuid is present on this grid | 195 | // Try to retain the original creator/owner/lastowner if their uuid is present on this grid |
183 | // otherwise, use the master avatar uuid instead | 196 | // otherwise, use the master avatar uuid instead |
184 | UUID masterAvatarId = m_scene.RegionInfo.MasterAvatarAssignedUUID; | ||
185 | |||
186 | if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero) | ||
187 | masterAvatarId = m_scene.RegionInfo.EstateSettings.EstateOwner; | ||
188 | 197 | ||
189 | // Reload serialized parcels | 198 | // Reload serialized parcels |
190 | m_log.InfoFormat("[ARCHIVER]: Loading {0} parcels. Please wait.", serialisedParcels.Count); | 199 | m_log.InfoFormat("[ARCHIVER]: Loading {0} parcels. Please wait.", serialisedParcels.Count); |
@@ -193,7 +202,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
193 | { | 202 | { |
194 | LandData parcel = LandDataSerializer.Deserialize(serialisedParcel); | 203 | LandData parcel = LandDataSerializer.Deserialize(serialisedParcel); |
195 | if (!ResolveUserUuid(parcel.OwnerID)) | 204 | if (!ResolveUserUuid(parcel.OwnerID)) |
196 | parcel.OwnerID = masterAvatarId; | 205 | parcel.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; |
197 | landData.Add(parcel); | 206 | landData.Add(parcel); |
198 | } | 207 | } |
199 | m_scene.EventManager.TriggerIncomingLandDataFromStorage(landData); | 208 | m_scene.EventManager.TriggerIncomingLandDataFromStorage(landData); |
@@ -232,13 +241,13 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
232 | foreach (SceneObjectPart part in sceneObject.Children.Values) | 241 | foreach (SceneObjectPart part in sceneObject.Children.Values) |
233 | { | 242 | { |
234 | if (!ResolveUserUuid(part.CreatorID)) | 243 | if (!ResolveUserUuid(part.CreatorID)) |
235 | part.CreatorID = masterAvatarId; | 244 | part.CreatorID = m_scene.RegionInfo.EstateSettings.EstateOwner; |
236 | 245 | ||
237 | if (!ResolveUserUuid(part.OwnerID)) | 246 | if (!ResolveUserUuid(part.OwnerID)) |
238 | part.OwnerID = masterAvatarId; | 247 | part.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; |
239 | 248 | ||
240 | if (!ResolveUserUuid(part.LastOwnerID)) | 249 | if (!ResolveUserUuid(part.LastOwnerID)) |
241 | part.LastOwnerID = masterAvatarId; | 250 | part.LastOwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; |
242 | 251 | ||
243 | // And zap any troublesome sit target information | 252 | // And zap any troublesome sit target information |
244 | part.SitTargetOrientation = new Quaternion(0, 0, 0, 1); | 253 | part.SitTargetOrientation = new Quaternion(0, 0, 0, 1); |
@@ -253,11 +262,14 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
253 | { | 262 | { |
254 | if (!ResolveUserUuid(kvp.Value.OwnerID)) | 263 | if (!ResolveUserUuid(kvp.Value.OwnerID)) |
255 | { | 264 | { |
256 | kvp.Value.OwnerID = masterAvatarId; | 265 | if (!ResolveUserUuid(kvp.Value.OwnerID)) |
257 | } | 266 | { |
258 | if (!ResolveUserUuid(kvp.Value.CreatorID)) | 267 | kvp.Value.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; |
259 | { | 268 | } |
260 | kvp.Value.CreatorID = masterAvatarId; | 269 | if (!ResolveUserUuid(kvp.Value.CreatorID)) |
270 | { | ||
271 | kvp.Value.CreatorID = m_scene.RegionInfo.EstateSettings.EstateOwner; | ||
272 | } | ||
261 | } | 273 | } |
262 | } | 274 | } |
263 | part.TaskInventory.LockItemsForRead(false); | 275 | part.TaskInventory.LockItemsForRead(false); |
@@ -291,8 +303,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
291 | { | 303 | { |
292 | if (!m_validUserUuids.ContainsKey(uuid)) | 304 | if (!m_validUserUuids.ContainsKey(uuid)) |
293 | { | 305 | { |
294 | CachedUserInfo profile = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(uuid); | 306 | UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, uuid); |
295 | if (profile != null && profile.UserProfile != null) | 307 | if (account != null) |
296 | m_validUserUuids.Add(uuid, true); | 308 | m_validUserUuids.Add(uuid, true); |
297 | else | 309 | else |
298 | m_validUserUuids.Add(uuid, false); | 310 | m_validUserUuids.Add(uuid, false); |
@@ -337,7 +349,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
337 | 349 | ||
338 | //m_log.DebugFormat("[ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType); | 350 | //m_log.DebugFormat("[ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType); |
339 | 351 | ||
340 | AssetBase asset = new AssetBase(new UUID(uuid), String.Empty, assetType); | 352 | AssetBase asset = new AssetBase(new UUID(uuid), String.Empty, assetType, UUID.Zero.ToString()); |
341 | asset.Data = data; | 353 | asset.Data = data; |
342 | 354 | ||
343 | // We're relying on the asset service to do the sensible thing and not store the asset if it already | 355 | // We're relying on the asset service to do the sensible thing and not store the asset if it already |
@@ -422,6 +434,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
422 | currentRegionSettings.TerrainTexture4 = loadedRegionSettings.TerrainTexture4; | 434 | currentRegionSettings.TerrainTexture4 = loadedRegionSettings.TerrainTexture4; |
423 | currentRegionSettings.UseEstateSun = loadedRegionSettings.UseEstateSun; | 435 | currentRegionSettings.UseEstateSun = loadedRegionSettings.UseEstateSun; |
424 | currentRegionSettings.WaterHeight = loadedRegionSettings.WaterHeight; | 436 | currentRegionSettings.WaterHeight = loadedRegionSettings.WaterHeight; |
437 | |||
438 | currentRegionSettings.Save(); | ||
425 | 439 | ||
426 | IEstateModule estateModule = m_scene.RequestModuleInterface<IEstateModule>(); | 440 | IEstateModule estateModule = m_scene.RequestModuleInterface<IEstateModule>(); |
427 | 441 | ||
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs index 71bfe57..b61b341 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs | |||
@@ -65,7 +65,19 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
65 | public ArchiveWriteRequestPreparation(Scene scene, string savePath, Guid requestId) | 65 | public ArchiveWriteRequestPreparation(Scene scene, string savePath, Guid requestId) |
66 | { | 66 | { |
67 | m_scene = scene; | 67 | m_scene = scene; |
68 | m_saveStream = new GZipStream(new FileStream(savePath, FileMode.Create), CompressionMode.Compress); | 68 | |
69 | try | ||
70 | { | ||
71 | m_saveStream = new GZipStream(new FileStream(savePath, FileMode.Create), CompressionMode.Compress); | ||
72 | } | ||
73 | catch (EntryPointNotFoundException e) | ||
74 | { | ||
75 | m_log.ErrorFormat( | ||
76 | "[ARCHIVER]: Mismatch between Mono and zlib1g library version when trying to create compression stream." | ||
77 | + "If you've manually installed Mono, have you appropriately updated zlib1g as well?"); | ||
78 | m_log.Error(e); | ||
79 | } | ||
80 | |||
69 | m_requestId = requestId; | 81 | m_requestId = requestId; |
70 | } | 82 | } |
71 | 83 | ||
diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsDearchiver.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsDearchiver.cs index 2d2c570..2c04008 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/AssetsDearchiver.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsDearchiver.cs | |||
@@ -158,7 +158,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
158 | 158 | ||
159 | m_log.DebugFormat("[ARCHIVER]: Importing asset {0}", filename); | 159 | m_log.DebugFormat("[ARCHIVER]: Importing asset {0}", filename); |
160 | 160 | ||
161 | AssetBase asset = new AssetBase(new UUID(filename), metadata.Name, metadata.AssetType); | 161 | AssetBase asset = new AssetBase(new UUID(filename), metadata.Name, metadata.AssetType, UUID.Zero.ToString()); |
162 | asset.Description = metadata.Description; | 162 | asset.Description = metadata.Description; |
163 | asset.Data = data; | 163 | asset.Data = data; |
164 | 164 | ||
diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs index c3e57f0..de16d89 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs | |||
@@ -34,7 +34,7 @@ using NUnit.Framework; | |||
34 | using NUnit.Framework.SyntaxHelpers; | 34 | using NUnit.Framework.SyntaxHelpers; |
35 | using OpenMetaverse; | 35 | using OpenMetaverse; |
36 | using OpenSim.Framework; | 36 | using OpenSim.Framework; |
37 | using OpenSim.Framework.Communications.Cache; | 37 | |
38 | using OpenSim.Framework.Serialization; | 38 | using OpenSim.Framework.Serialization; |
39 | using OpenSim.Framework.Serialization.External; | 39 | using OpenSim.Framework.Serialization.External; |
40 | using OpenSim.Region.CoreModules.World.Serialiser; | 40 | using OpenSim.Region.CoreModules.World.Serialiser; |
@@ -63,7 +63,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
63 | SerialiserModule serialiserModule = new SerialiserModule(); | 63 | SerialiserModule serialiserModule = new SerialiserModule(); |
64 | TerrainModule terrainModule = new TerrainModule(); | 64 | TerrainModule terrainModule = new TerrainModule(); |
65 | 65 | ||
66 | m_scene = SceneSetupHelpers.SetupScene("scene1"); | 66 | m_scene = SceneSetupHelpers.SetupScene("useraccounts"); |
67 | SceneSetupHelpers.SetupSceneModules(m_scene, m_archiverModule, serialiserModule, terrainModule); | 67 | SceneSetupHelpers.SetupSceneModules(m_scene, m_archiverModule, serialiserModule, terrainModule); |
68 | } | 68 | } |
69 | 69 | ||
@@ -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/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index 03da269..e3bab2d 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | |||
@@ -57,10 +57,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
57 | if (!m_scene.RegionInfo.EstateSettings.UseGlobalTime) | 57 | if (!m_scene.RegionInfo.EstateSettings.UseGlobalTime) |
58 | sun=(uint)(m_scene.RegionInfo.EstateSettings.SunPosition*1024.0) + 0x1800; | 58 | sun=(uint)(m_scene.RegionInfo.EstateSettings.SunPosition*1024.0) + 0x1800; |
59 | UUID estateOwner; | 59 | UUID estateOwner; |
60 | if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero) | 60 | estateOwner = m_scene.RegionInfo.EstateSettings.EstateOwner; |
61 | estateOwner = m_scene.RegionInfo.EstateSettings.EstateOwner; | ||
62 | else | ||
63 | estateOwner = m_scene.RegionInfo.MasterAvatarAssignedUUID; | ||
64 | 61 | ||
65 | if (m_scene.Permissions.IsGod(remote_client.AgentId)) | 62 | if (m_scene.Permissions.IsGod(remote_client.AgentId)) |
66 | estateOwner = remote_client.AgentId; | 63 | estateOwner = remote_client.AgentId; |
@@ -241,8 +238,6 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
241 | 238 | ||
242 | if (user == m_scene.RegionInfo.EstateSettings.EstateOwner) | 239 | if (user == m_scene.RegionInfo.EstateSettings.EstateOwner) |
243 | return; // never process EO | 240 | return; // never process EO |
244 | if (user == m_scene.RegionInfo.MasterAvatarAssignedUUID) | ||
245 | return; // never process owner | ||
246 | 241 | ||
247 | if ((estateAccessType & 4) != 0) // User add | 242 | if ((estateAccessType & 4) != 0) // User add |
248 | { | 243 | { |
@@ -709,16 +704,9 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
709 | lsri.TaskID = sog.UUID; | 704 | lsri.TaskID = sog.UUID; |
710 | lsri.TaskLocalID = sog.LocalId; | 705 | lsri.TaskLocalID = sog.LocalId; |
711 | lsri.TaskName = sog.GetPartName(obj); | 706 | lsri.TaskName = sog.GetPartName(obj); |
712 | if (m_scene.CommsManager.UUIDNameCachedTest(sog.OwnerID)) | 707 | lsri.OwnerName = "waiting"; |
713 | { | 708 | lock (uuidNameLookupList) |
714 | lsri.OwnerName = m_scene.CommsManager.UUIDNameRequestString(sog.OwnerID); | 709 | uuidNameLookupList.Add(sog.OwnerID); |
715 | } | ||
716 | else | ||
717 | { | ||
718 | lsri.OwnerName = "waiting"; | ||
719 | lock (uuidNameLookupList) | ||
720 | uuidNameLookupList.Add(sog.OwnerID); | ||
721 | } | ||
722 | 710 | ||
723 | if (filter.Length != 0) | 711 | if (filter.Length != 0) |
724 | { | 712 | { |
@@ -769,7 +757,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
769 | for (int i = 0; i < uuidarr.Length; i++) | 757 | for (int i = 0; i < uuidarr.Length; i++) |
770 | { | 758 | { |
771 | // string lookupname = m_scene.CommsManager.UUIDNameRequestString(uuidarr[i]); | 759 | // string lookupname = m_scene.CommsManager.UUIDNameRequestString(uuidarr[i]); |
772 | m_scene.CommsManager.UUIDNameRequestString(uuidarr[i]); | 760 | m_scene.GetUserName(uuidarr[i]); |
773 | // we drop it. It gets cached though... so we're ready for the next request. | 761 | // we drop it. It gets cached though... so we're ready for the next request. |
774 | } | 762 | } |
775 | } | 763 | } |
@@ -808,14 +796,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
808 | args.waterHeight = (float)m_scene.RegionInfo.RegionSettings.WaterHeight; | 796 | args.waterHeight = (float)m_scene.RegionInfo.RegionSettings.WaterHeight; |
809 | args.regionFlags = GetRegionFlags(); | 797 | args.regionFlags = GetRegionFlags(); |
810 | args.regionName = m_scene.RegionInfo.RegionName; | 798 | args.regionName = m_scene.RegionInfo.RegionName; |
811 | if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero) | 799 | args.SimOwner = m_scene.RegionInfo.EstateSettings.EstateOwner; |
812 | args.SimOwner = m_scene.RegionInfo.EstateSettings.EstateOwner; | ||
813 | else | ||
814 | args.SimOwner = m_scene.RegionInfo.MasterAvatarAssignedUUID; | ||
815 | |||
816 | // Fudge estate owner | ||
817 | //if (m_scene.Permissions.IsGod(remoteClient.AgentId)) | ||
818 | // args.SimOwner = remoteClient.AgentId; | ||
819 | 800 | ||
820 | args.terrainBase0 = UUID.Zero; | 801 | args.terrainBase0 = UUID.Zero; |
821 | args.terrainBase1 = UUID.Zero; | 802 | args.terrainBase1 = UUID.Zero; |
@@ -1194,8 +1175,6 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
1194 | 1175 | ||
1195 | public bool IsManager(UUID avatarID) | 1176 | public bool IsManager(UUID avatarID) |
1196 | { | 1177 | { |
1197 | if (avatarID == m_scene.RegionInfo.MasterAvatarAssignedUUID) | ||
1198 | return true; | ||
1199 | if (avatarID == m_scene.RegionInfo.EstateSettings.EstateOwner) | 1178 | if (avatarID == m_scene.RegionInfo.EstateSettings.EstateOwner) |
1200 | return true; | 1179 | return true; |
1201 | 1180 | ||
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateTerrainXferHandler.cs b/OpenSim/Region/CoreModules/World/Estate/EstateTerrainXferHandler.cs index 2ff635b..b8d8b10 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateTerrainXferHandler.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateTerrainXferHandler.cs | |||
@@ -52,7 +52,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
52 | 52 | ||
53 | public EstateTerrainXferHandler(IClientAPI pRemoteClient, string pClientFilename) | 53 | public EstateTerrainXferHandler(IClientAPI pRemoteClient, string pClientFilename) |
54 | { | 54 | { |
55 | m_asset = new AssetBase(UUID.Zero, pClientFilename, type); | 55 | m_asset = new AssetBase(UUID.Zero, pClientFilename, type, pRemoteClient.AgentId.ToString()); |
56 | m_asset.Data = new byte[0]; | 56 | m_asset.Data = new byte[0]; |
57 | m_asset.Description = "empty"; | 57 | m_asset.Description = "empty"; |
58 | m_asset.Local = true; | 58 | m_asset.Local = true; |
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 9be94ce..ef3e722 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | |||
@@ -239,10 +239,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
239 | ILandObject fullSimParcel = new LandObject(UUID.Zero, false, m_scene); | 239 | ILandObject fullSimParcel = new LandObject(UUID.Zero, false, m_scene); |
240 | 240 | ||
241 | fullSimParcel.SetLandBitmap(fullSimParcel.GetSquareLandBitmap(0, 0, (int)Constants.RegionSize, (int)Constants.RegionSize)); | 241 | fullSimParcel.SetLandBitmap(fullSimParcel.GetSquareLandBitmap(0, 0, (int)Constants.RegionSize, (int)Constants.RegionSize)); |
242 | if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero) | 242 | fullSimParcel.LandData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; |
243 | fullSimParcel.LandData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; | ||
244 | else | ||
245 | fullSimParcel.LandData.OwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID; | ||
246 | fullSimParcel.LandData.ClaimDate = Util.UnixTimeSinceEpoch(); | 243 | fullSimParcel.LandData.ClaimDate = Util.UnixTimeSinceEpoch(); |
247 | AddLandObject(fullSimParcel); | 244 | AddLandObject(fullSimParcel); |
248 | } | 245 | } |
@@ -1214,10 +1211,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1214 | { | 1211 | { |
1215 | if (m_scene.Permissions.CanAbandonParcel(remote_client.AgentId, land)) | 1212 | if (m_scene.Permissions.CanAbandonParcel(remote_client.AgentId, land)) |
1216 | { | 1213 | { |
1217 | if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero) | 1214 | land.LandData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; |
1218 | land.LandData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; | ||
1219 | else | ||
1220 | land.LandData.OwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID; | ||
1221 | land.LandData.GroupID = UUID.Zero; | 1215 | land.LandData.GroupID = UUID.Zero; |
1222 | land.LandData.IsGroupOwned = false; | 1216 | land.LandData.IsGroupOwned = false; |
1223 | m_scene.ForEachClient(SendParcelOverlay); | 1217 | m_scene.ForEachClient(SendParcelOverlay); |
@@ -1238,10 +1232,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1238 | { | 1232 | { |
1239 | if (m_scene.Permissions.CanReclaimParcel(remote_client.AgentId, land)) | 1233 | if (m_scene.Permissions.CanReclaimParcel(remote_client.AgentId, land)) |
1240 | { | 1234 | { |
1241 | if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero) | 1235 | land.LandData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; |
1242 | land.LandData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; | ||
1243 | else | ||
1244 | land.LandData.OwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID; | ||
1245 | land.LandData.ClaimDate = Util.UnixTimeSinceEpoch(); | 1236 | land.LandData.ClaimDate = Util.UnixTimeSinceEpoch(); |
1246 | land.LandData.GroupID = UUID.Zero; | 1237 | land.LandData.GroupID = UUID.Zero; |
1247 | land.LandData.IsGroupOwned = false; | 1238 | land.LandData.IsGroupOwned = false; |
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index 1533462..4652d70 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | |||
@@ -32,7 +32,7 @@ using log4net; | |||
32 | using Nini.Config; | 32 | using Nini.Config; |
33 | using OpenMetaverse; | 33 | using OpenMetaverse; |
34 | using OpenSim.Framework; | 34 | using OpenSim.Framework; |
35 | using OpenSim.Framework.Communications.Cache; | 35 | |
36 | using OpenSim.Region.Framework.Interfaces; | 36 | using OpenSim.Region.Framework.Interfaces; |
37 | using OpenSim.Region.Framework.Scenes; | 37 | using OpenSim.Region.Framework.Scenes; |
38 | using OpenSim.Services.Interfaces; | 38 | using OpenSim.Services.Interfaces; |
@@ -95,6 +95,23 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
95 | 95 | ||
96 | protected Scene m_scene; | 96 | protected Scene m_scene; |
97 | 97 | ||
98 | private InventoryFolderImpl m_libraryRootFolder; | ||
99 | protected InventoryFolderImpl LibraryRootFolder | ||
100 | { | ||
101 | get | ||
102 | { | ||
103 | if (m_libraryRootFolder != null) | ||
104 | return m_libraryRootFolder; | ||
105 | |||
106 | ILibraryService lib = m_scene.RequestModuleInterface<ILibraryService>(); | ||
107 | if (lib != null) | ||
108 | { | ||
109 | m_libraryRootFolder = lib.LibraryRootFolder; | ||
110 | } | ||
111 | return m_libraryRootFolder; | ||
112 | } | ||
113 | } | ||
114 | |||
98 | #region Constants | 115 | #region Constants |
99 | // These are here for testing. They will be taken out | 116 | // These are here for testing. They will be taken out |
100 | 117 | ||
@@ -462,12 +479,6 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
462 | { | 479 | { |
463 | if (user == UUID.Zero) return false; | 480 | if (user == UUID.Zero) return false; |
464 | 481 | ||
465 | if (m_scene.RegionInfo.MasterAvatarAssignedUUID != UUID.Zero) | ||
466 | { | ||
467 | if (m_RegionOwnerIsGod && (m_scene.RegionInfo.MasterAvatarAssignedUUID == user)) | ||
468 | return true; | ||
469 | } | ||
470 | |||
471 | if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero) | 482 | if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero) |
472 | { | 483 | { |
473 | if (m_scene.RegionInfo.EstateSettings.EstateOwner == user && m_RegionOwnerIsGod) | 484 | if (m_scene.RegionInfo.EstateSettings.EstateOwner == user && m_RegionOwnerIsGod) |
@@ -479,10 +490,10 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
479 | 490 | ||
480 | if (m_allowGridGods) | 491 | if (m_allowGridGods) |
481 | { | 492 | { |
482 | CachedUserInfo profile = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(user); | 493 | UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, user); |
483 | if (profile != null && profile.UserProfile != null) | 494 | if (account != null) |
484 | { | 495 | { |
485 | if (profile.UserProfile.GodLevel >= 200) | 496 | if (account.UserLevel >= 200) |
486 | return true; | 497 | return true; |
487 | } | 498 | } |
488 | } | 499 | } |
@@ -499,13 +510,10 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
499 | if (m_friendsModule == null) | 510 | if (m_friendsModule == null) |
500 | return false; | 511 | return false; |
501 | 512 | ||
502 | List<FriendListItem> profile = m_friendsModule.GetUserFriends(user); | 513 | uint friendPerms = m_friendsModule.GetFriendPerms(user, objectOwner); |
514 | if ((friendPerms & (uint)FriendRights.CanModifyObjects) != 0) | ||
515 | return true; | ||
503 | 516 | ||
504 | foreach (FriendListItem item in profile) | ||
505 | { | ||
506 | if (item.Friend == objectOwner && (item.FriendPerms & (uint)FriendRights.CanModifyObjects) != 0) | ||
507 | return true; | ||
508 | } | ||
509 | return false; | 517 | return false; |
510 | } | 518 | } |
511 | 519 | ||
@@ -1011,9 +1019,9 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1011 | IInventoryService invService = m_scene.InventoryService; | 1019 | IInventoryService invService = m_scene.InventoryService; |
1012 | InventoryItemBase assetRequestItem = new InventoryItemBase(notecard, user); | 1020 | InventoryItemBase assetRequestItem = new InventoryItemBase(notecard, user); |
1013 | assetRequestItem = invService.GetItem(assetRequestItem); | 1021 | assetRequestItem = invService.GetItem(assetRequestItem); |
1014 | if (assetRequestItem == null) // Library item | 1022 | if (assetRequestItem == null && LibraryRootFolder != null) // Library item |
1015 | { | 1023 | { |
1016 | assetRequestItem = scene.CommsManager.UserProfileCacheService.LibraryRoot.FindItem(notecard); | 1024 | assetRequestItem = LibraryRootFolder.FindItem(notecard); |
1017 | 1025 | ||
1018 | if (assetRequestItem != null) // Implicitly readable | 1026 | if (assetRequestItem != null) // Implicitly readable |
1019 | return true; | 1027 | return true; |
@@ -1431,9 +1439,9 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1431 | IInventoryService invService = m_scene.InventoryService; | 1439 | IInventoryService invService = m_scene.InventoryService; |
1432 | InventoryItemBase assetRequestItem = new InventoryItemBase(script, user); | 1440 | InventoryItemBase assetRequestItem = new InventoryItemBase(script, user); |
1433 | assetRequestItem = invService.GetItem(assetRequestItem); | 1441 | assetRequestItem = invService.GetItem(assetRequestItem); |
1434 | if (assetRequestItem == null) // Library item | 1442 | if (assetRequestItem == null && LibraryRootFolder != null) // Library item |
1435 | { | 1443 | { |
1436 | assetRequestItem = m_scene.CommsManager.UserProfileCacheService.LibraryRoot.FindItem(script); | 1444 | assetRequestItem = LibraryRootFolder.FindItem(script); |
1437 | 1445 | ||
1438 | if (assetRequestItem != null) // Implicitly readable | 1446 | if (assetRequestItem != null) // Implicitly readable |
1439 | return true; | 1447 | return true; |
@@ -1526,9 +1534,9 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1526 | IInventoryService invService = m_scene.InventoryService; | 1534 | IInventoryService invService = m_scene.InventoryService; |
1527 | InventoryItemBase assetRequestItem = new InventoryItemBase(notecard, user); | 1535 | InventoryItemBase assetRequestItem = new InventoryItemBase(notecard, user); |
1528 | assetRequestItem = invService.GetItem(assetRequestItem); | 1536 | assetRequestItem = invService.GetItem(assetRequestItem); |
1529 | if (assetRequestItem == null) // Library item | 1537 | if (assetRequestItem == null && LibraryRootFolder != null) // Library item |
1530 | { | 1538 | { |
1531 | assetRequestItem = m_scene.CommsManager.UserProfileCacheService.LibraryRoot.FindItem(notecard); | 1539 | assetRequestItem = LibraryRootFolder.FindItem(notecard); |
1532 | 1540 | ||
1533 | if (assetRequestItem != null) // Implicitly readable | 1541 | if (assetRequestItem != null) // Implicitly readable |
1534 | return true; | 1542 | return true; |
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) |
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs index be46fa5..56b50dc 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs | |||
@@ -32,7 +32,6 @@ using OpenMetaverse; | |||
32 | using OpenSim.Framework; | 32 | using OpenSim.Framework; |
33 | using OpenSim.Region.Framework.Interfaces; | 33 | using OpenSim.Region.Framework.Interfaces; |
34 | using OpenSim.Region.Framework.Scenes; | 34 | using OpenSim.Region.Framework.Scenes; |
35 | using OpenSim.Region.Framework.Scenes.Hypergrid; | ||
36 | using OpenSim.Services.Interfaces; | 35 | using OpenSim.Services.Interfaces; |
37 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; | 36 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; |
38 | 37 | ||
@@ -104,25 +103,6 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
104 | if (info != null) regionInfos.Add(info); | 103 | if (info != null) regionInfos.Add(info); |
105 | } | 104 | } |
106 | 105 | ||
107 | if ((regionInfos.Count == 0) && IsHypergridOn()) | ||
108 | { | ||
109 | // OK, we tried but there are no regions matching that name. | ||
110 | // Let's check quickly if this is a domain name, and if so link to it | ||
111 | if (mapName.Contains(".")) | ||
112 | { | ||
113 | // It probably is a domain name. Try to link to it. | ||
114 | GridRegion regInfo; | ||
115 | Scene cScene = GetClientScene(remoteClient); | ||
116 | IHyperlinkService hyperService = cScene.RequestModuleInterface<IHyperlinkService>(); | ||
117 | if (hyperService != null) | ||
118 | { | ||
119 | regInfo = hyperService.TryLinkRegion(remoteClient, mapName); | ||
120 | if (regInfo != null) | ||
121 | regionInfos.Add(regInfo); | ||
122 | } | ||
123 | } | ||
124 | } | ||
125 | |||
126 | List<MapBlockData> blocks = new List<MapBlockData>(); | 106 | List<MapBlockData> blocks = new List<MapBlockData>(); |
127 | 107 | ||
128 | MapBlockData data; | 108 | MapBlockData data; |
@@ -158,11 +138,6 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
158 | remoteClient.SendMapBlock(blocks, 0); | 138 | remoteClient.SendMapBlock(blocks, 0); |
159 | } | 139 | } |
160 | 140 | ||
161 | private bool IsHypergridOn() | ||
162 | { | ||
163 | return (m_scene.SceneGridService is HGSceneCommunicationService); | ||
164 | } | ||
165 | |||
166 | private Scene GetClientScene(IClientAPI client) | 141 | private Scene GetClientScene(IClientAPI client) |
167 | { | 142 | { |
168 | foreach (Scene s in m_scenes) | 143 | foreach (Scene s in m_scenes) |
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index 44a651f..b63d014 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs | |||
@@ -1080,7 +1080,8 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
1080 | AssetBase asset = new AssetBase( | 1080 | AssetBase asset = new AssetBase( |
1081 | m_scene.RegionInfo.RegionSettings.TerrainImageID, | 1081 | m_scene.RegionInfo.RegionSettings.TerrainImageID, |
1082 | "terrainImage_" + m_scene.RegionInfo.RegionID.ToString() + "_" + lastMapRefresh.ToString(), | 1082 | "terrainImage_" + m_scene.RegionInfo.RegionID.ToString() + "_" + lastMapRefresh.ToString(), |
1083 | (sbyte)AssetType.Texture); | 1083 | (sbyte)AssetType.Texture, |
1084 | m_scene.RegionInfo.RegionID.ToString()); | ||
1084 | asset.Data = data; | 1085 | asset.Data = data; |
1085 | asset.Description = m_scene.RegionInfo.RegionName; | 1086 | asset.Description = m_scene.RegionInfo.RegionName; |
1086 | asset.Temporary = temporary; | 1087 | asset.Temporary = temporary; |