aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreModule.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreModule.cs')
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreModule.cs17
1 files changed, 17 insertions, 0 deletions
diff --git a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreModule.cs b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreModule.cs
index 3249aa3..f1ce856 100644
--- a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreModule.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreModule.cs
@@ -54,6 +54,9 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
54 54
55 private IConfig m_config = null; 55 private IConfig m_config = null;
56 private bool m_enabled = false; 56 private bool m_enabled = false;
57 private bool m_enableObjectStore = false;
58 private int m_maxStringSpace = Int32.MaxValue;
59
57 private Scene m_scene = null; 60 private Scene m_scene = null;
58 61
59 private Dictionary<UUID,JsonStore> m_JsonValueStore; 62 private Dictionary<UUID,JsonStore> m_JsonValueStore;
@@ -90,6 +93,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
90 } 93 }
91 94
92 m_enabled = m_config.GetBoolean("Enabled", m_enabled); 95 m_enabled = m_config.GetBoolean("Enabled", m_enabled);
96 m_enableObjectStore = m_config.GetBoolean("EnableObjectStore", m_enableObjectStore);
97 m_maxStringSpace = m_config.GetInt("MaxStringSpace", m_maxStringSpace);
98 if (m_maxStringSpace == 0)
99 m_maxStringSpace = Int32.MaxValue;
93 } 100 }
94 catch (Exception e) 101 catch (Exception e)
95 { 102 {
@@ -178,6 +185,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
178 public bool AttachObjectStore(UUID objectID) 185 public bool AttachObjectStore(UUID objectID)
179 { 186 {
180 if (! m_enabled) return false; 187 if (! m_enabled) return false;
188 if (! m_enableObjectStore) return false;
181 189
182 SceneObjectPart sop = m_scene.GetSceneObjectPart(objectID); 190 SceneObjectPart sop = m_scene.GetSceneObjectPart(objectID);
183 if (sop == null) 191 if (sop == null)
@@ -311,7 +319,16 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
311 try 319 try
312 { 320 {
313 lock (map) 321 lock (map)
322 {
323 if (map.StringSpace > m_maxStringSpace)
324 {
325 m_log.WarnFormat("[JsonStore] {0} exceeded string size; {1} bytes used of {2} limit",
326 storeID,map.StringSpace,m_maxStringSpace);
327 return false;
328 }
329
314 return map.SetValue(path,value,useJson); 330 return map.SetValue(path,value,useJson);
331 }
315 } 332 }
316 catch (Exception e) 333 catch (Exception e)
317 { 334 {