From d80422eba7a4c75f6947ab9186d652b0a31b845e Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 10 Feb 2012 23:39:32 +0000 Subject: Add line numbers to Util.PrintCallStack() --- OpenSim/Framework/Util.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index ed92b2d..4b0b13c 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -1664,13 +1664,14 @@ namespace OpenSim.Framework /// public static void PrintCallStack() { - StackTrace stackTrace = new StackTrace(); // get call stack + StackTrace stackTrace = new StackTrace(true); // get call stack StackFrame[] stackFrames = stackTrace.GetFrames(); // get method calls (frames) // write call stack method names foreach (StackFrame stackFrame in stackFrames) { - m_log.Debug(stackFrame.GetMethod().DeclaringType + "." + stackFrame.GetMethod().Name); // write method name + MethodBase mb = stackFrame.GetMethod(); + m_log.DebugFormat("{0}.{1}:{2}", mb.DeclaringType, mb.Name, stackFrame.GetFileLineNumber()); // write method name } } -- cgit v1.1 From 71e484516a0323187077c734d5b30d2839ebab99 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 10 Feb 2012 23:41:14 +0000 Subject: minor: Remove warning from RegionInfo due to repeated config.GetString() call where the first was unused. --- OpenSim/Framework/RegionInfo.cs | 1 - 1 file changed, 1 deletion(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index 661b457..5ba3863 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs @@ -625,7 +625,6 @@ namespace OpenSim.Framework foreach (String s in allKeys) { - string val = config.GetString(s); SetOtherSetting(s, config.GetString(s)); } } -- cgit v1.1 From 4455140f3040d6d2a14057e963619aa461b51c50 Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 10 Feb 2012 23:52:06 +0000 Subject: Change parser to leave embedded quotes alone if the pattern is recognized as an OptionSet long option --- OpenSim/Framework/Console/CommandConsole.cs | 34 +++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Console/CommandConsole.cs b/OpenSim/Framework/Console/CommandConsole.cs index a0d3541..0d6288b 100644 --- a/OpenSim/Framework/Console/CommandConsole.cs +++ b/OpenSim/Framework/Console/CommandConsole.cs @@ -31,6 +31,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Text; +using System.Text.RegularExpressions; using System.Threading; using log4net; using OpenSim.Framework; @@ -531,6 +532,11 @@ namespace OpenSim.Framework.Console public class Parser { + // If an unquoted portion ends with an element matching this regex + // and the next element contains a space, then we have stripped + // embedded quotes that should not have been stripped + private static Regex optionRegex = new Regex("^--[a-zA-Z0-9-]+=$"); + public static string[] Parse(string text) { List result = new List(); @@ -544,10 +550,38 @@ namespace OpenSim.Framework.Console if (index % 2 == 0) { string[] words = unquoted[index].Split(new char[] {' '}); + + bool option = false; foreach (string w in words) { if (w != String.Empty) + { + if (optionRegex.Match(w) == Match.Empty) + option = false; + else + option = true; result.Add(w); + } + } + // The last item matched the regex, put the quotes back + if (option) + { + // If the line ended with it, don't do anything + if (index < (unquoted.Length - 1)) + { + // Get and remove the option name + string optionText = result[result.Count - 1]; + result.RemoveAt(result.Count - 1); + + // Add the quoted value back + optionText += "\"" + unquoted[index + 1] + "\""; + + // Push the result into our return array + result.Add(optionText); + + // Skip the already used value + index++; + } } } else -- cgit v1.1 From 5023cc86f095d7d3f25213ff63c4e1fcaf6c4e92 Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 10 Feb 2012 23:52:06 +0000 Subject: Change parser to leave embedded quotes alone if the pattern is recognized as an OptionSet long option --- OpenSim/Framework/Console/CommandConsole.cs | 34 +++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Console/CommandConsole.cs b/OpenSim/Framework/Console/CommandConsole.cs index a0d3541..0d6288b 100644 --- a/OpenSim/Framework/Console/CommandConsole.cs +++ b/OpenSim/Framework/Console/CommandConsole.cs @@ -31,6 +31,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Text; +using System.Text.RegularExpressions; using System.Threading; using log4net; using OpenSim.Framework; @@ -531,6 +532,11 @@ namespace OpenSim.Framework.Console public class Parser { + // If an unquoted portion ends with an element matching this regex + // and the next element contains a space, then we have stripped + // embedded quotes that should not have been stripped + private static Regex optionRegex = new Regex("^--[a-zA-Z0-9-]+=$"); + public static string[] Parse(string text) { List result = new List(); @@ -544,10 +550,38 @@ namespace OpenSim.Framework.Console if (index % 2 == 0) { string[] words = unquoted[index].Split(new char[] {' '}); + + bool option = false; foreach (string w in words) { if (w != String.Empty) + { + if (optionRegex.Match(w) == Match.Empty) + option = false; + else + option = true; result.Add(w); + } + } + // The last item matched the regex, put the quotes back + if (option) + { + // If the line ended with it, don't do anything + if (index < (unquoted.Length - 1)) + { + // Get and remove the option name + string optionText = result[result.Count - 1]; + result.RemoveAt(result.Count - 1); + + // Add the quoted value back + optionText += "\"" + unquoted[index + 1] + "\""; + + // Push the result into our return array + result.Add(optionText); + + // Skip the already used value + index++; + } } } else -- cgit v1.1 From 189c67db957cadfe1bb5bd8aad0c86dec1ff295b Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 13 Feb 2012 20:43:26 +0000 Subject: On object deserialization, go back to logging errors at DEBUG level rather than ERROR. Restore extra log message if shape processing fails. Logging level was DEBUG before 312e145 (Fri Feb 3 2012). 312e145 also accidentally removed the 'general error' log message if any shape deserialization failed. This commit restores it, though this has no functional impact. --- .../External/ExternalRepresentationUtils.cs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs b/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs index a392af6..c56f213 100644 --- a/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs +++ b/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs @@ -49,15 +49,16 @@ namespace OpenSim.Framework.Serialization.External /// /// /param> /// - public static void ExecuteReadProcessors( + /// true on successful, false if there were any processing failures + public static bool ExecuteReadProcessors( NodeType nodeToFill, Dictionary> processors, XmlTextReader xtr) { - ExecuteReadProcessors( + return ExecuteReadProcessors( nodeToFill, processors, xtr, (o, name, e) - => m_log.ErrorFormat( + => m_log.DebugFormat( "[ExternalRepresentationUtils]: Exception while parsing element {0}, continuing. Exception {1}{2}", name, e.Message, e.StackTrace)); } @@ -71,12 +72,15 @@ namespace OpenSim.Framework.Serialization.External /// /// Action to take if there is a parsing problem. This will usually just be to log the exception /// - public static void ExecuteReadProcessors( + /// true on successful, false if there were any processing failures + public static bool ExecuteReadProcessors( NodeType nodeToFill, Dictionary> processors, XmlTextReader xtr, Action parseExceptionAction) { + bool errors = false; + string nodeName = string.Empty; while (xtr.NodeType != XmlNodeType.EndElement) { @@ -95,6 +99,7 @@ namespace OpenSim.Framework.Serialization.External } catch (Exception e) { + errors = true; parseExceptionAction(nodeToFill, nodeName, e); if (xtr.NodeType == XmlNodeType.EndElement) @@ -107,6 +112,8 @@ namespace OpenSim.Framework.Serialization.External xtr.ReadOuterXml(); // ignore } } + + return errors; } /// @@ -140,6 +147,7 @@ namespace OpenSim.Framework.Serialization.External UUID.TryParse(node.InnerText, out uuid); creator = userService.GetUserAccount(scopeID, uuid); } + if (node.Name == "CreatorData" && node.InnerText != null && node.InnerText != string.Empty) hasCreatorData = true; @@ -163,7 +171,6 @@ namespace OpenSim.Framework.Serialization.External doc.Save(wr); return wr.ToString(); } - } } -} +} \ No newline at end of file -- cgit v1.1 From 2d3381b795611a8857077d1effb41323c2cb8658 Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 14 Feb 2012 23:16:20 +0100 Subject: Implement region crossing of sitting avatars. Edit mode and llSetPos work but unscripted default sit anim is lost. Still some Gfx glitching. Physical crossing doesn't work yet. --- OpenSim/Framework/ChildAgentDataUpdate.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/ChildAgentDataUpdate.cs b/OpenSim/Framework/ChildAgentDataUpdate.cs index 6d048f4..fe12874 100644 --- a/OpenSim/Framework/ChildAgentDataUpdate.cs +++ b/OpenSim/Framework/ChildAgentDataUpdate.cs @@ -308,6 +308,8 @@ namespace OpenSim.Framework public Animation[] Anims; public UUID GranterID; + public UUID ParentPart; + public Vector3 SitOffset; // Appearance public AvatarAppearance Appearance; @@ -468,6 +470,10 @@ namespace OpenSim.Framework } args["attach_objects"] = attObjs; } + + args["parent_part"] = OSD.FromUUID(ParentPart); + args["sit_offset"] = OSD.FromString(SitOffset.ToString()); + return args; } @@ -675,6 +681,11 @@ namespace OpenSim.Framework } } } + + if (args["parent_part"] != null) + ParentPart = args["parent_part"].AsUUID(); + if (args["sit_offset"] != null) + Vector3.TryParse(args["sit_offset"].AsString(), out SitOffset); } public AgentData() -- cgit v1.1