aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStore.cs
diff options
context:
space:
mode:
authorMic Bowman2013-02-12 11:10:17 -0800
committerMic Bowman2013-02-12 11:10:17 -0800
commit4b8c22ecfaf573b26e1b8f65cb8c95c39c3f519b (patch)
tree432a0c44ffc2ef9dd4b34463561ccc8a3f49b9a7 /OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStore.cs
parentFix handling of string values in JsonSetValueJson(). There are (diff)
downloadopensim-SC-4b8c22ecfaf573b26e1b8f65cb8c95c39c3f519b.zip
opensim-SC-4b8c22ecfaf573b26e1b8f65cb8c95c39c3f519b.tar.gz
opensim-SC-4b8c22ecfaf573b26e1b8f65cb8c95c39c3f519b.tar.bz2
opensim-SC-4b8c22ecfaf573b26e1b8f65cb8c95c39c3f519b.tar.xz
Adds the parameter for OSD serialization to encode default values. This
makes the JsonStore get/set operations symmetric.
Diffstat (limited to 'OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStore.cs')
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStore.cs11
1 files changed, 7 insertions, 4 deletions
diff --git a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStore.cs b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStore.cs
index 82a4da7..3bad06c 100644
--- a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStore.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStore.cs
@@ -131,15 +131,18 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
131 m_TakeStore = new List<TakeValueCallbackClass>(); 131 m_TakeStore = new List<TakeValueCallbackClass>();
132 m_ReadStore = new List<TakeValueCallbackClass>(); 132 m_ReadStore = new List<TakeValueCallbackClass>();
133 } 133 }
134 134
135 public JsonStore(string value) : this() 135 public JsonStore(string value) : this()
136 { 136 {
137 // This is going to throw an exception if the value is not
138 // a valid JSON chunk. Calling routines should catch the
139 // exception and handle it appropriately
137 if (String.IsNullOrEmpty(value)) 140 if (String.IsNullOrEmpty(value))
138 ValueStore = new OSDMap(); 141 ValueStore = new OSDMap();
139 else 142 else
140 ValueStore = OSDParser.DeserializeJson(value); 143 ValueStore = OSDParser.DeserializeJson(value);
141 } 144 }
142 145
143 // ----------------------------------------------------------------- 146 // -----------------------------------------------------------------
144 /// <summary> 147 /// <summary>
145 /// 148 ///
@@ -574,14 +577,14 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
574 // The path pointed to an intermediate hash structure 577 // The path pointed to an intermediate hash structure
575 if (result.Type == OSDType.Map) 578 if (result.Type == OSDType.Map)
576 { 579 {
577 value = OSDParser.SerializeJsonString(result as OSDMap); 580 value = OSDParser.SerializeJsonString(result as OSDMap,true);
578 return true; 581 return true;
579 } 582 }
580 583
581 // The path pointed to an intermediate hash structure 584 // The path pointed to an intermediate hash structure
582 if (result.Type == OSDType.Array) 585 if (result.Type == OSDType.Array)
583 { 586 {
584 value = OSDParser.SerializeJsonString(result as OSDArray); 587 value = OSDParser.SerializeJsonString(result as OSDArray,true);
585 return true; 588 return true;
586 } 589 }
587 590