diff options
author | Melanie | 2012-08-23 01:41:47 +0100 |
---|---|---|
committer | Melanie | 2012-08-23 01:41:47 +0100 |
commit | f8603a215d142f3b83a5ff1dc022b716b3e48f99 (patch) | |
tree | 49971f8e12efcfea18b4b2fdb6bd54c904d3f52c /OpenSim/Region/CoreModules | |
parent | Merge branch 'avination' into careminster (diff) | |
parent | this should be an if-else block in case the non-phys min/max are smaller than... (diff) | |
download | opensim-SC_OLD-f8603a215d142f3b83a5ff1dc022b716b3e48f99.zip opensim-SC_OLD-f8603a215d142f3b83a5ff1dc022b716b3e48f99.tar.gz opensim-SC_OLD-f8603a215d142f3b83a5ff1dc022b716b3e48f99.tar.bz2 opensim-SC_OLD-f8603a215d142f3b83a5ff1dc022b716b3e48f99.tar.xz |
Merge branch 'master' into careminster
Conflicts:
OpenSim/Framework/IClientAPI.cs
OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs
OpenSim/Region/Framework/Scenes/Scene.cs
OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
Diffstat (limited to 'OpenSim/Region/CoreModules')
6 files changed, 116 insertions, 33 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs index d9a619d..48f3a23 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs | |||
@@ -461,7 +461,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests | |||
461 | 461 | ||
462 | SceneObjectGroup rezzedAtt = presence.GetAttachments()[0]; | 462 | SceneObjectGroup rezzedAtt = presence.GetAttachments()[0]; |
463 | 463 | ||
464 | scene.IncomingCloseAgent(presence.UUID); | 464 | scene.IncomingCloseAgent(presence.UUID, false); |
465 | 465 | ||
466 | // Check that we can't retrieve this attachment from the scene. | 466 | // Check that we can't retrieve this attachment from the scene. |
467 | Assert.That(scene.GetSceneObjectGroup(rezzedAtt.UUID), Is.Null); | 467 | Assert.That(scene.GetSceneObjectGroup(rezzedAtt.UUID), Is.Null); |
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 560f807..c248f95 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -644,7 +644,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
644 | // an agent cannot teleport back to this region if it has teleported away. | 644 | // an agent cannot teleport back to this region if it has teleported away. |
645 | Thread.Sleep(2000); | 645 | Thread.Sleep(2000); |
646 | 646 | ||
647 | sp.Scene.IncomingCloseAgent(sp.UUID); | 647 | sp.Scene.IncomingCloseAgent(sp.UUID, false); |
648 | } | 648 | } |
649 | else | 649 | else |
650 | { | 650 | { |
diff --git a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs index 8b2f2f8..05eaaec 100644 --- a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs | |||
@@ -308,36 +308,44 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender | |||
308 | 308 | ||
309 | try | 309 | try |
310 | { | 310 | { |
311 | if (alpha == 256) | 311 | // XXX: In testing, it appears that if multiple threads dispose of separate GDI+ objects simultaneously, |
312 | bitmap = new Bitmap(width, height, PixelFormat.Format32bppRgb); | 312 | // the native malloc heap can become corrupted, possibly due to a double free(). This may be due to |
313 | else | 313 | // bugs in the underlying libcairo used by mono's libgdiplus.dll on Linux/OSX. These problems were |
314 | bitmap = new Bitmap(width, height, PixelFormat.Format32bppArgb); | 314 | // seen with both libcario 1.10.2-6.1ubuntu3 and 1.8.10-2ubuntu1. They go away if disposal is perfomed |
315 | 315 | // under lock. | |
316 | graph = Graphics.FromImage(bitmap); | 316 | lock (this) |
317 | |||
318 | // this is really just to save people filling the | ||
319 | // background color in their scripts, only do when fully opaque | ||
320 | if (alpha >= 255) | ||
321 | { | 317 | { |
322 | using (SolidBrush bgFillBrush = new SolidBrush(bgColor)) | 318 | if (alpha == 256) |
319 | bitmap = new Bitmap(width, height, PixelFormat.Format32bppRgb); | ||
320 | else | ||
321 | bitmap = new Bitmap(width, height, PixelFormat.Format32bppArgb); | ||
322 | |||
323 | graph = Graphics.FromImage(bitmap); | ||
324 | |||
325 | // this is really just to save people filling the | ||
326 | // background color in their scripts, only do when fully opaque | ||
327 | if (alpha >= 255) | ||
323 | { | 328 | { |
324 | graph.FillRectangle(bgFillBrush, 0, 0, width, height); | 329 | using (SolidBrush bgFillBrush = new SolidBrush(bgColor)) |
330 | { | ||
331 | graph.FillRectangle(bgFillBrush, 0, 0, width, height); | ||
332 | } | ||
325 | } | 333 | } |
326 | } | 334 | |
327 | 335 | for (int w = 0; w < bitmap.Width; w++) | |
328 | for (int w = 0; w < bitmap.Width; w++) | ||
329 | { | ||
330 | if (alpha <= 255) | ||
331 | { | 336 | { |
332 | for (int h = 0; h < bitmap.Height; h++) | 337 | if (alpha <= 255) |
333 | { | 338 | { |
334 | bitmap.SetPixel(w, h, Color.FromArgb(alpha, bitmap.GetPixel(w, h))); | 339 | for (int h = 0; h < bitmap.Height; h++) |
340 | { | ||
341 | bitmap.SetPixel(w, h, Color.FromArgb(alpha, bitmap.GetPixel(w, h))); | ||
342 | } | ||
335 | } | 343 | } |
336 | } | 344 | } |
345 | |||
346 | GDIDraw(data, graph, altDataDelim); | ||
337 | } | 347 | } |
338 | 348 | ||
339 | GDIDraw(data, graph, altDataDelim); | ||
340 | |||
341 | byte[] imageJ2000 = new byte[0]; | 349 | byte[] imageJ2000 = new byte[0]; |
342 | 350 | ||
343 | try | 351 | try |
@@ -355,11 +363,19 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender | |||
355 | } | 363 | } |
356 | finally | 364 | finally |
357 | { | 365 | { |
358 | if (graph != null) | 366 | // XXX: In testing, it appears that if multiple threads dispose of separate GDI+ objects simultaneously, |
359 | graph.Dispose(); | 367 | // the native malloc heap can become corrupted, possibly due to a double free(). This may be due to |
360 | 368 | // bugs in the underlying libcairo used by mono's libgdiplus.dll on Linux/OSX. These problems were | |
361 | if (bitmap != null) | 369 | // seen with both libcario 1.10.2-6.1ubuntu3 and 1.8.10-2ubuntu1. They go away if disposal is perfomed |
362 | bitmap.Dispose(); | 370 | // under lock. |
371 | lock (this) | ||
372 | { | ||
373 | if (graph != null) | ||
374 | graph.Dispose(); | ||
375 | |||
376 | if (bitmap != null) | ||
377 | bitmap.Dispose(); | ||
378 | } | ||
363 | } | 379 | } |
364 | } | 380 | } |
365 | 381 | ||
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs index 6eb99ea..8ed1833 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs | |||
@@ -313,7 +313,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
313 | 313 | ||
314 | if (m_scenes.ContainsKey(destination.RegionID)) | 314 | if (m_scenes.ContainsKey(destination.RegionID)) |
315 | { | 315 | { |
316 | Util.FireAndForget(delegate { m_scenes[destination.RegionID].IncomingCloseAgent(id); }); | 316 | // m_log.DebugFormat( |
317 | // "[LOCAL SIMULATION CONNECTOR]: Found region {0} {1} to send AgentUpdate", | ||
318 | // s.RegionInfo.RegionName, destination.RegionHandle); | ||
319 | |||
320 | Util.FireAndForget(delegate { m_scenes[destination.RegionID].IncomingCloseAgent(id, false); }); | ||
317 | return true; | 321 | return true; |
318 | } | 322 | } |
319 | //m_log.Debug("[LOCAL COMMS]: region not found in SendCloseAgent"); | 323 | //m_log.Debug("[LOCAL COMMS]: region not found in SendCloseAgent"); |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index 619550c..142567b 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | |||
@@ -97,6 +97,13 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
97 | } | 97 | } |
98 | } | 98 | } |
99 | 99 | ||
100 | /// <summary> | ||
101 | /// Used to cache lookups for valid groups. | ||
102 | /// </summary> | ||
103 | private IDictionary<UUID, bool> m_validGroupUuids = new Dictionary<UUID, bool>(); | ||
104 | |||
105 | private IGroupsModule m_groupsModule; | ||
106 | |||
100 | public ArchiveReadRequest(Scene scene, string loadPath, bool merge, bool skipAssets, Guid requestId) | 107 | public ArchiveReadRequest(Scene scene, string loadPath, bool merge, bool skipAssets, Guid requestId) |
101 | { | 108 | { |
102 | m_scene = scene; | 109 | m_scene = scene; |
@@ -120,6 +127,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
120 | 127 | ||
121 | // Zero can never be a valid user id | 128 | // Zero can never be a valid user id |
122 | m_validUserUuids[UUID.Zero] = false; | 129 | m_validUserUuids[UUID.Zero] = false; |
130 | |||
131 | m_groupsModule = m_scene.RequestModuleInterface<IGroupsModule>(); | ||
123 | } | 132 | } |
124 | 133 | ||
125 | public ArchiveReadRequest(Scene scene, Stream loadStream, bool merge, bool skipAssets, Guid requestId) | 134 | public ArchiveReadRequest(Scene scene, Stream loadStream, bool merge, bool skipAssets, Guid requestId) |
@@ -132,6 +141,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
132 | 141 | ||
133 | // Zero can never be a valid user id | 142 | // Zero can never be a valid user id |
134 | m_validUserUuids[UUID.Zero] = false; | 143 | m_validUserUuids[UUID.Zero] = false; |
144 | |||
145 | m_groupsModule = m_scene.RequestModuleInterface<IGroupsModule>(); | ||
135 | } | 146 | } |
136 | 147 | ||
137 | /// <summary> | 148 | /// <summary> |
@@ -302,6 +313,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
302 | if (!ResolveUserUuid(part.LastOwnerID)) | 313 | if (!ResolveUserUuid(part.LastOwnerID)) |
303 | part.LastOwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; | 314 | part.LastOwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; |
304 | 315 | ||
316 | if (!ResolveGroupUuid(part.GroupID)) | ||
317 | part.GroupID = UUID.Zero; | ||
318 | |||
305 | // And zap any troublesome sit target information | 319 | // And zap any troublesome sit target information |
306 | // part.SitTargetOrientation = new Quaternion(0, 0, 0, 1); | 320 | // part.SitTargetOrientation = new Quaternion(0, 0, 0, 1); |
307 | // part.SitTargetPosition = new Vector3(0, 0, 0); | 321 | // part.SitTargetPosition = new Vector3(0, 0, 0); |
@@ -335,13 +349,18 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
335 | { | 349 | { |
336 | kvp.Value.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; | 350 | kvp.Value.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; |
337 | } | 351 | } |
352 | |||
338 | if (kvp.Value.CreatorData == null || kvp.Value.CreatorData == string.Empty) | 353 | if (kvp.Value.CreatorData == null || kvp.Value.CreatorData == string.Empty) |
339 | { | 354 | { |
340 | if (!ResolveUserUuid(kvp.Value.CreatorID)) | 355 | if (!ResolveUserUuid(kvp.Value.CreatorID)) |
341 | kvp.Value.CreatorID = m_scene.RegionInfo.EstateSettings.EstateOwner; | 356 | kvp.Value.CreatorID = m_scene.RegionInfo.EstateSettings.EstateOwner; |
342 | } | 357 | } |
358 | |||
343 | if (UserManager != null) | 359 | if (UserManager != null) |
344 | UserManager.AddUser(kvp.Value.CreatorID, kvp.Value.CreatorData); | 360 | UserManager.AddUser(kvp.Value.CreatorID, kvp.Value.CreatorData); |
361 | |||
362 | if (!ResolveGroupUuid(kvp.Value.GroupID)) | ||
363 | kvp.Value.GroupID = UUID.Zero; | ||
345 | } | 364 | } |
346 | part.TaskInventory.LockItemsForRead(false); | 365 | part.TaskInventory.LockItemsForRead(false); |
347 | } | 366 | } |
@@ -382,9 +401,27 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
382 | foreach (string serialisedParcel in serialisedParcels) | 401 | foreach (string serialisedParcel in serialisedParcels) |
383 | { | 402 | { |
384 | LandData parcel = LandDataSerializer.Deserialize(serialisedParcel); | 403 | LandData parcel = LandDataSerializer.Deserialize(serialisedParcel); |
404 | |||
405 | // Validate User and Group UUID's | ||
406 | |||
385 | if (!ResolveUserUuid(parcel.OwnerID)) | 407 | if (!ResolveUserUuid(parcel.OwnerID)) |
386 | parcel.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; | 408 | parcel.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; |
387 | 409 | ||
410 | if (!ResolveGroupUuid(parcel.GroupID)) | ||
411 | { | ||
412 | parcel.GroupID = UUID.Zero; | ||
413 | parcel.IsGroupOwned = false; | ||
414 | } | ||
415 | |||
416 | List<LandAccessEntry> accessList = new List<LandAccessEntry>(); | ||
417 | foreach (LandAccessEntry entry in parcel.ParcelAccessList) | ||
418 | { | ||
419 | if (ResolveUserUuid(entry.AgentID)) | ||
420 | accessList.Add(entry); | ||
421 | // else, drop this access rule | ||
422 | } | ||
423 | parcel.ParcelAccessList = accessList; | ||
424 | |||
388 | // m_log.DebugFormat( | 425 | // m_log.DebugFormat( |
389 | // "[ARCHIVER]: Adding parcel {0}, local id {1}, area {2}", | 426 | // "[ARCHIVER]: Adding parcel {0}, local id {1}, area {2}", |
390 | // parcel.Name, parcel.LocalID, parcel.Area); | 427 | // parcel.Name, parcel.LocalID, parcel.Area); |
@@ -419,6 +456,30 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
419 | } | 456 | } |
420 | 457 | ||
421 | /// <summary> | 458 | /// <summary> |
459 | /// Look up the given group id to check whether it's one that is valid for this grid. | ||
460 | /// </summary> | ||
461 | /// <param name="uuid"></param> | ||
462 | /// <returns></returns> | ||
463 | private bool ResolveGroupUuid(UUID uuid) | ||
464 | { | ||
465 | if (uuid == UUID.Zero) | ||
466 | return true; // this means the object has no group | ||
467 | |||
468 | if (!m_validGroupUuids.ContainsKey(uuid)) | ||
469 | { | ||
470 | bool exists; | ||
471 | |||
472 | if (m_groupsModule == null) | ||
473 | exists = false; | ||
474 | else | ||
475 | exists = (m_groupsModule.GetGroupRecord(uuid) != null); | ||
476 | |||
477 | m_validGroupUuids.Add(uuid, exists); | ||
478 | } | ||
479 | |||
480 | return m_validGroupUuids[uuid]; | ||
481 | } | ||
482 | |||
422 | /// Load an asset | 483 | /// Load an asset |
423 | /// </summary> | 484 | /// </summary> |
424 | /// <param name="assetFilename"></param> | 485 | /// <param name="assetFilename"></param> |
diff --git a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs index 14c1a39..a2f0950 100644 --- a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs +++ b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs | |||
@@ -85,13 +85,15 @@ namespace OpenSim.Region.CoreModules.World.Sound | |||
85 | dis = 0; | 85 | dis = 0; |
86 | } | 86 | } |
87 | 87 | ||
88 | float thisSpGain; | ||
89 | |||
88 | // Scale by distance | 90 | // Scale by distance |
89 | if (radius == 0) | 91 | if (radius == 0) |
90 | gain = (float)((double)gain * ((100.0 - dis) / 100.0)); | 92 | thisSpGain = (float)((double)gain * ((100.0 - dis) / 100.0)); |
91 | else | 93 | else |
92 | gain = (float)((double)gain * ((radius - dis) / radius)); | 94 | thisSpGain = (float)((double)gain * ((radius - dis) / radius)); |
93 | 95 | ||
94 | sp.ControllingClient.SendPlayAttachedSound(soundID, objectID, ownerID, (float)gain, flags); | 96 | sp.ControllingClient.SendPlayAttachedSound(soundID, objectID, ownerID, thisSpGain, flags); |
95 | }); | 97 | }); |
96 | } | 98 | } |
97 | 99 | ||