From 5dcbbb726a15bc14da76b59577d009c25ad5e4e1 Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 8 Oct 2010 18:40:13 +0100 Subject: Change the order of actions to address a possible nullref --- OpenSim/Region/Framework/Scenes/SceneViewer.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneViewer.cs b/OpenSim/Region/Framework/Scenes/SceneViewer.cs index b45291f..e6f7235 100644 --- a/OpenSim/Region/Framework/Scenes/SceneViewer.cs +++ b/OpenSim/Region/Framework/Scenes/SceneViewer.cs @@ -179,11 +179,10 @@ namespace OpenSim.Region.Framework.Scenes public void Reset() { - if (m_pendingObjects != null) + lock (m_pendingObjects) { - lock (m_pendingObjects) + if (m_pendingObjects != null) { - m_pendingObjects.Clear(); m_pendingObjects = null; } -- cgit v1.1 From 4a0911bdbd3429d88b448bd324d8813cf6023e64 Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 8 Oct 2010 19:19:07 +0100 Subject: Guard against locking a nullref to avoid build break --- OpenSim/Region/Framework/Scenes/SceneViewer.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OpenSim/Region/Framework/Scenes/SceneViewer.cs b/OpenSim/Region/Framework/Scenes/SceneViewer.cs index e6f7235..b44a010 100644 --- a/OpenSim/Region/Framework/Scenes/SceneViewer.cs +++ b/OpenSim/Region/Framework/Scenes/SceneViewer.cs @@ -179,6 +179,9 @@ namespace OpenSim.Region.Framework.Scenes public void Reset() { + if (m_pendingObjects == null) + return; + lock (m_pendingObjects) { if (m_pendingObjects != null) -- cgit v1.1 From 4a57288577dd3ec6a99f467b4a2761fe83b0b4b8 Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 8 Oct 2010 23:23:07 +0100 Subject: Fix an infinite recursion --- .../CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index d05cfc2..7a175ea 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs @@ -208,7 +208,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess } foreach (List objlist in deletes.Values) - ret = DeleteToInventory(action, folderID, objlist, remoteClient); + { + foreach (SceneObjectGroup g in objlist) + ret = DeleteToInventory(action, folderID, g, remoteClient); + } return ret; } -- cgit v1.1 From 211ea5d52126bf19d53e57af750a0a964a60b56e Mon Sep 17 00:00:00 2001 From: Marck Date: Sun, 19 Sep 2010 13:26:06 +0200 Subject: Limit formatting of local console output to actual logging messages. The formatting of lines with the help of a regular expression match will be done only for output with an explicitly given logging level. This fixes the issue of colons being added to help texts on the local console. --- OpenSim/Framework/Console/LocalConsole.cs | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/OpenSim/Framework/Console/LocalConsole.cs b/OpenSim/Framework/Console/LocalConsole.cs index 6043094..5f2f404 100644 --- a/OpenSim/Framework/Console/LocalConsole.cs +++ b/OpenSim/Framework/Console/LocalConsole.cs @@ -44,6 +44,7 @@ namespace OpenSim.Framework.Console // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); // private readonly object m_syncRoot = new object(); + private const string LOGLEVEL_NONE = "(none)"; private int y = -1; private int cp = 0; @@ -278,22 +279,25 @@ namespace OpenSim.Framework.Console private void WriteLocalText(string text, string level) { - string regex = @"^(?.*?)\[(?[^\]]+)\]:?(?.*)"; - - Regex RE = new Regex(regex, RegexOptions.Multiline); - MatchCollection matches = RE.Matches(text); - string outText = text; - if (matches.Count == 1) + if (level != LOGLEVEL_NONE) { - outText = matches[0].Groups["End"].Value; - System.Console.Write(matches[0].Groups["Front"].Value); + string regex = @"^(?.*?)\[(?[^\]]+)\]:?(?.*)"; + + Regex RE = new Regex(regex, RegexOptions.Multiline); + MatchCollection matches = RE.Matches(text); - System.Console.Write("["); - WriteColorText(DeriveColor(matches[0].Groups["Category"].Value), - matches[0].Groups["Category"].Value); - System.Console.Write("]:"); + if (matches.Count == 1) + { + outText = matches[0].Groups["End"].Value; + System.Console.Write(matches[0].Groups["Front"].Value); + + System.Console.Write("["); + WriteColorText(DeriveColor(matches[0].Groups["Category"].Value), + matches[0].Groups["Category"].Value); + System.Console.Write("]:"); + } } if (level == "error") @@ -308,7 +312,7 @@ namespace OpenSim.Framework.Console public override void Output(string text) { - Output(text, "normal"); + Output(text, LOGLEVEL_NONE); } public override void Output(string text, string level) -- cgit v1.1 From ed161020e2da611e56c63ea8314e5305845f3377 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 9 Oct 2010 01:46:29 +0100 Subject: minor: remove some mono compiler warnings --- OpenSim/Framework/Tests/MundaneFrameworkTests.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/OpenSim/Framework/Tests/MundaneFrameworkTests.cs b/OpenSim/Framework/Tests/MundaneFrameworkTests.cs index 04be083..e7f8bfc 100644 --- a/OpenSim/Framework/Tests/MundaneFrameworkTests.cs +++ b/OpenSim/Framework/Tests/MundaneFrameworkTests.cs @@ -140,10 +140,10 @@ namespace OpenSim.Framework.Tests settings.Save(); settings.OnSave -= RegionSaveFired; - string str = settings.LoadedCreationDate; - int dt = settings.LoadedCreationDateTime; - string id = settings.LoadedCreationID; - string time = settings.LoadedCreationTime; +// string str = settings.LoadedCreationDate; +// int dt = settings.LoadedCreationDateTime; +// string id = settings.LoadedCreationID; +// string time = settings.LoadedCreationTime; Assert.That(m_RegionSettingsOnSaveEventFired, "RegionSettings Save Event didn't Fire"); -- cgit v1.1 From 06d3a529a9ea31de997f187bfa6a646e25b7a1cf Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Sat, 9 Oct 2010 17:46:09 +0200 Subject: In case when 1 single byte is requested (yes viewer does this) start of the ranges gets clamped with a wrong value. In case of a texture with 601 byte long texture the viewer request range 0-599 first, then 600- in which case both start and end should be 600. End can also be 0, valid request for the firt byte of the file is 0-0. Thanks to Thickbrick for explaining how HTTP range header works. --- OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs b/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs index a3238df..d564ee6 100644 --- a/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs @@ -187,8 +187,8 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps int start, end; if (TryParseRange(range, out start, out end)) { - end = Utils.Clamp(end, 1, texture.Data.Length - 1); - start = Utils.Clamp(start, 0, end - 1); + end = Utils.Clamp(end, 0, texture.Data.Length - 1); + start = Utils.Clamp(start, 0, end); int len = end - start + 1; //m_log.Debug("Serving " + start + " to " + end + " of " + texture.Data.Length + " bytes for texture " + texture.ID); -- cgit v1.1 From 5e381ec67c1a8d108fced63b76ae44eeb70aa38e Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Sat, 9 Oct 2010 18:01:11 +0200 Subject: Return error code instead of the last byte of the file if range is not satisfiable --- OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs b/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs index d564ee6..6545be7 100644 --- a/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs @@ -186,7 +186,15 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps // Range request int start, end; if (TryParseRange(range, out start, out end)) - { + { + // Before clamping end make sure we can satisfy it in order to avoid + // sending back the last byte instead of an error status + if (end >= texture.Data.Length) + { + response.StatusCode = (int)System.Net.HttpStatusCode.RequestedRangeNotSatisfiable; + return; + } + end = Utils.Clamp(end, 0, texture.Data.Length - 1); start = Utils.Clamp(start, 0, end); int len = end - start + 1; -- cgit v1.1 From 3454dfbcb3f76375ad5d98249a3cde27e5e5b250 Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Sat, 9 Oct 2010 12:07:58 -0400 Subject: weird line endings fix commit --- .../Region/CoreModules/Avatar/Assets/GetTextureModule.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs b/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs index 6545be7..38151b1 100644 --- a/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs @@ -186,13 +186,13 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps // Range request int start, end; if (TryParseRange(range, out start, out end)) - { - // Before clamping end make sure we can satisfy it in order to avoid - // sending back the last byte instead of an error status - if (end >= texture.Data.Length) - { - response.StatusCode = (int)System.Net.HttpStatusCode.RequestedRangeNotSatisfiable; - return; + { + // Before clamping end make sure we can satisfy it in order to avoid + // sending back the last byte instead of an error status + if (end >= texture.Data.Length) + { + response.StatusCode = (int)System.Net.HttpStatusCode.RequestedRangeNotSatisfiable; + return; } end = Utils.Clamp(end, 0, texture.Data.Length - 1); -- cgit v1.1 From 78f6fe0b311fc43cbb98cebb385e20baced14a38 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 9 Oct 2010 09:09:16 -0700 Subject: Added missing sections to StandaloneHypergrid.ini --- bin/config-include/StandaloneHypergrid.ini | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bin/config-include/StandaloneHypergrid.ini b/bin/config-include/StandaloneHypergrid.ini index 317af4b..f164d33 100644 --- a/bin/config-include/StandaloneHypergrid.ini +++ b/bin/config-include/StandaloneHypergrid.ini @@ -31,6 +31,12 @@ AuthenticationServiceInConnector = true SimulationServiceInConnector = true +[SimulationDataStore] + LocalServiceModule = "OpenSim.Services.Connectors.dll:SimulationDataService" + +[EstateDataStore] + LocalServiceModule = "OpenSim.Services.Connectors.dll:EstateDataService" + [AssetService] LocalServiceModule = "OpenSim.Services.AssetService.dll:AssetService" -- cgit v1.1 From 0dd4071156bc5def8bb8f6bb54051aa6198f1186 Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Sat, 9 Oct 2010 18:22:21 +0200 Subject: Fix a typo in previouis commit: start must not pass the end of the file --- OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs b/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs index 38151b1..97581e5 100644 --- a/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs @@ -187,9 +187,9 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps int start, end; if (TryParseRange(range, out start, out end)) { - // Before clamping end make sure we can satisfy it in order to avoid + // Before clamping start make sure we can satisfy it in order to avoid // sending back the last byte instead of an error status - if (end >= texture.Data.Length) + if (start >= texture.Data.Length) { response.StatusCode = (int)System.Net.HttpStatusCode.RequestedRangeNotSatisfiable; return; -- cgit v1.1 From cf61cf7b323b433adb77517989659278fa4a541e Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Sat, 9 Oct 2010 13:50:53 -0400 Subject: * Make line endings consistant in Meshmerizer.cs --- OpenSim/Region/Physics/Meshing/Meshmerizer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs index c97db8c..cf57c0a 100644 --- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs +++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs @@ -81,7 +81,7 @@ namespace OpenSim.Region.Physics.Meshing { IConfig start_config = config.Configs["Startup"]; - decodedSculptMapPath = start_config.GetString("DecodedSculptMapPath","j2kDecodeCache"); + decodedSculptMapPath = start_config.GetString("DecodedSculptMapPath","j2kDecodeCache"); cacheSculptMaps = start_config.GetBoolean("CacheSculptMaps", cacheSculptMaps); try -- cgit v1.1 From f2febb89fc8eee4977d965eeb24bd576cc8fb933 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 10 Oct 2010 22:06:47 +0100 Subject: Change the part for sound playback to be the root part / object UUID instead of the child prim because using the child prim plain doesn't work. --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 8140d42..39b109b 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -2694,7 +2694,7 @@ namespace OpenSim.Region.Framework.Scenes public void PreloadSound(string sound) { // UUID ownerID = OwnerID; - UUID objectID = UUID; + UUID objectID = ParentGroup.RootPart.UUID; UUID soundID = UUID.Zero; if (!UUID.TryParse(sound, out soundID)) @@ -3101,7 +3101,7 @@ namespace OpenSim.Region.Framework.Scenes volume = 0; UUID ownerID = _ownerID; - UUID objectID = UUID; + UUID objectID = ParentGroup.RootPart.UUID; UUID parentID = GetRootPartUUID(); UUID soundID = UUID.Zero; Vector3 position = AbsolutePosition; // region local @@ -3138,11 +3138,11 @@ namespace OpenSim.Region.Framework.Scenes else soundModule.PlayAttachedSound(soundID, ownerID, objectID, volume, position, flags, radius); ParentGroup.PlaySoundMasterPrim = this; - ownerID = this._ownerID; - objectID = this.UUID; - parentID = this.GetRootPartUUID(); - position = this.AbsolutePosition; // region local - regionHandle = this.ParentGroup.Scene.RegionInfo.RegionHandle; + ownerID = _ownerID; + objectID = ParentGroup.RootPart.UUID; + parentID = GetRootPartUUID(); + position = AbsolutePosition; // region local + regionHandle = ParentGroup.Scene.RegionInfo.RegionHandle; if (triggered) soundModule.TriggerSound(soundID, ownerID, objectID, parentID, volume, position, regionHandle, radius); else @@ -3150,7 +3150,7 @@ namespace OpenSim.Region.Framework.Scenes foreach (SceneObjectPart prim in ParentGroup.PlaySoundSlavePrims) { ownerID = prim._ownerID; - objectID = prim.UUID; + objectID = prim.ParentGroup.RootPart.UUID; parentID = prim.GetRootPartUUID(); position = prim.AbsolutePosition; // region local regionHandle = prim.ParentGroup.Scene.RegionInfo.RegionHandle; -- cgit v1.1