aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-02-15 02:41:50 +0000
committerJustin Clark-Casey (justincc)2012-02-15 02:41:50 +0000
commit96843f2b17e60dfb275b6564facf7000e1451ea0 (patch)
tree23e28153e45d69480a7184484e89a35cd2e16856 /OpenSim/Framework
parentMerge branch 'master' into 0.7.3-post-fixes (diff)
parentMerge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff)
downloadopensim-SC-96843f2b17e60dfb275b6564facf7000e1451ea0.zip
opensim-SC-96843f2b17e60dfb275b6564facf7000e1451ea0.tar.gz
opensim-SC-96843f2b17e60dfb275b6564facf7000e1451ea0.tar.bz2
opensim-SC-96843f2b17e60dfb275b6564facf7000e1451ea0.tar.xz
Merge branch 'master' into 0.7.3-post-fixes
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/Console/CommandConsole.cs34
-rw-r--r--OpenSim/Framework/RegionInfo.cs1
-rw-r--r--OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs19
-rw-r--r--OpenSim/Framework/Util.cs5
4 files changed, 50 insertions, 9 deletions
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;
31using System.Diagnostics; 31using System.Diagnostics;
32using System.Reflection; 32using System.Reflection;
33using System.Text; 33using System.Text;
34using System.Text.RegularExpressions;
34using System.Threading; 35using System.Threading;
35using log4net; 36using log4net;
36using OpenSim.Framework; 37using OpenSim.Framework;
@@ -531,6 +532,11 @@ namespace OpenSim.Framework.Console
531 532
532 public class Parser 533 public class Parser
533 { 534 {
535 // If an unquoted portion ends with an element matching this regex
536 // and the next element contains a space, then we have stripped
537 // embedded quotes that should not have been stripped
538 private static Regex optionRegex = new Regex("^--[a-zA-Z0-9-]+=$");
539
534 public static string[] Parse(string text) 540 public static string[] Parse(string text)
535 { 541 {
536 List<string> result = new List<string>(); 542 List<string> result = new List<string>();
@@ -544,10 +550,38 @@ namespace OpenSim.Framework.Console
544 if (index % 2 == 0) 550 if (index % 2 == 0)
545 { 551 {
546 string[] words = unquoted[index].Split(new char[] {' '}); 552 string[] words = unquoted[index].Split(new char[] {' '});
553
554 bool option = false;
547 foreach (string w in words) 555 foreach (string w in words)
548 { 556 {
549 if (w != String.Empty) 557 if (w != String.Empty)
558 {
559 if (optionRegex.Match(w) == Match.Empty)
560 option = false;
561 else
562 option = true;
550 result.Add(w); 563 result.Add(w);
564 }
565 }
566 // The last item matched the regex, put the quotes back
567 if (option)
568 {
569 // If the line ended with it, don't do anything
570 if (index < (unquoted.Length - 1))
571 {
572 // Get and remove the option name
573 string optionText = result[result.Count - 1];
574 result.RemoveAt(result.Count - 1);
575
576 // Add the quoted value back
577 optionText += "\"" + unquoted[index + 1] + "\"";
578
579 // Push the result into our return array
580 result.Add(optionText);
581
582 // Skip the already used value
583 index++;
584 }
551 } 585 }
552 } 586 }
553 else 587 else
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
625 625
626 foreach (String s in allKeys) 626 foreach (String s in allKeys)
627 { 627 {
628 string val = config.GetString(s);
629 SetOtherSetting(s, config.GetString(s)); 628 SetOtherSetting(s, config.GetString(s));
630 } 629 }
631 } 630 }
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
49 /// <param name="nodeToFill"></param> 49 /// <param name="nodeToFill"></param>
50 /// <param name="processors">/param> 50 /// <param name="processors">/param>
51 /// <param name="xtr"></param> 51 /// <param name="xtr"></param>
52 public static void ExecuteReadProcessors<NodeType>( 52 /// <returns>true on successful, false if there were any processing failures</returns>
53 public static bool ExecuteReadProcessors<NodeType>(
53 NodeType nodeToFill, Dictionary<string, Action<NodeType, XmlTextReader>> processors, XmlTextReader xtr) 54 NodeType nodeToFill, Dictionary<string, Action<NodeType, XmlTextReader>> processors, XmlTextReader xtr)
54 { 55 {
55 ExecuteReadProcessors( 56 return ExecuteReadProcessors(
56 nodeToFill, 57 nodeToFill,
57 processors, 58 processors,
58 xtr, 59 xtr,
59 (o, name, e) 60 (o, name, e)
60 => m_log.ErrorFormat( 61 => m_log.DebugFormat(
61 "[ExternalRepresentationUtils]: Exception while parsing element {0}, continuing. Exception {1}{2}", 62 "[ExternalRepresentationUtils]: Exception while parsing element {0}, continuing. Exception {1}{2}",
62 name, e.Message, e.StackTrace)); 63 name, e.Message, e.StackTrace));
63 } 64 }
@@ -71,12 +72,15 @@ namespace OpenSim.Framework.Serialization.External
71 /// <param name="parseExceptionAction"> 72 /// <param name="parseExceptionAction">
72 /// Action to take if there is a parsing problem. This will usually just be to log the exception 73 /// Action to take if there is a parsing problem. This will usually just be to log the exception
73 /// </param> 74 /// </param>
74 public static void ExecuteReadProcessors<NodeType>( 75 /// <returns>true on successful, false if there were any processing failures</returns>
76 public static bool ExecuteReadProcessors<NodeType>(
75 NodeType nodeToFill, 77 NodeType nodeToFill,
76 Dictionary<string, Action<NodeType, XmlTextReader>> processors, 78 Dictionary<string, Action<NodeType, XmlTextReader>> processors,
77 XmlTextReader xtr, 79 XmlTextReader xtr,
78 Action<NodeType, string, Exception> parseExceptionAction) 80 Action<NodeType, string, Exception> parseExceptionAction)
79 { 81 {
82 bool errors = false;
83
80 string nodeName = string.Empty; 84 string nodeName = string.Empty;
81 while (xtr.NodeType != XmlNodeType.EndElement) 85 while (xtr.NodeType != XmlNodeType.EndElement)
82 { 86 {
@@ -95,6 +99,7 @@ namespace OpenSim.Framework.Serialization.External
95 } 99 }
96 catch (Exception e) 100 catch (Exception e)
97 { 101 {
102 errors = true;
98 parseExceptionAction(nodeToFill, nodeName, e); 103 parseExceptionAction(nodeToFill, nodeName, e);
99 104
100 if (xtr.NodeType == XmlNodeType.EndElement) 105 if (xtr.NodeType == XmlNodeType.EndElement)
@@ -107,6 +112,8 @@ namespace OpenSim.Framework.Serialization.External
107 xtr.ReadOuterXml(); // ignore 112 xtr.ReadOuterXml(); // ignore
108 } 113 }
109 } 114 }
115
116 return errors;
110 } 117 }
111 118
112 /// <summary> 119 /// <summary>
@@ -140,6 +147,7 @@ namespace OpenSim.Framework.Serialization.External
140 UUID.TryParse(node.InnerText, out uuid); 147 UUID.TryParse(node.InnerText, out uuid);
141 creator = userService.GetUserAccount(scopeID, uuid); 148 creator = userService.GetUserAccount(scopeID, uuid);
142 } 149 }
150
143 if (node.Name == "CreatorData" && node.InnerText != null && node.InnerText != string.Empty) 151 if (node.Name == "CreatorData" && node.InnerText != null && node.InnerText != string.Empty)
144 hasCreatorData = true; 152 hasCreatorData = true;
145 153
@@ -163,7 +171,6 @@ namespace OpenSim.Framework.Serialization.External
163 doc.Save(wr); 171 doc.Save(wr);
164 return wr.ToString(); 172 return wr.ToString();
165 } 173 }
166
167 } 174 }
168 } 175 }
169} 176} \ No newline at end of file
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
1664 /// </summary> 1664 /// </summary>
1665 public static void PrintCallStack() 1665 public static void PrintCallStack()
1666 { 1666 {
1667 StackTrace stackTrace = new StackTrace(); // get call stack 1667 StackTrace stackTrace = new StackTrace(true); // get call stack
1668 StackFrame[] stackFrames = stackTrace.GetFrames(); // get method calls (frames) 1668 StackFrame[] stackFrames = stackTrace.GetFrames(); // get method calls (frames)
1669 1669
1670 // write call stack method names 1670 // write call stack method names
1671 foreach (StackFrame stackFrame in stackFrames) 1671 foreach (StackFrame stackFrame in stackFrames)
1672 { 1672 {
1673 m_log.Debug(stackFrame.GetMethod().DeclaringType + "." + stackFrame.GetMethod().Name); // write method name 1673 MethodBase mb = stackFrame.GetMethod();
1674 m_log.DebugFormat("{0}.{1}:{2}", mb.DeclaringType, mb.Name, stackFrame.GetFileLineNumber()); // write method name
1674 } 1675 }
1675 } 1676 }
1676 1677