From a0ef3df1941147cfc894493950e4d204f6b34216 Mon Sep 17 00:00:00 2001 From: Mic Bowman Date: Wed, 30 Jan 2013 14:45:03 -0800 Subject: Add JsonTestStore to determine if a JsonStore is associated with a particular UUID. --- .../OptionalModules/Scripting/JsonStore/JsonStoreModule.cs | 13 +++++++++++++ .../Scripting/JsonStore/JsonStoreScriptModule.cs | 11 +++++++++++ 2 files changed, 24 insertions(+) (limited to 'OpenSim/Region/OptionalModules/Scripting') diff --git a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreModule.cs b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreModule.cs index e68764a..b9b3ebc 100644 --- a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreModule.cs @@ -221,6 +221,19 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore /// /// // ----------------------------------------------------------------- + public bool TestStore(UUID storeID) + { + if (! m_enabled) return false; + + lock (m_JsonValueStore) + return m_JsonValueStore.ContainsKey(storeID); + } + + // ----------------------------------------------------------------- + /// + /// + /// + // ----------------------------------------------------------------- public bool TestPath(UUID storeID, string path, bool useJson) { if (! m_enabled) return false; diff --git a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs index b9dcfea..29955af 100644 --- a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs @@ -167,6 +167,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore { m_comms.RegisterScriptInvocation(this, "JsonCreateStore"); m_comms.RegisterScriptInvocation(this, "JsonDestroyStore"); + m_comms.RegisterScriptInvocation(this, "JsonTestStore"); m_comms.RegisterScriptInvocation(this, "JsonReadNotecard"); m_comms.RegisterScriptInvocation(this, "JsonWriteNotecard"); @@ -248,6 +249,16 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore /// /// // ----------------------------------------------------------------- + protected int JsonTestStore(UUID hostID, UUID scriptID, UUID storeID) + { + return m_store.TestStore(storeID) ? 1 : 0; + } + + // ----------------------------------------------------------------- + /// + /// + /// + // ----------------------------------------------------------------- protected UUID JsonReadNotecard(UUID hostID, UUID scriptID, UUID storeID, string path, UUID assetID) { UUID reqID = UUID.Random(); -- cgit v1.1