diff options
author | Mic Bowman | 2013-02-19 22:53:46 -0800 |
---|---|---|
committer | Mic Bowman | 2013-02-19 22:53:46 -0800 |
commit | 903b40b47e53cc131b57919e8a8a83db3cb36f96 (patch) | |
tree | dbba969abe346afa0ebc0539ebc9df9493b431f6 | |
parent | Deleted all AssemblyFileVersion directives (diff) | |
download | opensim-SC_OLD-903b40b47e53cc131b57919e8a8a83db3cb36f96.zip opensim-SC_OLD-903b40b47e53cc131b57919e8a8a83db3cb36f96.tar.gz opensim-SC_OLD-903b40b47e53cc131b57919e8a8a83db3cb36f96.tar.bz2 opensim-SC_OLD-903b40b47e53cc131b57919e8a8a83db3cb36f96.tar.xz |
Fix the JsonStore path set problem justincc found earlier today and
remove the deprecated TestPath functions.
4 files changed, 3 insertions, 96 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs b/OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs index b40d24f..345f01b 100644 --- a/OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs | |||
@@ -51,7 +51,6 @@ namespace OpenSim.Region.Framework.Interfaces | |||
51 | 51 | ||
52 | JsonStoreNodeType GetPathType(UUID storeID, string path); | 52 | JsonStoreNodeType GetPathType(UUID storeID, string path); |
53 | bool TestStore(UUID storeID); | 53 | bool TestStore(UUID storeID); |
54 | bool TestPath(UUID storeID, string path, bool useJson); | ||
55 | 54 | ||
56 | bool SetValue(UUID storeID, string path, string value, bool useJson); | 55 | bool SetValue(UUID storeID, string path, string value, bool useJson); |
57 | bool RemoveValue(UUID storeID, string path); | 56 | bool RemoveValue(UUID storeID, string path); |
diff --git a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStore.cs b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStore.cs index ca3989a..40adba1 100644 --- a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStore.cs +++ b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStore.cs | |||
@@ -84,11 +84,11 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore | |||
84 | protected static Regex m_PathComponent = new Regex("\\.({[^}]+}|\\[[0-9]+\\]|\\[\\+\\])"); | 84 | protected static Regex m_PathComponent = new Regex("\\.({[^}]+}|\\[[0-9]+\\]|\\[\\+\\])"); |
85 | 85 | ||
86 | // extract the internals of an array reference | 86 | // extract the internals of an array reference |
87 | protected static Regex m_SimpleArrayPattern = new Regex("\\[([0-9]+)\\]"); | 87 | protected static Regex m_SimpleArrayPattern = new Regex("^\\[([0-9]+)\\]$"); |
88 | protected static Regex m_ArrayPattern = new Regex("\\[([0-9]+|\\+)\\]"); | 88 | protected static Regex m_ArrayPattern = new Regex("^\\[([0-9]+|\\+)\\]$"); |
89 | 89 | ||
90 | // extract the internals of a has reference | 90 | // extract the internals of a has reference |
91 | protected static Regex m_HashPattern = new Regex("{([^}]+)}"); | 91 | protected static Regex m_HashPattern = new Regex("^{([^}]+)}$"); |
92 | 92 | ||
93 | // ----------------------------------------------------------------- | 93 | // ----------------------------------------------------------------- |
94 | /// <summary> | 94 | /// <summary> |
@@ -173,28 +173,6 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore | |||
173 | /// | 173 | /// |
174 | /// </summary> | 174 | /// </summary> |
175 | // ----------------------------------------------------------------- | 175 | // ----------------------------------------------------------------- |
176 | public bool TestPath(string expr, bool useJson) | ||
177 | { | ||
178 | Stack<string> path; | ||
179 | if (! ParsePathExpression(expr,out path)) | ||
180 | return false; | ||
181 | |||
182 | OSD result = ProcessPathExpression(ValueStore,path); | ||
183 | |||
184 | if (result == null) | ||
185 | return false; | ||
186 | |||
187 | if (useJson || OSDBaseType(result.Type)) | ||
188 | return true; | ||
189 | |||
190 | return false; | ||
191 | } | ||
192 | |||
193 | // ----------------------------------------------------------------- | ||
194 | /// <summary> | ||
195 | /// | ||
196 | /// </summary> | ||
197 | // ----------------------------------------------------------------- | ||
198 | public int ArrayLength(string expr) | 176 | public int ArrayLength(string expr) |
199 | { | 177 | { |
200 | Stack<string> path; | 178 | Stack<string> path; |
diff --git a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreModule.cs b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreModule.cs index fb35068..e78a2f4 100644 --- a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreModule.cs | |||
@@ -302,38 +302,6 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore | |||
302 | /// | 302 | /// |
303 | /// </summary> | 303 | /// </summary> |
304 | // ----------------------------------------------------------------- | 304 | // ----------------------------------------------------------------- |
305 | public bool TestPath(UUID storeID, string path, bool useJson) | ||
306 | { | ||
307 | if (! m_enabled) return false; | ||
308 | |||
309 | JsonStore map = null; | ||
310 | lock (m_JsonValueStore) | ||
311 | { | ||
312 | if (! m_JsonValueStore.TryGetValue(storeID,out map)) | ||
313 | { | ||
314 | m_log.InfoFormat("[JsonStore] Missing store {0}",storeID); | ||
315 | return false; | ||
316 | } | ||
317 | } | ||
318 | |||
319 | try | ||
320 | { | ||
321 | lock (map) | ||
322 | return map.TestPath(path,useJson); | ||
323 | } | ||
324 | catch (Exception e) | ||
325 | { | ||
326 | m_log.Error(string.Format("[JsonStore]: Path test failed for {0} in {1}", path, storeID), e); | ||
327 | } | ||
328 | |||
329 | return false; | ||
330 | } | ||
331 | |||
332 | // ----------------------------------------------------------------- | ||
333 | /// <summary> | ||
334 | /// | ||
335 | /// </summary> | ||
336 | // ----------------------------------------------------------------- | ||
337 | public bool SetValue(UUID storeID, string path, string value, bool useJson) | 305 | public bool SetValue(UUID storeID, string path, string value, bool useJson) |
338 | { | 306 | { |
339 | if (! m_enabled) return false; | 307 | if (! m_enabled) return false; |
diff --git a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs index ef08c05..e13eb56 100644 --- a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs | |||
@@ -168,32 +168,6 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore | |||
168 | { | 168 | { |
169 | m_comms.RegisterScriptInvocations(this); | 169 | m_comms.RegisterScriptInvocations(this); |
170 | m_comms.RegisterConstants(this); | 170 | m_comms.RegisterConstants(this); |
171 | |||
172 | // m_comms.RegisterScriptInvocation(this, "JsonCreateStore"); | ||
173 | // m_comms.RegisterScriptInvocation(this, "JsonAttachObjectStore"); | ||
174 | // m_comms.RegisterScriptInvocation(this, "JsonDestroyStore"); | ||
175 | // m_comms.RegisterScriptInvocation(this, "JsonTestStore"); | ||
176 | |||
177 | // m_comms.RegisterScriptInvocation(this, "JsonReadNotecard"); | ||
178 | // m_comms.RegisterScriptInvocation(this, "JsonWriteNotecard"); | ||
179 | |||
180 | // m_comms.RegisterScriptInvocation(this, "JsonTestPathList"); | ||
181 | // m_comms.RegisterScriptInvocation(this, "JsonTestPath"); | ||
182 | // m_comms.RegisterScriptInvocation(this, "JsonTestPathJson"); | ||
183 | |||
184 | // m_comms.RegisterScriptInvocation(this, "JsonGetValue"); | ||
185 | // m_comms.RegisterScriptInvocation(this, "JsonGetValueJson"); | ||
186 | |||
187 | // m_comms.RegisterScriptInvocation(this, "JsonTakeValue"); | ||
188 | // m_comms.RegisterScriptInvocation(this, "JsonTakeValueJson"); | ||
189 | |||
190 | // m_comms.RegisterScriptInvocation(this, "JsonReadValue"); | ||
191 | // m_comms.RegisterScriptInvocation(this, "JsonReadValueJson"); | ||
192 | |||
193 | // m_comms.RegisterScriptInvocation(this, "JsonSetValue"); | ||
194 | // m_comms.RegisterScriptInvocation(this, "JsonSetValueJson"); | ||
195 | |||
196 | // m_comms.RegisterScriptInvocation(this, "JsonRemoveValue"); | ||
197 | } | 171 | } |
198 | catch (Exception e) | 172 | catch (Exception e) |
199 | { | 173 | { |
@@ -341,18 +315,6 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore | |||
341 | return (int)m_store.GetPathType(storeID,path); | 315 | return (int)m_store.GetPathType(storeID,path); |
342 | } | 316 | } |
343 | 317 | ||
344 | [ScriptInvocation] | ||
345 | public int JsonTestPath(UUID hostID, UUID scriptID, UUID storeID, string path) | ||
346 | { | ||
347 | return m_store.TestPath(storeID,path,false) ? 1 : 0; | ||
348 | } | ||
349 | |||
350 | [ScriptInvocation] | ||
351 | public int JsonTestPathJson(UUID hostID, UUID scriptID, UUID storeID, string path) | ||
352 | { | ||
353 | return m_store.TestPath(storeID,path,true) ? 1 : 0; | ||
354 | } | ||
355 | |||
356 | // ----------------------------------------------------------------- | 318 | // ----------------------------------------------------------------- |
357 | /// <summary> | 319 | /// <summary> |
358 | /// | 320 | /// |