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 | |
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')
18 files changed, 199 insertions, 81 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 6255515..9c7598a 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs | |||
@@ -35,6 +35,7 @@ using System.Text; | |||
35 | using System.Text.RegularExpressions; | 35 | using System.Text.RegularExpressions; |
36 | using System.Timers; | 36 | using System.Timers; |
37 | using log4net; | 37 | using log4net; |
38 | using NDesk.Options; | ||
38 | using Nini.Config; | 39 | using Nini.Config; |
39 | using OpenMetaverse; | 40 | using OpenMetaverse; |
40 | using OpenSim.Framework; | 41 | using OpenSim.Framework; |
@@ -310,8 +311,11 @@ namespace OpenSim | |||
310 | "Change the scale of a named prim", HandleEditScale); | 311 | "Change the scale of a named prim", HandleEditScale); |
311 | 312 | ||
312 | m_console.Commands.AddCommand("Users", false, "kick user", | 313 | m_console.Commands.AddCommand("Users", false, "kick user", |
313 | "kick user <first> <last> [message]", | 314 | "kick user <first> <last> [--force] [message]", |
314 | "Kick a user off the simulator", KickUserCommand); | 315 | "Kick a user off the simulator", |
316 | "The --force option will kick the user without any checks to see whether it's already in the process of closing\n" | ||
317 | + "Only use this option if you are sure the avatar is inactive and a normal kick user operation does not removed them", | ||
318 | KickUserCommand); | ||
315 | 319 | ||
316 | m_console.Commands.AddCommand("Users", false, "show users", | 320 | m_console.Commands.AddCommand("Users", false, "show users", |
317 | "show users [full]", | 321 | "show users [full]", |
@@ -416,6 +420,7 @@ namespace OpenSim | |||
416 | { | 420 | { |
417 | RunCommandScript(m_shutdownCommandsFile); | 421 | RunCommandScript(m_shutdownCommandsFile); |
418 | } | 422 | } |
423 | |||
419 | base.ShutdownSpecific(); | 424 | base.ShutdownSpecific(); |
420 | } | 425 | } |
421 | 426 | ||
@@ -453,11 +458,17 @@ namespace OpenSim | |||
453 | /// <param name="cmdparams">name of avatar to kick</param> | 458 | /// <param name="cmdparams">name of avatar to kick</param> |
454 | private void KickUserCommand(string module, string[] cmdparams) | 459 | private void KickUserCommand(string module, string[] cmdparams) |
455 | { | 460 | { |
456 | if (cmdparams.Length < 4) | 461 | bool force = false; |
462 | |||
463 | OptionSet options = new OptionSet().Add("f|force", delegate (string v) { force = v != null; }); | ||
464 | |||
465 | List<string> mainParams = options.Parse(cmdparams); | ||
466 | |||
467 | if (mainParams.Count < 4) | ||
457 | return; | 468 | return; |
458 | 469 | ||
459 | string alert = null; | 470 | string alert = null; |
460 | if (cmdparams.Length > 4) | 471 | if (mainParams.Count > 4) |
461 | alert = String.Format("\n{0}\n", String.Join(" ", cmdparams, 4, cmdparams.Length - 4)); | 472 | alert = String.Format("\n{0}\n", String.Join(" ", cmdparams, 4, cmdparams.Length - 4)); |
462 | 473 | ||
463 | IList agents = SceneManager.GetCurrentSceneAvatars(); | 474 | IList agents = SceneManager.GetCurrentSceneAvatars(); |
@@ -466,8 +477,8 @@ namespace OpenSim | |||
466 | { | 477 | { |
467 | RegionInfo regionInfo = presence.Scene.RegionInfo; | 478 | RegionInfo regionInfo = presence.Scene.RegionInfo; |
468 | 479 | ||
469 | if (presence.Firstname.ToLower().Contains(cmdparams[2].ToLower()) && | 480 | if (presence.Firstname.ToLower().Contains(mainParams[2].ToLower()) && |
470 | presence.Lastname.ToLower().Contains(cmdparams[3].ToLower())) | 481 | presence.Lastname.ToLower().Contains(mainParams[3].ToLower())) |
471 | { | 482 | { |
472 | MainConsole.Instance.Output( | 483 | MainConsole.Instance.Output( |
473 | String.Format( | 484 | String.Format( |
@@ -480,7 +491,7 @@ namespace OpenSim | |||
480 | else | 491 | else |
481 | presence.ControllingClient.Kick("\nYou have been logged out by an administrator.\n"); | 492 | presence.ControllingClient.Kick("\nYou have been logged out by an administrator.\n"); |
482 | 493 | ||
483 | presence.Scene.IncomingCloseAgent(presence.UUID); | 494 | presence.Scene.IncomingCloseAgent(presence.UUID, force); |
484 | } | 495 | } |
485 | } | 496 | } |
486 | 497 | ||
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs index cd70410..d604cf6 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs | |||
@@ -94,7 +94,7 @@ namespace OpenSim.Region.ClientStack.Linden.Tests | |||
94 | UUID spId = TestHelpers.ParseTail(0x1); | 94 | UUID spId = TestHelpers.ParseTail(0x1); |
95 | 95 | ||
96 | SceneHelpers.AddScenePresence(m_scene, spId); | 96 | SceneHelpers.AddScenePresence(m_scene, spId); |
97 | m_scene.IncomingCloseAgent(spId); | 97 | m_scene.IncomingCloseAgent(spId, false); |
98 | 98 | ||
99 | // TODO: Add more assertions for the other aspects of event queues | 99 | // TODO: Add more assertions for the other aspects of event queues |
100 | Assert.That(MainServer.Instance.GetPollServiceHandlerKeys().Count, Is.EqualTo(0)); | 100 | Assert.That(MainServer.Instance.GetPollServiceHandlerKeys().Count, Is.EqualTo(0)); |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index ddd8f18..2dcc9cb 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -509,19 +509,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
509 | /// </summary> | 509 | /// </summary> |
510 | public void Close() | 510 | public void Close() |
511 | { | 511 | { |
512 | Close(true); | 512 | Close(true, false); |
513 | } | 513 | } |
514 | 514 | ||
515 | /// <summary> | 515 | public void Close(bool sendStop, bool force) |
516 | /// Shut down the client view | ||
517 | /// </summary> | ||
518 | public void Close(bool sendStop) | ||
519 | { | 516 | { |
520 | // We lock here to prevent race conditions between two threads calling close simultaneously (e.g. | 517 | // We lock here to prevent race conditions between two threads calling close simultaneously (e.g. |
521 | // a simultaneous relog just as a client is being closed out due to no packet ack from the old connection. | 518 | // a simultaneous relog just as a client is being closed out due to no packet ack from the old connection. |
522 | lock (CloseSyncLock) | 519 | lock (CloseSyncLock) |
523 | { | 520 | { |
524 | if (!IsActive) | 521 | // We still perform a force close inside the sync lock since this is intended to attempt close where |
522 | // there is some unidentified connection problem, not where we have issues due to deadlock | ||
523 | if (!IsActive && !force) | ||
525 | return; | 524 | return; |
526 | 525 | ||
527 | IsActive = false; | 526 | IsActive = false; |
@@ -12140,7 +12139,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
12140 | { | 12139 | { |
12141 | Kick(reason); | 12140 | Kick(reason); |
12142 | Thread.Sleep(1000); | 12141 | Thread.Sleep(1000); |
12143 | Close(); | 12142 | Disconnect(); |
12144 | } | 12143 | } |
12145 | 12144 | ||
12146 | public void Disconnect() | 12145 | public void Disconnect() |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index 7042c9a..fb73e1d 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | |||
@@ -1515,7 +1515,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1515 | if (!client.IsLoggingOut) | 1515 | if (!client.IsLoggingOut) |
1516 | { | 1516 | { |
1517 | client.IsLoggingOut = true; | 1517 | client.IsLoggingOut = true; |
1518 | client.Close(false); | 1518 | client.Close(false, false); |
1519 | } | 1519 | } |
1520 | } | 1520 | } |
1521 | } | 1521 | } |
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 | ||
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 0883913..2499460 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -4340,15 +4340,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
4340 | /// Tell a single agent to disconnect from the region. | 4340 | /// Tell a single agent to disconnect from the region. |
4341 | /// </summary> | 4341 | /// </summary> |
4342 | /// <param name="agentID"></param> | 4342 | /// <param name="agentID"></param> |
4343 | /// <param name="childOnly"></param> | 4343 | /// <param name="force"> |
4344 | public bool IncomingCloseAgent(UUID agentID, bool childOnly) | 4344 | /// Force the agent to close even if it might be in the middle of some other operation. You do not want to |
4345 | /// force unless you are absolutely sure that the agent is dead and a normal close is not working. | ||
4346 | /// </param> | ||
4347 | public bool IncomingCloseAgent(UUID agentID, bool force) | ||
4345 | { | 4348 | { |
4346 | //m_log.DebugFormat("[SCENE]: Processing incoming close agent for {0}", agentID); | 4349 | //m_log.DebugFormat("[SCENE]: Processing incoming close agent for {0}", agentID); |
4347 | 4350 | ||
4348 | ScenePresence presence = m_sceneGraph.GetScenePresence(agentID); | 4351 | ScenePresence presence = m_sceneGraph.GetScenePresence(agentID); |
4349 | if (presence != null) | 4352 | if (presence != null) |
4350 | { | 4353 | { |
4351 | presence.ControllingClient.Close(); | 4354 | presence.ControllingClient.Close(true, force); |
4352 | return true; | 4355 | return true; |
4353 | } | 4356 | } |
4354 | 4357 | ||
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 593e1d3..af06250 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -3560,23 +3560,32 @@ namespace OpenSim.Region.Framework.Scenes | |||
3560 | } | 3560 | } |
3561 | 3561 | ||
3562 | /// <summary> | 3562 | /// <summary> |
3563 | /// Set the color of prim faces | 3563 | /// Set the color & alpha of prim faces |
3564 | /// </summary> | 3564 | /// </summary> |
3565 | /// <param name="color"></param> | ||
3566 | /// <param name="face"></param> | 3565 | /// <param name="face"></param> |
3567 | public void SetFaceColor(Vector3 color, int face) | 3566 | /// <param name="color"></param> |
3567 | /// <param name="alpha"></param> | ||
3568 | public void SetFaceColorAlpha(int face, Vector3 color, double ?alpha) | ||
3568 | { | 3569 | { |
3570 | Vector3 clippedColor = Util.Clip(color, 0.0f, 1.0f); | ||
3571 | float clippedAlpha = alpha.HasValue ? | ||
3572 | Util.Clip((float)alpha.Value, 0.0f, 1.0f) : 0; | ||
3573 | |||
3569 | // The only way to get a deep copy/ If we don't do this, we can | 3574 | // The only way to get a deep copy/ If we don't do this, we can |
3570 | // mever detect color changes further down. | 3575 | // never detect color changes further down. |
3571 | Byte[] buf = Shape.Textures.GetBytes(); | 3576 | Byte[] buf = Shape.Textures.GetBytes(); |
3572 | Primitive.TextureEntry tex = new Primitive.TextureEntry(buf, 0, buf.Length); | 3577 | Primitive.TextureEntry tex = new Primitive.TextureEntry(buf, 0, buf.Length); |
3573 | Color4 texcolor; | 3578 | Color4 texcolor; |
3574 | if (face >= 0 && face < GetNumberOfSides()) | 3579 | if (face >= 0 && face < GetNumberOfSides()) |
3575 | { | 3580 | { |
3576 | texcolor = tex.CreateFace((uint)face).RGBA; | 3581 | texcolor = tex.CreateFace((uint)face).RGBA; |
3577 | texcolor.R = Util.Clip((float)color.X, 0.0f, 1.0f); | 3582 | texcolor.R = clippedColor.X; |
3578 | texcolor.G = Util.Clip((float)color.Y, 0.0f, 1.0f); | 3583 | texcolor.G = clippedColor.Y; |
3579 | texcolor.B = Util.Clip((float)color.Z, 0.0f, 1.0f); | 3584 | texcolor.B = clippedColor.Z; |
3585 | if (alpha.HasValue) | ||
3586 | { | ||
3587 | texcolor.A = clippedAlpha; | ||
3588 | } | ||
3580 | tex.FaceTextures[face].RGBA = texcolor; | 3589 | tex.FaceTextures[face].RGBA = texcolor; |
3581 | UpdateTextureEntry(tex.GetBytes()); | 3590 | UpdateTextureEntry(tex.GetBytes()); |
3582 | return; | 3591 | return; |
@@ -3588,15 +3597,23 @@ namespace OpenSim.Region.Framework.Scenes | |||
3588 | if (tex.FaceTextures[i] != null) | 3597 | if (tex.FaceTextures[i] != null) |
3589 | { | 3598 | { |
3590 | texcolor = tex.FaceTextures[i].RGBA; | 3599 | texcolor = tex.FaceTextures[i].RGBA; |
3591 | texcolor.R = Util.Clip((float)color.X, 0.0f, 1.0f); | 3600 | texcolor.R = clippedColor.X; |
3592 | texcolor.G = Util.Clip((float)color.Y, 0.0f, 1.0f); | 3601 | texcolor.G = clippedColor.Y; |
3593 | texcolor.B = Util.Clip((float)color.Z, 0.0f, 1.0f); | 3602 | texcolor.B = clippedColor.Z; |
3603 | if (alpha.HasValue) | ||
3604 | { | ||
3605 | texcolor.A = clippedAlpha; | ||
3606 | } | ||
3594 | tex.FaceTextures[i].RGBA = texcolor; | 3607 | tex.FaceTextures[i].RGBA = texcolor; |
3595 | } | 3608 | } |
3596 | texcolor = tex.DefaultTexture.RGBA; | 3609 | texcolor = tex.DefaultTexture.RGBA; |
3597 | texcolor.R = Util.Clip((float)color.X, 0.0f, 1.0f); | 3610 | texcolor.R = clippedColor.X; |
3598 | texcolor.G = Util.Clip((float)color.Y, 0.0f, 1.0f); | 3611 | texcolor.G = clippedColor.Y; |
3599 | texcolor.B = Util.Clip((float)color.Z, 0.0f, 1.0f); | 3612 | texcolor.B = clippedColor.Z; |
3613 | if (alpha.HasValue) | ||
3614 | { | ||
3615 | texcolor.A = clippedAlpha; | ||
3616 | } | ||
3600 | tex.DefaultTexture.RGBA = texcolor; | 3617 | tex.DefaultTexture.RGBA = texcolor; |
3601 | } | 3618 | } |
3602 | UpdateTextureEntry(tex.GetBytes()); | 3619 | UpdateTextureEntry(tex.GetBytes()); |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs index 5758869..5faf131 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs | |||
@@ -141,7 +141,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
141 | TestScene scene = new SceneHelpers().SetupScene(); | 141 | TestScene scene = new SceneHelpers().SetupScene(); |
142 | ScenePresence sp = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseTail(0x1)); | 142 | ScenePresence sp = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseTail(0x1)); |
143 | 143 | ||
144 | scene.IncomingCloseAgent(sp.UUID); | 144 | scene.IncomingCloseAgent(sp.UUID, false); |
145 | 145 | ||
146 | Assert.That(scene.GetScenePresence(sp.UUID), Is.Null); | 146 | Assert.That(scene.GetScenePresence(sp.UUID), Is.Null); |
147 | Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(sp.UUID), Is.Null); | 147 | Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(sp.UUID), Is.Null); |
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs index 3b83e58..1660c45 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs | |||
@@ -890,10 +890,10 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server | |||
890 | 890 | ||
891 | public void Close() | 891 | public void Close() |
892 | { | 892 | { |
893 | Close(true); | 893 | Close(true, false); |
894 | } | 894 | } |
895 | 895 | ||
896 | public void Close(bool sendStop) | 896 | public void Close(bool sendStop, bool force) |
897 | { | 897 | { |
898 | Disconnect(); | 898 | Disconnect(); |
899 | } | 899 | } |
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index d00a6c0..625342e 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs | |||
@@ -905,11 +905,13 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
905 | 905 | ||
906 | public void Close() | 906 | public void Close() |
907 | { | 907 | { |
908 | Close(true); | 908 | Close(true, false); |
909 | } | 909 | } |
910 | 910 | ||
911 | public void Close(bool sendStop) | 911 | public void Close(bool sendStop, bool force) |
912 | { | 912 | { |
913 | // Remove ourselves from the scene | ||
914 | m_scene.RemoveClient(AgentId, false); | ||
913 | } | 915 | } |
914 | 916 | ||
915 | public void Start() | 917 | public void Start() |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 434638d..0c7f49b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -1490,11 +1490,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1490 | scale.y = Math.Max(World.m_minPhys, Math.Min(World.m_maxPhys, scale.y)); | 1490 | scale.y = Math.Max(World.m_minPhys, Math.Min(World.m_maxPhys, scale.y)); |
1491 | scale.z = Math.Max(World.m_minPhys, Math.Min(World.m_maxPhys, scale.z)); | 1491 | scale.z = Math.Max(World.m_minPhys, Math.Min(World.m_maxPhys, scale.z)); |
1492 | } | 1492 | } |
1493 | 1493 | else | |
1494 | // Next we clamp the scale to the non-physical min/max | 1494 | { |
1495 | scale.x = Math.Max(World.m_minNonphys, Math.Min(World.m_maxNonphys, scale.x)); | 1495 | // If not physical, then we clamp the scale to the non-physical min/max |
1496 | scale.y = Math.Max(World.m_minNonphys, Math.Min(World.m_maxNonphys, scale.y)); | 1496 | scale.x = Math.Max(World.m_minNonphys, Math.Min(World.m_maxNonphys, scale.x)); |
1497 | scale.z = Math.Max(World.m_minNonphys, Math.Min(World.m_maxNonphys, scale.z)); | 1497 | scale.y = Math.Max(World.m_minNonphys, Math.Min(World.m_maxNonphys, scale.y)); |
1498 | scale.z = Math.Max(World.m_minNonphys, Math.Min(World.m_maxNonphys, scale.z)); | ||
1499 | } | ||
1498 | 1500 | ||
1499 | Vector3 tmp = part.Scale; | 1501 | Vector3 tmp = part.Scale; |
1500 | tmp.X = (float)scale.x; | 1502 | tmp.X = (float)scale.x; |
@@ -1568,7 +1570,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1568 | if (face == ScriptBaseClass.ALL_SIDES) | 1570 | if (face == ScriptBaseClass.ALL_SIDES) |
1569 | face = SceneObjectPart.ALL_SIDES; | 1571 | face = SceneObjectPart.ALL_SIDES; |
1570 | 1572 | ||
1571 | m_host.SetFaceColor(color, face); | 1573 | m_host.SetFaceColorAlpha(face, color, null); |
1572 | } | 1574 | } |
1573 | 1575 | ||
1574 | public void SetTexGen(SceneObjectPart part, int face,int style) | 1576 | public void SetTexGen(SceneObjectPart part, int face,int style) |
@@ -3900,7 +3902,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3900 | try | 3902 | try |
3901 | { | 3903 | { |
3902 | foreach (SceneObjectPart part in parts) | 3904 | foreach (SceneObjectPart part in parts) |
3903 | part.SetFaceColor(color, face); | 3905 | part.SetFaceColorAlpha(face, color, null); |
3904 | } | 3906 | } |
3905 | finally | 3907 | finally |
3906 | { | 3908 | { |
@@ -8243,8 +8245,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
8243 | LSL_Vector color=rules.GetVector3Item(idx++); | 8245 | LSL_Vector color=rules.GetVector3Item(idx++); |
8244 | double alpha=(double)rules.GetLSLFloatItem(idx++); | 8246 | double alpha=(double)rules.GetLSLFloatItem(idx++); |
8245 | 8247 | ||
8246 | part.SetFaceColor(color, face); | 8248 | part.SetFaceColorAlpha(face, color, alpha); |
8247 | SetAlpha(part, alpha, face); | ||
8248 | 8249 | ||
8249 | break; | 8250 | break; |
8250 | 8251 | ||
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 37766fb..04c3184 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -2925,7 +2925,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2925 | avatar.SpeedModifier = (float)SpeedModifier; | 2925 | avatar.SpeedModifier = (float)SpeedModifier; |
2926 | } | 2926 | } |
2927 | 2927 | ||
2928 | public void osKickAvatar(string FirstName,string SurName,string alert) | 2928 | public void osKickAvatar(string FirstName, string SurName, string alert) |
2929 | { | 2929 | { |
2930 | CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar"); | 2930 | CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar"); |
2931 | m_host.AddScriptLPS(1); | 2931 | m_host.AddScriptLPS(1); |
@@ -2939,7 +2939,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2939 | sp.ControllingClient.Kick(alert); | 2939 | sp.ControllingClient.Kick(alert); |
2940 | 2940 | ||
2941 | // ...and close on our side | 2941 | // ...and close on our side |
2942 | sp.Scene.IncomingCloseAgent(sp.UUID); | 2942 | sp.Scene.IncomingCloseAgent(sp.UUID, false); |
2943 | } | 2943 | } |
2944 | }); | 2944 | }); |
2945 | } | 2945 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs index 17a0d69..03be2ab 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs | |||
@@ -546,6 +546,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
546 | "OpenSim.Region.ScriptEngine.Shared.dll")); | 546 | "OpenSim.Region.ScriptEngine.Shared.dll")); |
547 | parameters.ReferencedAssemblies.Add(Path.Combine(rootPath, | 547 | parameters.ReferencedAssemblies.Add(Path.Combine(rootPath, |
548 | "OpenSim.Region.ScriptEngine.Shared.Api.Runtime.dll")); | 548 | "OpenSim.Region.ScriptEngine.Shared.Api.Runtime.dll")); |
549 | parameters.ReferencedAssemblies.Add(Path.Combine(rootPath, | ||
550 | "OpenMetaverseTypes.dll")); | ||
549 | 551 | ||
550 | if (lang == enumCompileType.yp) | 552 | if (lang == enumCompileType.yp) |
551 | { | 553 | { |